# HG changeset patch # User Chris Cannam # Date 1579794231 0 # Node ID 2c974337f3068de09df9b51531ce9da92514c908 # Parent 9c4a057302ff7fb6d9d812ed622100e0eb0df09c Pick accent colour from OS theme if appropriate diff -r 9c4a057302ff -r 2c974337f306 view/ViewManager.cpp --- 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 #include #include @@ -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));