Mercurial > hg > svgui
comparison view/ViewManager.cpp @ 1573:4e466690bf20
Comments and palette adjustments
author | Chris Cannam |
---|---|
date | Fri, 17 Jan 2020 13:45:57 +0000 |
parents | 9bf8aa2916e9 |
children | dd7166cdf6bc |
comparison
equal
deleted
inserted
replaced
1572:5f6fdd525158 | 1573:4e466690bf20 |
---|---|
70 m_showCentreLine = | 70 m_showCentreLine = |
71 settings.value("show-centre-line", m_showCentreLine).toBool(); | 71 settings.value("show-centre-line", m_showCentreLine).toBool(); |
72 settings.endGroup(); | 72 settings.endGroup(); |
73 | 73 |
74 if (getGlobalDarkBackground()) { | 74 if (getGlobalDarkBackground()) { |
75 /* | 75 // i.e. widgets are already dark; create a light palette in |
76 cerr << "dark palette:" << endl; | 76 // case we are asked to switch to it, but don't create a dark |
77 cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << endl; | 77 // one because it will be assigned from the actual application |
78 cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << endl; | 78 // palette if we switch |
79 cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << endl; | 79 |
80 cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << endl; | |
81 cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << endl; | |
82 cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << endl; | |
83 cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << endl; | |
84 cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << endl; | |
85 cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << endl; | |
86 cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << endl; | |
87 cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << endl; | |
88 */ | |
89 m_lightPalette = QPalette(QColor("#000000"), // WindowText | 80 m_lightPalette = QPalette(QColor("#000000"), // WindowText |
90 QColor("#dddfe4"), // Button | 81 QColor("#dddfe4"), // Button |
91 QColor("#ffffff"), // Light | 82 QColor("#ffffff"), // Light |
92 QColor("#555555"), // Dark | 83 QColor("#555555"), // Dark |
93 QColor("#c7c7c7"), // Mid | 84 QColor("#c7c7c7"), // Mid |
96 QColor("#ffffff"), // Base | 87 QColor("#ffffff"), // Base |
97 QColor("#efefef")); // Window | 88 QColor("#efefef")); // Window |
98 | 89 |
99 | 90 |
100 } else { | 91 } else { |
101 /* | 92 // i.e. widgets are currently light; create a dark palette in |
102 cerr << "light palette:" << endl; | 93 // case we are asked to switch to it, but don't create a light |
103 cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << endl; | 94 // one because it will be assigned from the actual application |
104 cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << endl; | 95 // palette if we switch |
105 cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << endl; | 96 |
106 cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << endl; | 97 m_darkPalette = QPalette(QColor("#f0f0f0"), // WindowText |
107 cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << endl; | |
108 cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << endl; | |
109 cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << endl; | |
110 cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << endl; | |
111 cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << endl; | |
112 cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << endl; | |
113 cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << endl; | |
114 */ | |
115 m_darkPalette = QPalette(QColor("#ffffff"), // WindowText | |
116 QColor("#3e3e3e"), // Button | 98 QColor("#3e3e3e"), // Button |
117 QColor("#808080"), // Light | 99 QColor("#808080"), // Light |
118 QColor("#1e1e1e"), // Dark | 100 QColor("#1e1e1e"), // Dark |
119 QColor("#404040"), // Mid | 101 QColor("#404040"), // Mid |
120 QColor("#ffffff"), // Text | 102 QColor("#f0f0f0"), // Text |
121 QColor("#ffffff"), // BrightText | 103 QColor("#ffffff"), // BrightText |
122 QColor("#000000"), // Base | 104 QColor("#000000"), // Base |
123 QColor("#202020")); // Window | 105 QColor("#202020")); // Window |
106 | |
107 m_darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, | |
108 QColor("#808080")); | |
109 m_darkPalette.setColor(QPalette::Disabled, QPalette::Text, | |
110 QColor("#808080")); | |
111 m_darkPalette.setColor(QPalette::Disabled, QPalette::Shadow, | |
112 QColor("#000000")); | |
124 } | 113 } |
125 } | 114 } |
126 | 115 |
127 ViewManager::~ViewManager() | 116 ViewManager::~ViewManager() |
128 { | 117 { |