Mercurial > hg > svgui
changeset 1577:2c974337f306 background-mode
Pick accent colour from OS theme if appropriate
author | Chris Cannam |
---|---|
date | Thu, 23 Jan 2020 15:43:51 +0000 |
parents | 9c4a057302ff |
children | 57a4ee52ad69 |
files | view/ViewManager.cpp |
diffstat | 1 files changed, 17 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/view/ViewManager.cpp Thu Jan 23 15:14:07 2020 +0000 +++ b/view/ViewManager.cpp Thu Jan 23 15:43:51 2020 +0000 @@ -22,6 +22,8 @@ #include "View.h" #include "Overview.h" +#include "system/System.h" + #include <QSettings> #include <QApplication> #include <QStyleFactory> @@ -87,7 +89,14 @@ QColor("#ffffff"), // BrightText QColor("#ffffff"), // Base QColor("#efefef")); // Window - + + m_lightPalette.setColor(QPalette::Highlight, Qt::darkBlue); + if (!OSReportsDarkThemeActive()) { + int r, g, b; + if (OSQueryAccentColour(r, g, b)) { + m_lightPalette.setColor(QPalette::Highlight, QColor(r, g, b)); + } + } } else { // i.e. widgets are currently light; create a dark palette in @@ -106,6 +115,13 @@ QColor("#202020")); // Window m_darkPalette.setColor(QPalette::Highlight, QColor(25, 130, 220)); + if (OSReportsDarkThemeActive()) { + int r, g, b; + if (OSQueryAccentColour(r, g, b)) { + m_darkPalette.setColor(QPalette::Highlight, QColor(r, g, b)); + } + } + m_darkPalette.setColor(QPalette::Link, QColor(50, 175, 255)); m_darkPalette.setColor(QPalette::LinkVisited, QColor(50, 175, 255));