adwaita-qt
adwaita-qt copied to clipboard
adwaita-dark doesn't seem to be applied to applications using KColorScheme(Manager) with qt 5.15
(Apologies if this isn't actually an adwaita-qt issue. I'm not super familiar with the interactions between qt, adwaita-qt, and kconfigwidgets yet.)
With applications like Kate, which use KColorScheme and KColorSchemeManager, it seems that adwaita-qt's adwaita-dark
style doesn't get applied properly if the system is running qt 5.15. For example, this is what I see:
Screenshot from 2021-03-09 18-04-38
I've confirmed that adwaita-dark
is actually being used by adding:
qWarning() << "is dark:" << _dark;
qWarning() << "is KDE:" << _isKDE;
qWarning() << "is GNOME:" << _isGNOME;
to adwaita-qt's Style::Style(bool dark)
constructor, which printed out:
is dark: true
is KDE: false
is GNOME: true
It seems that the issue stems from kate calling:
https://github.com/KDE/kate/blob/997aa7231330b92244e2f6d7bc7064b2964034dd/kate/katecolorschemechooser.cpp#L40
though things work on qt 5.14. If I comment out the activateScheme
call, then the adwaita-dark seems to be successfully applied. activateScheme
is defined here (in kconfigwidgets):
https://github.com/KDE/kconfigwidgets/blob/6bb1826717e71926936df6706aa02730fb0b413f/src/kcolorschememanager.cpp#L35
which calls qApp->setPalette
using a palette from:
https://github.com/KDE/kconfigwidgets/blob/6bb1826717e71926936df6706aa02730fb0b413f/src/kcolorscheme.cpp#L685
So far I've tried the following scenarios:
- Fedora 32:
- qt (5.14.2)
- Distro versions of adwaita-qt (1.2.0), kf5 libs (5.75.0), kate (20.08.3) => Dark theme works
- Master branch of adwaita-qt, kf5 libs, kate => Dark theme works
- Fedora 33:
- qt (5.15.2)
- Distro versions of adwaita-qt (1.2.0), kf5 libs (5.79.0), kate (20.12.2) => No dark theme
- Master branch of adwaita-qt, kf5 libs, kate => No dark theme
Any ideas on what might prevent adwaita-dark from working here? Could there be some sort of incompatibility with adwaita-qt + qt 5.15 (vs. 5.14)? Am I barking up the wrong tree filing this bug report here?
I'd be happy to try and do a git bisect of qt between 5.14.2 and 5.15.2 if there's a good chance that it's an upstream issue.
Thank you!
It's a long time issue for me, little workaround is too set color scheme through systemsettings5
I tried doing a git bisect between 5.14.2 and 5.15.2, but didn't have much luck. qtbase is easy enough to bisect, but the KDE libs require many of the other 40+ qt5 git submodules and it's very tedious to get them to compile.
As a workaround, I installed kvantum and set up Kate to use the KvGnomeDark
color scheme.