Merge branch '1209' into 'dbus-interface'
适配浅色主题 See merge request kylin-desktop/kylin-nm!500
This commit is contained in:
commit
6fcef8a81a
|
@ -162,7 +162,7 @@ void MainWindow::onTransChanged()
|
|||
void MainWindow::paintWithTrans()
|
||||
{
|
||||
QPalette pal = m_centralWidget->palette();
|
||||
QColor color = m_centralWidget->palette().base().color();
|
||||
QColor color = qApp->palette().base().color();
|
||||
color.setAlphaF(m_transparency);
|
||||
pal.setColor(QPalette::Base, color);
|
||||
m_centralWidget->setPalette(pal);
|
||||
|
@ -170,11 +170,11 @@ void MainWindow::paintWithTrans()
|
|||
QPalette tabPal = m_centralWidget->tabBar()->palette();
|
||||
tabPal.setColor(QPalette::Base, color);
|
||||
|
||||
QColor inactiveColor = pal.color(QPalette::Window);
|
||||
QColor inactiveColor = qApp->palette().window().color();
|
||||
inactiveColor.setAlphaF(0.75 *m_transparency);
|
||||
pal.setColor(QPalette::Window, inactiveColor);
|
||||
tabPal.setColor(QPalette::Window, inactiveColor);
|
||||
|
||||
m_centralWidget->tabBar()->setPalette(pal);
|
||||
m_centralWidget->tabBar()->setPalette(tabPal);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -123,14 +123,14 @@ void TabPage::initUI()
|
|||
void TabPage::onPaletteChanged()
|
||||
{
|
||||
QPalette labPal = m_activatedNetLabel->palette();
|
||||
QColor color = labPal.color(QPalette::PlaceholderText);
|
||||
QColor color = qApp->palette().color(QPalette::PlaceholderText);
|
||||
labPal.setColor(QPalette::WindowText, color);
|
||||
m_activatedNetLabel->setPalette(labPal);
|
||||
m_inactivatedNetLabel->setPalette(labPal);
|
||||
|
||||
if (m_deviceComboBox->view()) {
|
||||
QPalette view_pal = m_deviceComboBox->view()->palette();
|
||||
QColor view_color = m_deviceComboBox->palette().color(QPalette::Active, QPalette::Button);
|
||||
QColor view_color = qApp->palette().color(QPalette::Active, QPalette::Button);
|
||||
view_pal.setColor(QPalette::Base, view_color);
|
||||
m_deviceComboBox->setPalette(view_pal);
|
||||
m_deviceComboBox->view()->setPalette(view_pal);
|
||||
|
|
Loading…
Reference in New Issue