Changeset View
Changeset View
Standalone View
Standalone View
kcms/krdb/krdb.cpp
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 118 | { | |||
---|---|---|---|---|---|
131 | 131 | | |||
132 | settings.setValue(QStringLiteral("/qt/Palette/active"), actcg); | 132 | settings.setValue(QStringLiteral("/qt/Palette/active"), actcg); | ||
133 | settings.setValue(QStringLiteral("/qt/Palette/inactive"), inactcg); | 133 | settings.setValue(QStringLiteral("/qt/Palette/inactive"), inactcg); | ||
134 | settings.setValue(QStringLiteral("/qt/Palette/disabled"), discg); | 134 | settings.setValue(QStringLiteral("/qt/Palette/disabled"), discg); | ||
135 | 135 | | |||
136 | // export kwin's colors to qtrc for kstyle to use | 136 | // export kwin's colors to qtrc for kstyle to use | ||
137 | KConfigGroup wmCfgGroup(kglobalcfg, "WM"); | 137 | KConfigGroup wmCfgGroup(kglobalcfg, "WM"); | ||
138 | 138 | | |||
139 | // Only look up the default depth if there is a screen available | ||||
140 | unsigned int pixmapDepth = 0; | ||||
141 | if (QApplication::primaryScreen() != nullptr) | ||||
apol: Are you sure this builds? `primaryScreen` isn't static.
I'd use `qGuiApp->primaryScreen()`. | |||||
mart: is indeeed a static: QGuiApplication::primaryScreen() should be fine | |||||
142 | pixmapDepth = QPixmap::defaultDepth(); | ||||
143 | | ||||
139 | // active colors | 144 | // active colors | ||
140 | QColor clr = newPal.color( QPalette::Active, QPalette::Background ); | 145 | QColor clr = newPal.color( QPalette::Active, QPalette::Background ); | ||
141 | clr = wmCfgGroup.readEntry("activeBackground", clr); | 146 | clr = wmCfgGroup.readEntry("activeBackground", clr); | ||
142 | settings.setValue(QStringLiteral("/qt/KWinPalette/activeBackground"), clr.name()); | 147 | settings.setValue(QStringLiteral("/qt/KWinPalette/activeBackground"), clr.name()); | ||
143 | if (QPixmap::defaultDepth() > 8) | 148 | if (pixmapDepth > 8) | ||
144 | clr = clr.dark(110); | 149 | clr = clr.dark(110); | ||
145 | clr = wmCfgGroup.readEntry("activeBlend", clr); | 150 | clr = wmCfgGroup.readEntry("activeBlend", clr); | ||
146 | settings.setValue(QStringLiteral("/qt/KWinPalette/activeBlend"), clr.name()); | 151 | settings.setValue(QStringLiteral("/qt/KWinPalette/activeBlend"), clr.name()); | ||
147 | clr = newPal.color( QPalette::Active, QPalette::HighlightedText ); | 152 | clr = newPal.color( QPalette::Active, QPalette::HighlightedText ); | ||
148 | clr = wmCfgGroup.readEntry("activeForeground", clr); | 153 | clr = wmCfgGroup.readEntry("activeForeground", clr); | ||
149 | settings.setValue(QStringLiteral("/qt/KWinPalette/activeForeground"), clr.name()); | 154 | settings.setValue(QStringLiteral("/qt/KWinPalette/activeForeground"), clr.name()); | ||
150 | clr = newPal.color( QPalette::Active,QPalette::Background ); | 155 | clr = newPal.color( QPalette::Active,QPalette::Background ); | ||
151 | clr = wmCfgGroup.readEntry("frame", clr); | 156 | clr = wmCfgGroup.readEntry("frame", clr); | ||
152 | settings.setValue(QStringLiteral("/qt/KWinPalette/frame"), clr.name()); | 157 | settings.setValue(QStringLiteral("/qt/KWinPalette/frame"), clr.name()); | ||
153 | clr = wmCfgGroup.readEntry("activeTitleBtnBg", clr); | 158 | clr = wmCfgGroup.readEntry("activeTitleBtnBg", clr); | ||
154 | settings.setValue(QStringLiteral("/qt/KWinPalette/activeTitleBtnBg"), clr.name()); | 159 | settings.setValue(QStringLiteral("/qt/KWinPalette/activeTitleBtnBg"), clr.name()); | ||
155 | 160 | | |||
156 | // inactive colors | 161 | // inactive colors | ||
157 | clr = newPal.color(QPalette::Inactive, QPalette::Background); | 162 | clr = newPal.color(QPalette::Inactive, QPalette::Background); | ||
158 | clr = wmCfgGroup.readEntry("inactiveBackground", clr); | 163 | clr = wmCfgGroup.readEntry("inactiveBackground", clr); | ||
159 | settings.setValue(QStringLiteral("/qt/KWinPalette/inactiveBackground"), clr.name()); | 164 | settings.setValue(QStringLiteral("/qt/KWinPalette/inactiveBackground"), clr.name()); | ||
160 | if (QPixmap::defaultDepth() > 8) | 165 | if (pixmapDepth > 8) | ||
161 | clr = clr.dark(110); | 166 | clr = clr.dark(110); | ||
162 | clr = wmCfgGroup.readEntry("inactiveBlend", clr); | 167 | clr = wmCfgGroup.readEntry("inactiveBlend", clr); | ||
163 | settings.setValue(QStringLiteral("/qt/KWinPalette/inactiveBlend"), clr.name()); | 168 | settings.setValue(QStringLiteral("/qt/KWinPalette/inactiveBlend"), clr.name()); | ||
164 | clr = newPal.color(QPalette::Inactive, QPalette::Background).dark(); | 169 | clr = newPal.color(QPalette::Inactive, QPalette::Background).dark(); | ||
165 | clr = wmCfgGroup.readEntry("inactiveForeground", clr); | 170 | clr = wmCfgGroup.readEntry("inactiveForeground", clr); | ||
166 | settings.setValue(QStringLiteral("/qt/KWinPalette/inactiveForeground"), clr.name()); | 171 | settings.setValue(QStringLiteral("/qt/KWinPalette/inactiveForeground"), clr.name()); | ||
167 | clr = newPal.color(QPalette::Inactive, QPalette::Background); | 172 | clr = newPal.color(QPalette::Inactive, QPalette::Background); | ||
168 | clr = wmCfgGroup.readEntry("inactiveFrame", clr); | 173 | clr = wmCfgGroup.readEntry("inactiveFrame", clr); | ||
▲ Show 20 Lines • Show All 562 Lines • Show Last 20 Lines |
Are you sure this builds? primaryScreen isn't static.
I'd use qGuiApp->primaryScreen().