# HG changeset patch # User Chris Cannam # Date 1579268757 0 # Node ID 4e466690bf2079122a8bfb53598a817b7862124f # Parent 5f6fdd525158060bd898a11e12ee52ccb3a98719 Comments and palette adjustments diff -r 5f6fdd525158 -r 4e466690bf20 view/ViewManager.cpp --- a/view/ViewManager.cpp Wed Jan 15 13:58:33 2020 +0000 +++ b/view/ViewManager.cpp Fri Jan 17 13:45:57 2020 +0000 @@ -72,20 +72,11 @@ settings.endGroup(); if (getGlobalDarkBackground()) { -/* - cerr << "dark palette:" << endl; - cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << endl; - cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << endl; - cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << endl; - cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << endl; - cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << endl; - cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << endl; - cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << endl; - cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << endl; - cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << endl; - cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << endl; - cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << endl; -*/ + // i.e. widgets are already dark; create a light palette in + // case we are asked to switch to it, but don't create a dark + // one because it will be assigned from the actual application + // palette if we switch + m_lightPalette = QPalette(QColor("#000000"), // WindowText QColor("#dddfe4"), // Button QColor("#ffffff"), // Light @@ -98,29 +89,27 @@ } else { -/* - cerr << "light palette:" << endl; - cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << endl; - cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << endl; - cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << endl; - cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << endl; - cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << endl; - cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << endl; - cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << endl; - cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << endl; - cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << endl; - cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << endl; - cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << endl; -*/ - m_darkPalette = QPalette(QColor("#ffffff"), // WindowText + // i.e. widgets are currently light; create a dark palette in + // case we are asked to switch to it, but don't create a light + // one because it will be assigned from the actual application + // palette if we switch + + m_darkPalette = QPalette(QColor("#f0f0f0"), // WindowText QColor("#3e3e3e"), // Button QColor("#808080"), // Light QColor("#1e1e1e"), // Dark QColor("#404040"), // Mid - QColor("#ffffff"), // Text + QColor("#f0f0f0"), // Text QColor("#ffffff"), // BrightText QColor("#000000"), // Base QColor("#202020")); // Window + + m_darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, + QColor("#808080")); + m_darkPalette.setColor(QPalette::Disabled, QPalette::Text, + QColor("#808080")); + m_darkPalette.setColor(QPalette::Disabled, QPalette::Shadow, + QColor("#000000")); } }