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:
parent
300d045dd9
commit
a486f9aa4d
1293
mainwindow.ui
1293
mainwindow.ui
File diff suppressed because it is too large
Load Diff
|
@ -79,7 +79,7 @@ QFont Style::getFont(Style::Font font)
|
||||||
// fonts as defined in
|
// fonts as defined in
|
||||||
// https://github.com/ItsDuke/Tox-UI/blob/master/UI%20GUIDELINES.md
|
// https://github.com/ItsDuke/Tox-UI/blob/master/UI%20GUIDELINES.md
|
||||||
static QFont fonts[] = {
|
static QFont fonts[] = {
|
||||||
appFont(15, QFont::Bold),
|
appFont(16, QFont::Bold),
|
||||||
appFont(14, QFont::Normal),
|
appFont(14, QFont::Normal),
|
||||||
appFont(14, QFont::Bold),
|
appFont(14, QFont::Bold),
|
||||||
appFont(13, QFont::Normal),
|
appFont(13, QFont::Normal),
|
||||||
|
|
1
res.qrc
1
res.qrc
|
@ -147,5 +147,6 @@
|
||||||
<file>img/group_2x.png</file>
|
<file>img/group_2x.png</file>
|
||||||
<file>ui/chatroomWidgets/genericChatroomWidget.css</file>
|
<file>ui/chatroomWidgets/genericChatroomWidget.css</file>
|
||||||
<file>ui/fileTransferInstance/sliverRTEdge.png</file>
|
<file>ui/fileTransferInstance/sliverRTEdge.png</file>
|
||||||
|
<file>ui/window/statusPanel.css</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
70
ui/window/statusPanel.css
Normal file
70
ui/window/statusPanel.css
Normal 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;
|
||||||
|
}
|
|
@ -130,16 +130,7 @@ Widget::Widget(QWidget *parent)
|
||||||
ui->nameLabel->setEditable(true);
|
ui->nameLabel->setEditable(true);
|
||||||
ui->statusLabel->setEditable(true);
|
ui->statusLabel->setEditable(true);
|
||||||
|
|
||||||
ui->statusLabel->setFont(Style::getFont(Style::Medium));
|
ui->statusPanel->setStyleSheet(Style::getStylesheet(":/ui/window/statusPanel.css"));
|
||||||
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"));
|
|
||||||
|
|
||||||
QMenu *statusButtonMenu = new QMenu(ui->statusButton);
|
QMenu *statusButtonMenu = new QMenu(ui->statusButton);
|
||||||
QAction* setStatusOnline = statusButtonMenu->addAction(Widget::tr("Online","Button to set your status to 'Online'"));
|
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"));
|
setStatusBusy->setIcon(QIcon(":ui/statusButton/dot_busy.png"));
|
||||||
ui->statusButton->setMenu(statusButtonMenu);
|
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
|
// disable proportional scaling
|
||||||
ui->mainSplitter->setStretchFactor(0,0);
|
ui->mainSplitter->setStretchFactor(0,0);
|
||||||
ui->mainSplitter->setStretchFactor(1,1);
|
ui->mainSplitter->setStretchFactor(1,1);
|
||||||
|
|
||||||
ui->statusButton->setObjectName("offline");
|
ui->statusButton->setProperty("status", "offline");
|
||||||
ui->statusButton->style()->polish(ui->statusButton);
|
Style::repolish(ui->statusButton);
|
||||||
|
|
||||||
camera = new Camera;
|
camera = new Camera;
|
||||||
settingsDialog = new SettingsDialog(this);
|
settingsDialog = new SettingsDialog(this);
|
||||||
|
@ -359,26 +340,23 @@ void Widget::onStatusSet(Status status)
|
||||||
{
|
{
|
||||||
//We have to use stylesheets here, there's no way to
|
//We have to use stylesheets here, there's no way to
|
||||||
//prevent the button icon from moving when pressed otherwise
|
//prevent the button icon from moving when pressed otherwise
|
||||||
if (status == Status::Online)
|
switch (status)
|
||||||
{
|
{
|
||||||
ui->statusButton->setObjectName("online");
|
case Status::Online:
|
||||||
ui->statusButton->style()->polish(ui->statusButton);
|
ui->statusButton->setProperty("status" ,"online");
|
||||||
}
|
break;
|
||||||
else if (status == Status::Away)
|
case Status::Away:
|
||||||
{
|
ui->statusButton->setProperty("status" ,"away");
|
||||||
ui->statusButton->setObjectName("away");
|
break;
|
||||||
ui->statusButton->style()->polish(ui->statusButton);
|
case Status::Busy:
|
||||||
}
|
ui->statusButton->setProperty("status" ,"busy");
|
||||||
else if (status == Status::Busy)
|
break;
|
||||||
{
|
case Status::Offline:
|
||||||
ui->statusButton->setObjectName("busy");
|
ui->statusButton->setProperty("status" ,"offline");
|
||||||
ui->statusButton->style()->polish(ui->statusButton);
|
break;
|
||||||
}
|
|
||||||
else if (status == Status::Offline)
|
|
||||||
{
|
|
||||||
ui->statusButton->setObjectName("offline");
|
|
||||||
ui->statusButton->style()->polish(ui->statusButton);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Style::repolish(ui->statusButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::onAddClicked()
|
void Widget::onAddClicked()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user