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

Merge pull request #6079

bodwok (3):
      fix(ui): updating friends list color at runtime
      fix(ui): using a separate css file
      style: placing files in alphabetical order
This commit is contained in:
sudden6 2020-05-23 10:59:30 +02:00
commit 8e7ae808a3
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
4 changed files with 52 additions and 26 deletions

View File

@ -79,6 +79,7 @@
<file>themes/dark/emoticonWidget/dot_page_hover.svg</file>
<file>themes/dark/emoticonWidget/emoticonWidget.css</file>
<file>themes/dark/friendList/friendList.css</file>
<file>themes/dark/genericChatRoomWidget/genericChatRoomWidget.css</file>
<file>themes/dark/msgEdit/msgEdit.css</file>
<file>themes/dark/settings/mainHead.css</file>
<file>themes/dark/settings/checkboxChecked.svg</file>
@ -144,6 +145,7 @@
<file>themes/default/emoticonWidget/dot_page_hover.svg</file>
<file>themes/default/emoticonWidget/emoticonWidget.css</file>
<file>themes/default/friendList/friendList.css</file>
<file>themes/default/genericChatRoomWidget/genericChatRoomWidget.css</file>
<file>themes/default/msgEdit/msgEdit.css</file>
<file>themes/default/settings/mainHead.css</file>
<file>themes/default/statusButton/statusButton.css</file>

View File

@ -42,8 +42,10 @@ GenericChatroomWidget::GenericChatroomWidget(bool compact, QWidget* parent)
statusMessageLabel = new CroppingLabel(this);
statusMessageLabel->setTextFormat(Qt::PlainText);
statusMessageLabel->setForegroundRole(QPalette::WindowText);
statusMessageLabel->setObjectName("statusMessageLabelObj");
nameLabel->setForegroundRole(QPalette::WindowText);
nameLabel->setObjectName("nameLabelObj");
Settings& s = Settings::getInstance();
connect(&s, &Settings::compactLayoutChanged, this, &GenericChatroomWidget::compactChange);
@ -122,15 +124,11 @@ bool GenericChatroomWidget::isActive()
void GenericChatroomWidget::setActive(bool _active)
{
active = _active;
if (active) {
setBackgroundRole(QPalette::Light);
statusMessageLabel->setForegroundRole(QPalette::HighlightedText);
nameLabel->setForegroundRole(QPalette::HighlightedText);
} else {
setBackgroundRole(QPalette::Window);
statusMessageLabel->setForegroundRole(QPalette::WindowText);
nameLabel->setForegroundRole(QPalette::WindowText);
}
setProperty("active", active);
nameLabel->setProperty("active", active);
statusMessageLabel->setProperty("active", active);
Style::repolish(this);
}
void GenericChatroomWidget::setName(const QString& name)
@ -160,23 +158,7 @@ QString GenericChatroomWidget::getTitle() const
void GenericChatroomWidget::reloadTheme()
{
QPalette p;
p = statusMessageLabel->palette();
p.setColor(QPalette::WindowText, Style::getColor(Style::GroundExtra)); // Base color
p.setColor(QPalette::HighlightedText, Style::getColor(Style::StatusActive)); // Color when active
statusMessageLabel->setPalette(p);
p = nameLabel->palette();
p.setColor(QPalette::WindowText, Style::getColor(Style::GroundBase)); // Base color
p.setColor(QPalette::HighlightedText, Style::getColor(Style::NameActive)); // Color when active
nameLabel->setPalette(p);
p = palette();
p.setColor(QPalette::Window, Style::getColor(Style::ThemeMedium)); // Base background color
p.setColor(QPalette::Highlight, Style::getColor(Style::ThemeLight)); // On mouse over
p.setColor(QPalette::Light, Style::getColor(Style::GroundBase)); // When active
setPalette(p);
setStyleSheet(Style::getStylesheet("genericChatRoomWidget/genericChatRoomWidget.css"));
}
void GenericChatroomWidget::activate()

View File

@ -0,0 +1,21 @@
GenericChatroomWidget {
background-color: @themeMedium; /* Base background color */
}
GenericChatroomWidget:hover {
background-color: @themeLight; /* On mouse over */
}
GenericChatroomWidget[active="true"] {
background-color: @groundBase; /* When active */
}
CroppingLabel#statusMessageLabelObj {
color: @groundExtra; /* Base color */
}
CroppingLabel#statusMessageLabelObj[active="true"] {
color: @statusActive; /* Color when active */
}
CroppingLabel#nameLabelObj {
color: @groundExtra; /* Base color */
}
CroppingLabel#nameLabelObj[active="true"] {
color: @nameActive; /* Color when active */
}

View File

@ -0,0 +1,21 @@
GenericChatroomWidget {
background-color: @themeMedium; /* Base background color */
}
GenericChatroomWidget:hover {
background-color: @themeLight; /* On mouse over */
}
GenericChatroomWidget[active="true"] {
background-color: @groundBase; /* When active */
}
CroppingLabel#statusMessageLabelObj {
color: @groundExtra; /* Base color */
}
CroppingLabel#statusMessageLabelObj[active="true"] {
color: @statusActive; /* Color when active */
}
CroppingLabel#nameLabelObj {
color: @groundBase; /* Base color */
}
CroppingLabel#nameLabelObj[active="true"] {
color: @nameActive; /* Color when active */
}