1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

statusPanel: css, cleanup

This commit is contained in:
krepa098 2014-10-04 10:24:20 +02:00
parent 300d045dd9
commit a486f9aa4d
5 changed files with 96 additions and 1328 deletions

File diff suppressed because it is too large Load Diff

View File

@ -79,7 +79,7 @@ QFont Style::getFont(Style::Font font)
// fonts as defined in
// https://github.com/ItsDuke/Tox-UI/blob/master/UI%20GUIDELINES.md
static QFont fonts[] = {
appFont(15, QFont::Bold),
appFont(16, QFont::Bold),
appFont(14, QFont::Normal),
appFont(14, QFont::Bold),
appFont(13, QFont::Normal),

View File

@ -147,5 +147,6 @@
<file>img/group_2x.png</file>
<file>ui/chatroomWidgets/genericChatroomWidget.css</file>
<file>ui/fileTransferInstance/sliverRTEdge.png</file>
<file>ui/window/statusPanel.css</file>
</qresource>
</RCC>

70
ui/window/statusPanel.css Normal file
View File

@ -0,0 +1,70 @@
#statusPanel
{
background-color: @darkGrey;
}
#statusPanel > #statusHead > #nameLabel {
font: @extraBig;
color: @white;
}
#statusPanel > #statusHead > #statusLabel {
font: @smallLight;
color: @lightGrey;
}
#statusPanel > #statusHead > #statusButton
{
background: none;
background-color: @mediumGrey;
border: none;
border-radius: 6px;
width: 20px;
height: 40px;
}
#statusPanel > #statusHead > #statusButton[status="online"]
{
image: url(":ui/statusButton/dot_online.png") center center;
}
#statusPanel > #statusHead > #statusButton[status="away"]
{
image: url(":ui/statusButton/dot_idle.png") center center;
}
#statusPanel > #statusHead > #statusButton[status="busy"]
{
image: url(":ui/statusButton/dot_busy.png") center center;
}
#statusPanel > #statusHead > #statusButton[status="offline"]
{
image: url(":ui/statusButton/dot_away.png") center center;
}
/*Bugged in Qt, but it's probably better to leave enabled so that users can tell it's clickable*/
#statusPanel > #statusHead > #statusButton:hover
{
background-color: @mediumGreyLight;
}
#statusPanel > #statusHead > #statusButton:pressed
{
background-color: @mediumGrey;
}
#statusPanel > #statusHead > #statusButton:focus {
outline: none;
}
#statusPanel > #statusHead > #statusButton::menu-indicator {image: none;}
#statusPanel > #statusHead > #statusButton::menu-indicator:pressed, #statusPanel > #statusHead > #statusButton::menu-indicator:open
{
image: url(":ui/statusButton/menu_indicator.png");
subcontrol-origin: padding;
subcontrol-position: bottom center;
position: relative;
bottom: 2px;
}

View File

@ -130,16 +130,7 @@ Widget::Widget(QWidget *parent)
ui->nameLabel->setEditable(true);
ui->statusLabel->setEditable(true);
ui->statusLabel->setFont(Style::getFont(Style::Medium));
ui->nameLabel->setFont(Style::getFont(Style::ExtraBig));
// delay setting username and message until Core inits
//ui->nameLabel->setText(core->getUsername());
ui->nameLabel->setStyleSheet("QLabel { color : white; font-size: 11pt; font-weight:bold;}");
//ui->statusLabel->setText(core->getStatusMessage());
ui->statusLabel->setStyleSheet("QLabel { color : white; font-size: 8pt;}");
ui->statusButton->setStyleSheet(Style::getStylesheet(":/ui/statusButton/statusButton.css"));
ui->statusPanel->setStyleSheet(Style::getStylesheet(":/ui/window/statusPanel.css"));
QMenu *statusButtonMenu = new QMenu(ui->statusButton);
QAction* setStatusOnline = statusButtonMenu->addAction(Widget::tr("Online","Button to set your status to 'Online'"));
@ -150,22 +141,12 @@ Widget::Widget(QWidget *parent)
setStatusBusy->setIcon(QIcon(":ui/statusButton/dot_busy.png"));
ui->statusButton->setMenu(statusButtonMenu);
ui->titleBar->setMouseTracking(true);
ui->LTitle->setMouseTracking(true);
ui->tbMenu->setMouseTracking(true);
ui->pbMin->setMouseTracking(true);
ui->pbMax->setMouseTracking(true);
ui->pbClose->setMouseTracking(true);
ui->statusHead->setMouseTracking(true);
//ui->friendList->viewport()->installEventFilter(this);
// disable proportional scaling
ui->mainSplitter->setStretchFactor(0,0);
ui->mainSplitter->setStretchFactor(1,1);
ui->statusButton->setObjectName("offline");
ui->statusButton->style()->polish(ui->statusButton);
ui->statusButton->setProperty("status", "offline");
Style::repolish(ui->statusButton);
camera = new Camera;
settingsDialog = new SettingsDialog(this);
@ -359,26 +340,23 @@ void Widget::onStatusSet(Status status)
{
//We have to use stylesheets here, there's no way to
//prevent the button icon from moving when pressed otherwise
if (status == Status::Online)
switch (status)
{
ui->statusButton->setObjectName("online");
ui->statusButton->style()->polish(ui->statusButton);
}
else if (status == Status::Away)
{
ui->statusButton->setObjectName("away");
ui->statusButton->style()->polish(ui->statusButton);
}
else if (status == Status::Busy)
{
ui->statusButton->setObjectName("busy");
ui->statusButton->style()->polish(ui->statusButton);
}
else if (status == Status::Offline)
{
ui->statusButton->setObjectName("offline");
ui->statusButton->style()->polish(ui->statusButton);
case Status::Online:
ui->statusButton->setProperty("status" ,"online");
break;
case Status::Away:
ui->statusButton->setProperty("status" ,"away");
break;
case Status::Busy:
ui->statusButton->setProperty("status" ,"busy");
break;
case Status::Offline:
ui->statusButton->setProperty("status" ,"offline");
break;
}
Style::repolish(ui->statusButton);
}
void Widget::onAddClicked()