Mercurial > hg > svgui
changeset 1573:4e466690bf20
Comments and palette adjustments
author | Chris Cannam |
---|---|
date | Fri, 17 Jan 2020 13:45:57 +0000 |
parents | 5f6fdd525158 |
children | dd7166cdf6bc |
files | view/ViewManager.cpp |
diffstat | 1 files changed, 19 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- 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")); } }