Add Header color support to the colorscheme editor
Now that there is a Header color set in KColorScheme, we need to support it and migrate the active/inactive foreground/background WM
group colors to Header color set roles so that existing color schemes don't have bad titlebar colors.
Change of plan: Header colors should be used inside apps instead of titlebar colors and titlebar colors should only be used for window titlebars.
Header color set was added in https://phabricator.kde.org/D29232
Depends on:
-
frameworks/kconfigwidgets!2 (merged) -
!22 (merged) -
breeze!9 (closed) - Not sure about this one since MDI windows are kind of like windows, but not really.
-
Breeze GTK needs a patch -
kde-gtk-config!5 (closed) -
Kexi may need a patch -
Krita may need a patch -
KStars may need a patch -
Digikam may need a patch -
MauiKit may need a patch -
latte-dock may need a patch -
qtcurve may need a patch -
kcmutils may need a patch -
kdelibs4support may need a patch -
kmag may need a patch
Click here to see files that contain "WM"
calligra/kexi/src/kexiutils/FontSettings_p.cpp
45-static const FontData DefaultFontData[FontSettingsData::FontTypesCount] = {
46- { GeneralId, "font", DefaultFont, 10, -1, QFont::SansSerif },
47- { GeneralId, "fixed", "Oxygen Mono", 9, -1, QFont::Monospace },
48- { GeneralId, "toolBarFont", DefaultFont, 9, -1, QFont::SansSerif },
49- { GeneralId, "menuFont", DefaultFont, 10, -1, QFont::SansSerif },
50: { "WM", "activeFont", DefaultFont, 10, -1, QFont::SansSerif },
51- { GeneralId, "taskbarFont", DefaultFont, 10, -1, QFont::SansSerif },
52- { GeneralId, "smallestReadableFont", DefaultFont, 8, -1, QFont::SansSerif }
53-};
54-
55-QFont FontSettingsData::font(FontTypes fontType)
calligra/kexi/src/kexiutils/utils.cpp
1085-QColor KexiUtils::inactiveTitleColor()
1086-{
1087-#ifdef Q_OS_WIN
1088- return qt_colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTION));
1089-#else
1090: KConfigGroup g(KSharedConfig::openConfig(), "WM");
1091- return g.readEntry("inactiveBackground", QColor(224, 223, 222));
1092-#endif
1093-}
1094-
1095-// NOTE: keep this in sync with kdebase/workspace/kcontrol/colors/colorscm.cpp
1096-QColor KexiUtils::inactiveTextColor()
1097-{
1098-#ifdef Q_OS_WIN
1099- return qt_colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTIONTEXT));
1100-#else
1101: KConfigGroup g(KSharedConfig::openConfig(), "WM");
1102- return g.readEntry("inactiveForeground", QColor(75, 71, 67));
1103-#endif
1104-}
1105-
1106-// NOTE: keep this in sync with kdebase/workspace/kcontrol/colors/colorscm.cpp
1107-QColor KexiUtils::activeTitleColor()
1108-{
1109-#ifdef Q_OS_WIN
1110- return qt_colorref2qrgb(GetSysColor(COLOR_ACTIVECAPTION));
1111-#else
1112: KConfigGroup g(KSharedConfig::openConfig(), "WM");
1113- return g.readEntry("activeBackground", QColor(48, 174, 232));
1114-#endif
1115-}
1116-
1117-// NOTE: keep this in sync with kdebase/workspace/kcontrol/colors/colorscm.cpp
1118-QColor KexiUtils::activeTextColor()
1119-{
1120-#ifdef Q_OS_WIN
1121- return qt_colorref2qrgb(GetSysColor(COLOR_CAPTIONTEXT));
1122-#else
1123: KConfigGroup g(KSharedConfig::openConfig(), "WM");
1124- return g.readEntry("activeForeground", QColor(255, 255, 255));
1125-#endif
1126-}
1127-
1128-QString KexiUtils::makeStandardCaption(const QString &userCaption, CaptionFlags flags)
extragear/base/latte-dock/app/plasma/extended/theme.cpp
231- KSharedConfigPtr originalPtr = KSharedConfig::openConfig(m_originalSchemePath);
232- KSharedConfigPtr defaultPtr = KSharedConfig::openConfig(m_defaultSchemePath);
233-
234- if (originalPtr && defaultPtr) {
235- KConfigGroup normalWindowGroup(originalPtr, "Colors:Window");
236: KConfigGroup defaultWMGroup(defaultPtr, "WM");
237-
238- defaultWMGroup.writeEntry("activeBackground", normalWindowGroup.readEntry("BackgroundNormal", QColor()));
239- defaultWMGroup.writeEntry("activeForeground", normalWindowGroup.readEntry("ForegroundNormal", QColor()));
240-
241- defaultWMGroup.sync();
--
287- }
288- }
289- }
290-
291- //! update WM group
292: KConfigGroup reversedWMGroup(reversedPtr, "WM");
293- KConfigGroup normalWindowGroup(originalPtr, "Colors:Window");
294-
295- if (reversedWMGroup.keyList().contains("activeBackground")
296- && reversedWMGroup.keyList().contains("activeForeground")
297- && reversedWMGroup.keyList().contains("inactiveBackground")
298- && reversedWMGroup.keyList().contains("inactiveForeground")) {
299- //! reverse usual wm titlebar values
300: KConfigGroup originalGroup(originalPtr, "WM");
301- reversedWMGroup.writeEntry("activeBackground", normalWindowGroup.readEntry("ForegroundNormal", QColor()));
302- reversedWMGroup.writeEntry("activeForeground", normalWindowGroup.readEntry("BackgroundNormal", QColor()));
303- reversedWMGroup.writeEntry("inactiveBackground", originalGroup.readEntry("inactiveForeground", QColor()));
304- reversedWMGroup.writeEntry("inactiveForeground", originalGroup.readEntry("inactiveBackground", QColor()));
305- reversedWMGroup.sync();
306- }
307-
308- if (reversedWMGroup.keyList().contains("activeBlend")
309- && reversedWMGroup.keyList().contains("inactiveBlend")) {
310: KConfigGroup originalGroup(originalPtr, "WM");
311- reversedWMGroup.writeEntry("activeBlend", originalGroup.readEntry("inactiveBlend", QColor()));
312- reversedWMGroup.writeEntry("inactiveBlend", originalGroup.readEntry("activeBlend", QColor()));
313- reversedWMGroup.sync();
314- }
315-
extragear/base/latte-dock/app/wm/schemecolors.cpp
212- if (m_schemeFile.isEmpty() || !QFileInfo(m_schemeFile).exists()) {
213- return;
214- }
215-
216- KSharedConfigPtr filePtr = KSharedConfig::openConfig(m_schemeFile);
217: KConfigGroup wmGroup = KConfigGroup(filePtr, "WM");
218- KConfigGroup selGroup = KConfigGroup(filePtr, "Colors:Selection");
219- //KConfigGroup viewGroup = KConfigGroup(filePtr, "Colors:View");
220- KConfigGroup windowGroup = KConfigGroup(filePtr, "Colors:Window");
221- KConfigGroup buttonGroup = KConfigGroup(filePtr, "Colors:Button");
222-
extragear/base/qtcurve/qt4/config/qtcurveconfig.cpp
2089- "that they can be used by KDE3 applications?")))
2090- {
2091- QString kde3Home(kdeHome(true));
2092- KConfig k3globals(kde3Home+"/share/config/kdeglobals", KConfig::NoGlobals);
2093- KConfigGroup general(&k3globals, "General");
2094: KConfigGroup wm(&k3globals, "WM");
2095-
2096- general.writeEntry("alternateBackground", palette().color(QPalette::Active, QPalette::AlternateBase));
2097- general.writeEntry("background", palette().color(QPalette::Active, QPalette::Window));
2098- general.writeEntry("buttonBackground", palette().color(QPalette::Active, QPalette::Button));
2099- general.writeEntry("buttonForeground", palette().color(QPalette::Active, QPalette::ButtonText));
--
2106- general.writeEntry("visitedLinkColor", palette().color(QPalette::Active, QPalette::LinkVisited));
2107-
2108- if(kdeHome(false)!=kde3Home)
2109- {
2110- KConfigGroup k4General(KGlobal::config(), "General");
2111: KConfigGroup k4wm(KGlobal::config(), "WM");
2112-
2113- // Mainly for K3B...
2114- wm.writeEntry("activeBackground", k4wm.readEntry("activeBackground",
2115- palette().color(QPalette::Active, QPalette::Window)));
2116- wm.writeEntry("activeForeground", k4wm.readEntry("activeForeground",
extragear/base/qtcurve/qt5/config/qtcurveconfig.cpp
2047- "that they can be used by KDE3 applications?")))
2048- {
2049- QString kde3Home(kdeHome(true));
2050- KConfig k3globals(kde3Home+"/share/config/kdeglobals", KConfig::NoGlobals);
2051- KConfigGroup general(&k3globals, "General");
2052: KConfigGroup wm(&k3globals, "WM");
2053-
2054- general.writeEntry("alternateBackground", palette().color(QPalette::Active, QPalette::AlternateBase));
2055- general.writeEntry("background", palette().color(QPalette::Active, QPalette::Window));
2056- general.writeEntry("buttonBackground", palette().color(QPalette::Active, QPalette::Button));
2057- general.writeEntry("buttonForeground", palette().color(QPalette::Active, QPalette::ButtonText));
--
2063- general.writeEntry("linkColor", palette().color(QPalette::Active, QPalette::Link));
2064- general.writeEntry("visitedLinkColor", palette().color(QPalette::Active, QPalette::LinkVisited));
2065-
2066- if (kdeHome(false)!=kde3Home) {
2067- KConfigGroup k4General(KSharedConfig::openConfig(), "General");
2068: KConfigGroup k4wm(KSharedConfig::openConfig(), "WM");
2069-
2070- // Mainly for K3B...
2071- wm.writeEntry("activeBackground", k4wm.readEntry("activeBackground",
2072- palette().color(QPalette::Active, QPalette::Window)));
2073- wm.writeEntry("activeForeground", k4wm.readEntry("activeForeground",
extragear/base/qtcurve/qt5/style/qtcurve.cpp
3938- }
3939- f.close();
3940- }
3941-#else
3942- Q_UNUSED(option);
3943: KConfigGroup cg(m_kdeGlobals, "WM");
3944-
3945- QColor col = cg.readEntry("activeBackground", QColor(48, 174, 232));
3946-
3947- if (col != m_backgroundCols[ORIGINAL_SHADE]) {
3948- m_activeMdiColors = new QColor[TOTAL_SHADES + 1];
extragear/edu/kstars/kstars/auxiliary/thememanager.cpp
339- const QBitmap b2 = QBitmap::fromData(bitsSize, bits2);
340-
341- QPixmap pixmap(23, 16);
342- pixmap.fill(Qt::black); // FIXME use some color other than black for borders?
343-
344: KConfigGroup group(config, QLatin1String("WM"));
345- QPainter p(&pixmap);
346- SchemeManager windowScheme(QPalette::Active, SchemeManager::Window, config);
347- p.fillRect(1, 1, 7, 7, windowScheme.background());
348- p.fillRect(2, 2, 5, 2, QBrush(windowScheme.foreground().color(), b1));
349-
extragear/graphics/digikam/core/libs/widgets/mainview/thememanager_p.cpp
1240- const QBitmap b2 = QBitmap::fromData(bitsSize, bits2);
1241-
1242- QPixmap pixmap(23, 16);
1243- pixmap.fill(Qt::black); // FIXME use some color other than black for borders?
1244-
1245: KConfigGroup group(config, QLatin1String("WM"));
1246- QPainter p(&pixmap);
1247- SchemeManager windowScheme(QPalette::Active, SchemeManager::Window, config);
1248- p.fillRect(1, 1, 7, 7, windowScheme.background());
1249- p.fillRect(2, 2, 5, 2, QBrush(windowScheme.foreground().color(), b1));
1250-
extragear/graphics/krita/libs/ui/thememanager.cpp
264- const QBitmap b2 = QBitmap::fromData(bitsSize, bits2);
265-
266- QPixmap pixmap(23, 16);
267- pixmap.fill(Qt::black); // FIXME use some color other than black for borders?
268-
269: KConfigGroup group(config, "WM");
270- QPainter p(&pixmap);
271- KColorScheme windowScheme(QPalette::Active, KColorScheme::Window, config);
272- p.fillRect(1, 1, 7, 7, windowScheme.background());
273- p.fillRect(2, 2, 5, 2, QBrush(windowScheme.foreground().color(), b1));
274-
frameworks/kcmutils/src/kdeglobals.kcfg
502- <label>Show text on toolbar icons </label>
503- <whatsthis>Whether text should be shown in addition to icons on toolbar icons</whatsthis>
504- <default>false</default>
505- </entry>
506- </group>
507: <group name="WM" >
508- <entry key="activeBackground" type="String" />
509- <entry key="activeBlend" type="String" />
510- <entry key="activeFont" type="String" />
511- <entry key="activeForeground" type="String" />
512- <entry key="activeTitleBtnBg" type="String" />
frameworks/kconfigwidgets/src/kcolorscheme.cpp
321- _contrast = KColorScheme::contrastF(config);
322-
323- // loaded-from-config colors (no adjustment)
324- if (strcmp(group, "Colors:Header") == 0) { // For compatibility with color schemes made before ColorSet::Header was added
325- // Default to old titlebar colors before using Header default colors
326: KConfigGroup wmConfig(config, "WM");
327- _brushes.bg[KColorScheme::NormalBackground] = cfg.readEntry("BackgroundNormal",
328- wmConfig.readEntry("activeBackground", SET_DEFAULT(NormalBackground)));
329- _brushes.bg[KColorScheme::AlternateBackground] = cfg.readEntry("BackgroundAlternate",
330- wmConfig.readEntry("inactiveBackground", SET_DEFAULT(AlternateBackground)));
331- } else {
--
347- _contrast = KColorScheme::contrastF(config);
348-
349- // loaded-from-config colors
350- if (strcmp(group, "Colors:Header") == 0) { // For compatibility with color schemes made before ColorSet::Header was added
351- // Default to old titlebar colors before using Header default colors
352: KConfigGroup wmConfig(config, "WM");
353- _brushes.bg[KColorScheme::NormalBackground] = cfg.readEntry("BackgroundNormal",
354- wmConfig.readEntry("activeBackground", SET_DEFAULT(NormalBackground)));
355- _brushes.bg[KColorScheme::AlternateBackground] = cfg.readEntry("BackgroundAlternate",
356- wmConfig.readEntry("inactiveBackground", SET_DEFAULT(AlternateBackground)));
357- } else {
--
379-
380- // loaded-from-config colors
381- if (strcmp(group, "Colors:Header") == 0) { // For compatibility with color schemes made before ColorSet::Header was added
382- // Default to old titlebar colors before using Header default colors
383- // TODO KF6: switch fallback to Window colors when WM is phased out.
384: KConfigGroup wmConfig(config, "WM");
385- _brushes.fg[KColorScheme::NormalText] = cfg.readEntry("ForegroundNormal",
386- wmConfig.readEntry("activeForeground", SET_DEFAULT(NormalText)));
387- _brushes.fg[KColorScheme::InactiveText] = cfg.readEntry("ForegroundInactive",
388- wmConfig.readEntry("inactiveForeground", SET_DEFAULT(InactiveText)));
389-
frameworks/kdelibs4support/src/kdeui/kglobalsettings.cpp
225-QColor KGlobalSettings::inactiveTitleColor()
226-{
227-#ifdef Q_OS_WIN
228- return qt_colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTION));
229-#else
230: KConfigGroup g(KSharedConfig::openConfig(), "WM");
231- return g.readEntry("inactiveBackground", QColor(224, 223, 222));
232-#endif
233-}
234-
235-// NOTE: keep this in sync with kdebase/workspace/kcontrol/colors/colorscm.cpp
236-QColor KGlobalSettings::inactiveTextColor()
237-{
238-#ifdef Q_OS_WIN
239- return qt_colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTIONTEXT));
240-#else
241: KConfigGroup g(KSharedConfig::openConfig(), "WM");
242- return g.readEntry("inactiveForeground", QColor(75, 71, 67));
243-#endif
244-}
245-
246-// NOTE: keep this in sync with kdebase/workspace/kcontrol/colors/colorscm.cpp
247-QColor KGlobalSettings::activeTitleColor()
248-{
249-#ifdef Q_OS_WIN
250- return qt_colorref2qrgb(GetSysColor(COLOR_ACTIVECAPTION));
251-#else
252: KConfigGroup g(KSharedConfig::openConfig(), "WM");
253- return g.readEntry("activeBackground", QColor(48, 174, 232));
254-#endif
255-}
256-
257-// NOTE: keep this in sync with kdebase/workspace/kcontrol/colors/colorscm.cpp
258-QColor KGlobalSettings::activeTextColor()
259-{
260-#ifdef Q_OS_WIN
261- return qt_colorref2qrgb(GetSysColor(COLOR_CAPTIONTEXT));
262-#else
263: KConfigGroup g(KSharedConfig::openConfig(), "WM");
264- return g.readEntry("activeForeground", QColor(255, 255, 255));
265-#endif
266-}
267-
268-int KGlobalSettings::contrast()
frameworks/kwindowsystem/src/platforms/xcb/netwm.cpp
652-void NETRootInfo::setNumberOfDesktops(int numberOfDesktops)
653-{
654-#ifdef NETWMDEBUG
655- fprintf(stderr,
656- "NETRootInfo::setNumberOfDesktops: setting desktop count to %d (%s)\n",
657: numberOfDesktops, (p->role == WindowManager) ? "WM" : "Client");
658-#endif
659-
660- if (p->role == WindowManager) {
661- p->number_of_desktops = numberOfDesktops;
662- const uint32_t d = numberOfDesktops;
--
675-void NETRootInfo::setCurrentDesktop(int desktop, bool ignore_viewport)
676-{
677-#ifdef NETWMDEBUG
678- fprintf(stderr,
679- "NETRootInfo::setCurrentDesktop: setting current desktop = %d (%s)\n",
680: desktop, (p->role == WindowManager) ? "WM" : "Client");
681-#endif
682-
683- if (p->role == WindowManager) {
684- p->current_desktop = desktop;
685- uint32_t d = p->current_desktop - 1;
--
743-
744-void NETRootInfo::setDesktopGeometry(const NETSize &geometry)
745-{
746-#ifdef NETWMDEBUG
747- fprintf(stderr, "NETRootInfo::setDesktopGeometry( -- , { %d, %d }) (%s)\n",
748: geometry.width, geometry.height, (p->role == WindowManager) ? "WM" : "Client");
749-#endif
750-
751- if (p->role == WindowManager) {
752- p->geometry = geometry;
753-
--
769-
770-void NETRootInfo::setDesktopViewport(int desktop, const NETPoint &viewport)
771-{
772-#ifdef NETWMDEBUG
773- fprintf(stderr, "NETRootInfo::setDesktopViewport(%d, { %d, %d }) (%s)\n",
774: desktop, viewport.x, viewport.y, (p->role == WindowManager) ? "WM" : "Client");
775-#endif
776-
777- if (desktop < 1) {
778- return;
779- }
--
1456-void NETRootInfo::setActiveWindow(xcb_window_t window, NET::RequestSource src,
1457- xcb_timestamp_t timestamp, xcb_window_t active_window)
1458-{
1459-#ifdef NETWMDEBUG
1460- fprintf(stderr, "NETRootInfo::setActiveWindow(0x%lx) (%s)\n",
1461: window, (p->role == WindowManager) ? "WM" : "Client");
1462-#endif
1463-
1464- if (p->role == WindowManager) {
1465- p->active = window;
1466-
--
1479-void NETRootInfo::setWorkArea(int desktop, const NETRect &workarea)
1480-{
1481-#ifdef NETWMDEBUG
1482- fprintf(stderr, "NETRootInfo::setWorkArea(%d, { %d, %d, %d, %d }) (%s)\n",
1483- desktop, workarea.pos.x, workarea.pos.y, workarea.size.width, workarea.size.height,
1484: (p->role == WindowManager) ? "WM" : "Client");
1485-#endif
1486-
1487- if (p->role != WindowManager || desktop < 1) {
1488- return;
1489- }
kde/kdeaccessibility/kmag/kmag.cpp
329-{
330- QColor blue (0,0,128);
331- QColor yellow (255,255,0);
332- QColor white (255,255,255);
333-
334: KConfigGroup cgWM( config, "WM");
335- setTitleColors (
336- cgWM.readEntry("inactiveBackground", blue),
337- cgWM.readEntry("inactiveForeground", white),
338- cgWM.readEntry("inactiveTitleBtnBg", yellow));
339-
kde/workspace/breeze/kstyle/breezehelper.cpp
56- _viewFocusBrush = KStatefulBrush( KColorScheme::View, KColorScheme::FocusColor );
57- _viewHoverBrush = KStatefulBrush( KColorScheme::View, KColorScheme::HoverColor );
58- _viewNegativeTextBrush = KStatefulBrush( KColorScheme::View, KColorScheme::NegativeText );
59-
60- const QPalette palette( QApplication::palette() );
61: const KConfigGroup group( _config->group( "WM" ) );
62- _activeTitleBarColor = group.readEntry( "activeBackground", palette.color( QPalette::Active, QPalette::Highlight ) );
63- _activeTitleBarTextColor = group.readEntry( "activeForeground", palette.color( QPalette::Active, QPalette::HighlightedText ) );
64- _inactiveTitleBarColor = group.readEntry( "inactiveBackground", palette.color( QPalette::Disabled, QPalette::Highlight ) );
65- _inactiveTitleBarTextColor = group.readEntry( "inactiveForeground", palette.color( QPalette::Disabled, QPalette::HighlightedText ) );
66- }
kde/workspace/kde-gtk-config/kded/configvalueprovider.cpp
244-
245- QColor tooltipForegroundColor = csc["active"]["tooltip"].foreground(KCS::NormalText).color();
246- QColor tooltipBackgroundColor = csc["active"]["tooltip"].background(KCS::NormalBackground).color();
247- QColor tooltipBorderColor = KColorUtils::mix(tooltipBackgroundColor, tooltipForegroundColor, 0.25);
248-
249: KConfigGroup windowManagerConfig = kdeglobalsConfig->group(QStringLiteral("WM"));
250-
251- return {
252- /*
253- * Normal (Non Backdrop, Non Insensitive)
254- */
kde/workspace/kwin/decorations/decorationpalette.cpp
42- : QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme))
43-{
44- if (!m_colorScheme.startsWith(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)) && colorScheme == QStringLiteral("kdeglobals")) {
45- // kdeglobals doesn't exist so create it. This is needed to monitor it using QFileSystemWatcher.
46- auto config = KSharedConfig::openConfig(colorScheme, KConfig::SimpleConfig);
47: KConfigGroup wmConfig(config, QStringLiteral("WM"));
48- wmConfig.writeEntry("FakeEntryToKeepThisGroup", true);
49- config->sync();
50-
51- m_colorScheme = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme);
52- }
--
111-}
112-
113-void DecorationPalette::update()
114-{
115- auto config = KSharedConfig::openConfig(m_colorScheme, KConfig::SimpleConfig);
116: KConfigGroup wmConfig(config, QStringLiteral("WM"));
117-
118- if (!wmConfig.exists() && !m_colorScheme.endsWith(QStringLiteral("/kdeglobals"))) {
119- qCWarning(KWIN_DECORATIONS) << "Invalid color scheme" << m_colorScheme << "lacks WM group";
120- return;
121- }
kde/workspace/kwin/plugins/kdecorations/aurorae/src/decorationoptions.cpp
36-}
37-
38-void ColorSettings::init(const QPalette &pal)
39-{
40- m_palette = pal;
41: KConfigGroup wmConfig(KSharedConfig::openConfig(QStringLiteral("kdeglobals")), QStringLiteral("WM"));
42- m_activeFrameColor = wmConfig.readEntry("frame", pal.color(QPalette::Active, QPalette::Window));
43- m_inactiveFrameColor = wmConfig.readEntry("inactiveFrame", m_activeFrameColor);
44- m_activeTitleBarColor = wmConfig.readEntry("activeBackground", pal.color(QPalette::Active, QPalette::Highlight));
45- m_inactiveTitleBarColor = wmConfig.readEntry("inactiveBackground", m_inactiveFrameColor);
46- m_activeTitleBarBlendColor = wmConfig.readEntry("activeBlend", m_activeTitleBarColor.darker(110));
kde/workspace/kwin/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp
118- --size;
119-
120- QPixmap image(size, size);
121- image.fill(Qt::transparent);
122- QPainter p(&image);
123: KConfigGroup wmConfig(KSharedConfig::openConfig(QStringLiteral("kdeglobals")), QStringLiteral("WM"));
124- const QColor color = wmConfig.readEntry("activeForeground", QPalette().color(QPalette::Active, QPalette::HighlightedText));
125-
126- if (shadow) {
127- p.setPen(KColorScheme::shade(color, KColorScheme::ShadowShade));
128- } else {
kde/workspace/plasma-desktop/kcms/colors/editor/scmeditorcolors.cpp
32-}
33-
34-void SchemeEditorColors::WindecoColors::load(const KSharedConfigPtr &config)
35-{
36- // NOTE: keep this in sync with kdelibs/kdeui/kernel/kglobalsettings.cpp
37: KConfigGroup group(config, "WM");
38- m_colors[ActiveBackground] = group.readEntry("activeBackground", QColor(48, 174, 232));
39- m_colors[ActiveForeground] = group.readEntry("activeForeground", QColor(255, 255, 255));
40- m_colors[InactiveBackground] = group.readEntry("inactiveBackground", QColor(224, 223, 222));
41- m_colors[InactiveForeground] = group.readEntry("inactiveForeground", QColor(75, 71, 67));
42- m_colors[ActiveBlend] = group.readEntry("activeBlend", m_colors[ActiveForeground]);
--
298- // Tooltip Text button
299- KConfigGroup(m_config, "Colors:Tooltip").writeEntry("ForegroundNormal", newColor);
300- break;
301- case 20:
302- // Active Title Background
303: KConfigGroup(m_config, "WM").writeEntry("activeBackground", newColor);
304- break;
305- case 21:
306- // Active Title Text
307: KConfigGroup(m_config, "WM").writeEntry("activeForeground", newColor);
308- break;
309- case 22:
310- // Active Title Secondary
311: KConfigGroup(m_config, "WM").writeEntry("activeBlend", newColor);
312- break;
313- case 23:
314- // Inactive Title Background
315: KConfigGroup(m_config, "WM").writeEntry("inactiveBackground", newColor);
316- break;
317- case 24:
318- // Inactive Title Text
319: KConfigGroup(m_config, "WM").writeEntry("inactiveForeground", newColor);
320- break;
321- case 25:
322- // Inactive Title Secondary
323: KConfigGroup(m_config, "WM").writeEntry("inactiveBlend", newColor);
324- break;
325- }
326- m_commonColorButtons[row]->blockSignals(true);
327- m_commonColorButtons[row]->setColor(newColor);
328- m_commonColorButtons[row]->blockSignals(false);
--
515- group.writeEntry("ForegroundPositive", m_colorSchemes[i].foreground(KColorScheme::PositiveText).color());
516- group.writeEntry("DecorationFocus", m_colorSchemes[i].decoration(KColorScheme::FocusColor).color());
517- group.writeEntry("DecorationHover", m_colorSchemes[i].decoration(KColorScheme::HoverColor).color());
518- }
519-
520: KConfigGroup WMGroup(m_config, "WM");
521- WMGroup.writeEntry("activeBackground", m_wmColors.color(WindecoColors::ActiveBackground));
522- WMGroup.writeEntry("activeForeground", m_wmColors.color(WindecoColors::ActiveForeground));
523- WMGroup.writeEntry("inactiveBackground", m_wmColors.color(WindecoColors::InactiveBackground));
524- WMGroup.writeEntry("inactiveForeground", m_wmColors.color(WindecoColors::InactiveForeground));
525- WMGroup.writeEntry("activeBlend", m_wmColors.color(WindecoColors::ActiveBlend));
kde/workspace/plasma-desktop/kcms/fonts/fontssettings.kcfg
64- #endif
65- </code>
66- <default code="true">menuFont</default>
67- </entry>
68- </group>
69: <group name="WM">
70- <entry name="activeFont" type="Font">
71- <label>Window title font</label>
72- <code>
73- #ifdef Q_OS_MAC
74- QFont windowTitleFont = QFont("Lucida Grande", 14);
kde/workspace/plasma-desktop/kcms/krdb/krdb.cpp
136- settings.setValue(QStringLiteral("/qt/Palette/active"), actcg);
137- settings.setValue(QStringLiteral("/qt/Palette/inactive"), inactcg);
138- settings.setValue(QStringLiteral("/qt/Palette/disabled"), discg);
139-
140- // export kwin's colors to qtrc for kstyle to use
141: KConfigGroup wmCfgGroup(kglobalcfg, "WM");
142-
143- // active colors
144- QColor clr = newPal.color( QPalette::Active, QPalette::Window );
145- clr = wmCfgGroup.readEntry("activeBackground", clr);
146- settings.setValue(QStringLiteral("/qt/KWinPalette/activeBackground"), clr.name());
--
368- createGtkrc( newPal, exportGtkTheme, gtkTheme, 2 );
369-
370- // Export colors to non-(KDE/Qt) apps (e.g. Motif, GTK+ apps)
371- if (exportColors)
372- {
373: KConfigGroup g(KSharedConfig::openConfig(), "WM");
374- QString preproc;
375- QColor backCol = newPal.color( QPalette::Active, QPalette::Window );
376- addColorDef(preproc, "FOREGROUND" , newPal.color( QPalette::Active, QPalette::WindowText ) );
377- addColorDef(preproc, "BACKGROUND" , backCol);
378- addColorDef(preproc, "HIGHLIGHT" , backCol.lighter(100+(2*KColorScheme::contrast()+4)*16/1));
playground/libs/mauikit/src/csd/libappletdecoration/decorationpalette.cpp
40- : QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme))
41-{
42- if (m_colorScheme.isEmpty() && colorScheme == QStringLiteral("kdeglobals")) {
43- // kdeglobals doesn't exist so create it. This is needed to monitor it using QFileSystemWatcher.
44- auto config = KSharedConfig::openConfig(colorScheme, KConfig::SimpleConfig);
45: KConfigGroup wmConfig(config, QStringLiteral("WM"));
46- wmConfig.writeEntry("FakeEntryToKeepThisGroup", true);
47- config->sync();
48-
49- m_colorScheme = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme);
50- }
--
120-}
121-
122-void DecorationPalette::update()
123-{
124- auto config = KSharedConfig::openConfig(m_colorScheme, KConfig::SimpleConfig);
125: KConfigGroup wmConfig(config, QStringLiteral("WM"));
126-
127- if (!wmConfig.exists() && !m_colorScheme.endsWith(QStringLiteral("/kdeglobals"))) {
128- qDebug() << "Invalid color scheme" << m_colorScheme << "lacks WM group";
129- return;
130- }
playground/libs/mauikit/src/csd/libappletdecoration/schemecolors.cpp
200- if (m_schemeFile.isEmpty() || !QFileInfo(m_schemeFile).exists()) {
201- return;
202- }
203-
204- KSharedConfigPtr filePtr = KSharedConfig::openConfig(m_schemeFile);
205: KConfigGroup wmGroup = KConfigGroup(filePtr, "WM");
206- KConfigGroup selGroup = KConfigGroup(filePtr, "Colors:Selection");
207- KConfigGroup viewGroup = KConfigGroup(filePtr, "Colors:View");
208- //KConfigGroup windowGroup = KConfigGroup(filePtr, "Colors:Window");
209- KConfigGroup buttonGroup = KConfigGroup(filePtr, "Colors:Button");
210-
playground/libs/mauikit/src/csd/libappletdecoration/themeextended.cpp
112- KSharedConfigPtr originalPtr = KSharedConfig::openConfig(m_originalSchemePath);
113- KSharedConfigPtr defaultPtr = KSharedConfig::openConfig(m_colorsSchemePath);
114-
115- if (originalPtr && defaultPtr) {
116- KConfigGroup normalWindowGroup(originalPtr, "Colors:Window");
117: KConfigGroup defaultWMGroup(defaultPtr, "WM");
118-
119- defaultWMGroup.writeEntry("activeBackground", normalWindowGroup.readEntry("BackgroundNormal", QColor()));
120- defaultWMGroup.writeEntry("activeForeground", normalWindowGroup.readEntry("ForegroundNormal", QColor()));
121-
122- defaultWMGroup.sync();
playground/libs/mauikit/src/kde/mauikde.cpp
169- if(!bg.isEmpty() || !fg.isEmpty())
170- {
171-
172- qDebug()<<"COLRO SCHEME FILE EXISTS"<< colorsFile;
173- KConfig file(colorsFile);
174: auto group = file.group("WM");
175- QColor color;
176-
177- if(!bg.isEmpty())
178- {
179- color.setNamedColor(bg);
Edited by Michael Genda