FedoraQt / adwaita-qt

A style to bend Qt applications to look like they belong into GNOME Shell
Other
488 stars 48 forks source link

adwaita-dark doesn't seem to be applied to applications using KColorScheme(Manager) with qt 5.15 #151

Open chenxiaolong opened 3 years ago

chenxiaolong commented 3 years ago

(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:

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!

Seqularise commented 3 years ago

It's a long time issue for me, little workaround is too set color scheme through systemsettings5

chenxiaolong commented 3 years ago

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.