diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 7da38324..36ab97d0 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -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); } /** diff --git a/src/frontend/tab-pages/tabpage.cpp b/src/frontend/tab-pages/tabpage.cpp index f758cf50..e6523215 100644 --- a/src/frontend/tab-pages/tabpage.cpp +++ b/src/frontend/tab-pages/tabpage.cpp @@ -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);