https://bugs.kde.org/show_bug.cgi?id=511326
Bug ID: 511326
Summary: Colors in kdeglobals not being respected when
platformtheme is not `kde`
Classification: Frameworks and Libraries
Product: frameworks-kcolorscheme
Version First unspecified
Reported In:
Platform: NixOS
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Created attachment 186297
--> https://bugs.kde.org/attachment.cgi?id=186297&action=edit
kdeglobals file with custom colors
I have proposed a patch on the gitlab instance, link included below.
SUMMARY
Up to frameworks release v6.18.0, applications such as Dolphin, Okular, Kate,
etc. that
(partially) themed their UI based on colors specified in a kdeglobals
(e.g. `~/.config/kdeglobals`) file could do so regardless of whether the
Qt platformtheme was set to `kde`, so long as key `ColorScheme` under
`[UiSettings]` was set to some arbitrary value (e.g. `ColorScheme=*`).
This enabled users to properly theme such applications even when using a
different platformtheme (e.g. when on a different DE or just a WM with
something like qt6ct).
Due to some minor modifications made as part of framework release
v6.19.0 in order to use the new id-based approach for color schemes,
this no longer works and defaults are now always used instead of the
values specified in kdeglobals when the platformtheme is not `kde`. This
change seems to be unintentional. Previously, the responsible code
branched based on whether kdeglobal's `ColorScheme` was set, with
defaults being used if `ColorScheme` was empty/not set. In v6.19.0, it
now first tries to find the `QModelIndex` of the scheme specified by
`ColorScheme` and then find the scheme's id from that, then branch based
on whether the scheme's id is set. If the platformtheme is not set to
`kde`, the returned `QModelIndex` will be invalid and thus the scheme's
id will be considered empty, regardless of the value of `ColorScheme`.
Simply reverting the check to look at the value of `ColorScheme`
directly again fixes the issue and doesn't otherwise change behaviour
for the new id-based approach.
STEPS TO REPRODUCE
1. Ensure you have `~/.config/kdeglobals` configured with non-default colors,
and ensure the key `ColorScheme` under `[UiSettings]` has a value set, e.g.
`ColorScheme=*` (see attached kdeglobals file, which has colors set to
[Catppuccin's](https://catppuccin.com/) Mocha Blue flavour)
2. Enter a graphical session that *is not* KDE Plasma, preferably one which
doesn't set any Qt-related environment variables or otherwise aims to provide
any Qt integration; for example, a window manager like Hyprland or Sway.
3. Start an app that reads colors from a kdeglobals, like Dolphin or Kate,
while ensuring `QT_QPA_PLATFORMTHEME` is not set to `kde` in its environment.
OBSERVED RESULT
The app's theming only uses default light or dark colors.
EXPECTED RESULT
The app should use the colors specified in `~/.config/kdeglobals` for its
theming.
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: NixOS 25.11 (Xantusia) x86_64
KDE Frameworks Version: v6.19.0
Qt Version: 6.10.0
ADDITIONAL INFORMATION
[Gitlab merge
request](https://invent.kde.org/frameworks/kcolorscheme/-/merge_requests/57)
--
You are receiving this mail because:
You are watching all bug changes.