Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chenxiaolong opened this issue Mar 10, 2021 · 2 comments

Comments

@chenxiaolong
Copy link

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

@Seqularise
Copy link

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

@chenxiaolong
Copy link
Author

chenxiaolong commented Mar 15, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants