Mercurial > hg > svgui
changeset 1574:dd7166cdf6bc background-mode
Windows stylesheet
author | Chris Cannam |
---|---|
date | Fri, 17 Jan 2020 21:36:54 +0000 |
parents | 4e466690bf20 |
children | 3761d1ea5015 |
files | view/ViewManager.cpp |
diffstat | 1 files changed, 33 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/view/ViewManager.cpp Fri Jan 17 13:45:57 2020 +0000 +++ b/view/ViewManager.cpp Fri Jan 17 21:36:54 2020 +0000 @@ -781,13 +781,44 @@ m_lightPalette = QApplication::palette(); } -#ifndef Q_OS_MAC +#ifdef Q_OS_MAC + return; +#endif + if (dark) { + +#ifdef Q_OS_WIN32 + // Some UI elements on Windows don't use the palette. + + QString existingStyleSheet = qApp->styleSheet(); + if (existingStyleSheet == "") { + QString styleSheet = + "QFrame { background: #202020; color: #f0f0f0; }\n" + "QAbstractButton { background: #202020; color: #f0f0f0; }\n" + "QDialog { background-color: #202020; }\n" + "QToolBar { background-color: #202020; }\n" + "QMenuBar { background-color: #404040; }\n" + "QMenuBar::item:selected { background-color: #707070; }\n" + "QMenuBar::item:pressed { background-color: #707070; }\n" + "QComboBox { background-color: #404040; }\n" + "QTabWidget::pane { border: 1px solid #c7c7c7; top: -1px; }\n" + "QTabBar::tab { background-color: #404040; border: 1px solid #c7c7c7; bottom: -1px; padding: 5px; }\n" + "QTabBar::tab:selected { background-color: #707070; }\n" + ; + qApp->setStyleSheet(styleSheet); + } +#endif + QApplication::setPalette(m_darkPalette); + } else { + +#ifdef Q_OS_WIN32 + qApp->setStyleSheet(""); +#endif + QApplication::setPalette(m_lightPalette); } -#endif } bool