fix(WiFi): wayland浅色主题下托盘WiFi界面图标显示不清晰问题(bug#187464)

This commit is contained in:
zhangyuanyuan1 2023-08-14 16:55:52 +08:00
parent 75b8dbed5f
commit c9932d57f8
5 changed files with 11 additions and 12 deletions

View File

@ -334,10 +334,11 @@ void ListItem::onPaletteChanged()
pal = themePalette(true, this); pal = themePalette(true, this);
} }
} }
pal.setColor(QPalette::Base, pal.color(QPalette::Base)); //解决Wayland环境this->setPalette(pal)不生效问题
this->setPalette(pal); this->setPalette(pal);
if (m_menu != nullptr) { if (m_menu != nullptr) {
pal.setColor(QPalette::Base, pal.color(QPalette::Base));
pal.setColor(QPalette::Text, pal.color(QPalette::Text)); pal.setColor(QPalette::Text, pal.color(QPalette::Text));
m_menu->setPalette(pal); m_menu->setPalette(pal);
} }

View File

@ -255,16 +255,6 @@ void WlanListItem::keyPressEvent(QKeyEvent *event)
return QFrame::keyPressEvent(event); return QFrame::keyPressEvent(event);
} }
void WlanListItem::paintEvent(QPaintEvent *event)
{
// QPalette pal = qApp->palette();
// if (m_pwdLineEdit != nullptr) {
// pal.setColor(QPalette::Base, pal.color(QPalette::Base));
// m_pwdLineEdit->setPalette(pal);
// }
return QWidget::paintEvent(event);
}
void WlanListItem::initWlanUI() void WlanListItem::initWlanUI()
{ {
m_hasPwd = (m_wirelessNetItem.m_secuType.isEmpty() || m_wirelessNetItem.m_secuType == "") ? false : true; m_hasPwd = (m_wirelessNetItem.m_secuType.isEmpty() || m_wirelessNetItem.m_secuType == "") ? false : true;

View File

@ -90,7 +90,6 @@ protected:
void leaveEvent(QEvent *event); void leaveEvent(QEvent *event);
bool eventFilter(QObject *watched, QEvent *event); bool eventFilter(QObject *watched, QEvent *event);
void keyPressEvent(QKeyEvent *event); void keyPressEvent(QKeyEvent *event);
void paintEvent(QPaintEvent *event);
Q_SIGNALS: Q_SIGNALS:
void itemHeightChanged(const bool isExpanded, const QString &ssid); void itemHeightChanged(const bool isExpanded, const QString &ssid);

View File

@ -78,6 +78,11 @@ void InfoButton::onPaletteChanged()
pal = themePalette(true, this); pal = themePalette(true, this);
} }
} }
pal.setColor(QPalette::Base, pal.color(QPalette::Base));//解决Wayland环境this->setPalette(pal)不生效问题
pal.setColor(QPalette::Text, pal.color(QPalette::Text));
pal.setColor(QPalette::Highlight, pal.color(QPalette::Highlight));
pal.setColor(QPalette::BrightText, pal.color(QPalette::BrightText));
this->setPalette(pal); this->setPalette(pal);
m_foregroundColor = FOREGROUND_COLOR_NORMAL; m_foregroundColor = FOREGROUND_COLOR_NORMAL;

View File

@ -154,6 +154,10 @@ void RadioItemButton::onPaletteChanged()
pal = themePalette(true, this); pal = themePalette(true, this);
} }
} }
pal.setColor(QPalette::Base, pal.color(QPalette::Base)); //解决Wayland环境this->setPalette(pal)不生效问题
pal.setColor(QPalette::BrightText, pal.color(QPalette::BrightText));
pal.setColor(QPalette::Highlight, pal.color(QPalette::Highlight));
this->setPalette(pal); this->setPalette(pal);
refreshButtonIcon(); refreshButtonIcon();