-
Notifications
You must be signed in to change notification settings - Fork 60
lxqt-config-appearance: Add GTK 4 theming #1118
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
base: master
Are you sure you want to change the base?
Conversation
The code is written neatly. Thanks!
This needs to be investigated. Perhaps I don't use any GTK4 app and have forgotten everything about GTK after more than a decade of not dealing with it. So, my code review is far from enough. Thorough tests are needed. |
It actually does exist in GTK 4, which is why this is so weird. |
Installed some gtk4 apps, get the same warning but actually can't set any dark theme (adwaita-dark, breeze-dark), neither in X11 nor in Wayland. |
Hmm, interesting. HighContrastInverse works for me, could you try that? Edit: Just installed |
Tried also that, same, it seems, should be dark no? |
Hold on a second, are you sure the GTK apps you're using don't use libadwaita? |
I'm not really familiar with GTK4, I tried just Qeegie, Nautilus and Amberol, could well be. An example? |
Nautilus and Amberol use libadwaita, but Geeqie doesn't. I've just installed Geeqie to test it, but it seems like it actually uses GTK 3 (at least on Arch, btw). |
Why testing with GTK4 apps when For some reason, I have
And this screenshot shows But, I remember that I used The warning message I see is different and isn't our concern:
As far as I know, GNOME devs didn't like the idea of a themeable GTK. So, maybe they've removed themeablity from GTK4 — just a guess … |
I've already tested that too, and it also works for me. Can you explicitly set the theme to Adwaita-dark to see if it also works in Wayland? |
No, setting However, setting |
The irony is that |
I still can't get anything in dark... |
Oh, Adwaita and Adwaita-dark don't support GTK4. At least here, they belong to So, I think the tooltip ("Doesn't apply to applications that use Libadwaita") may be misleading. Switching to a theme that isn't for GTK4 shouldn't do anything. |
Doesn't that mean these themes are being falsely included in the GTK 4 box? |
It seems so — if they're provided by |
Like I said earlier, Adwaita-dark does work for me (at least on X11) despite there not being a |
I don't have the illusion that GNOME's behavior is logical, but if it is, you may have an overriding theme in a user folder. If you don't have any theme with a |
Alright then, so what do we do? Do I just remove the tooltip, or do I need to do a bit more? Ignoring the cursor theme warning, of course. (Which I probably shouldn't lol) |
IMHO, the tooltip doesn't convey correct info. So, I think, yes, it can be removed.
Something should be done because it doesn't work for @stefonarch, and so, it might not work for many users. But I don't know what or how. As I mentioned earlier, I'm not a GTK expert; what I said so far was only logical. For starters, if a theme isn't applicable to a version of GTK, it shouldn't be shown for it. Now, whether GNOME should do it (as Qt does) or we should, I don't know … |
If there's a problem with my latest commit, let me know. |
The commit seems good. It should be tested again, especially with a theme that supports GTK4 (is there any at all?). But a practical problem still exists: An LXQt user may not want to install any GTK4 theme (even if GTK4 accepts themes at all) but just to switch to the dark variant. Since |
I've just tested Orchis-Dark, and it does seem to work with the GTK demo apps. It gives me an "Expected a valid color" warning, but this may or may not be because of the theme itself. |
Good.
Yes, we don't need to worry about GTK warnings; there are lots of them. |
Still nothing on my side also with orchid*. What worked was https://github.com/vinceliuice/WhiteSur-gtk-theme#fix-for-libadwaita-not-perfect and it does:
Only setting which looks working is font-size. |
Does the Also, Adwaita shouldn't be listed for GTK4 now. Is that the case? |
I confirm that the keys |
Yes, that's for the global cursor setting. I just wanted to say that we might need to consider the differences between Wayland and X11 when testing; @IdfbAn uses X11, you and I Wayland. |
OK, I reread the PR and found the cause of the problem. It's simple: |
What's the exact line that's apparently problematic? |
Searching for info I found that using an env var I tested also X11, for theme it shouldn't be different than Wayland. Cursor is a different thing. |
QString themeName = ui->gtk4ComboBox->currentText(); | ||
mConfigOtherToolKits->setGTKConfig(QStringLiteral("4.0"), themeName); | ||
if(QGuiApplication::platformName() == QStringLiteral("wayland")) | ||
mConfigOtherToolKits->setGsettingsConfig(QStringLiteral("4.0"), themeName); | ||
// GTK3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call to gsettings
(in setGsettingsConfig
) will be repeated and overridden below, for GTK3.
I think GTK3 and GTK4 should have the same settings and be set by a single call to gsettings
. If I'm right, a single combo-box should be used for both, the previous commit should be reverted, and some minor changes will be needed too.
What I say is based on what I see in dconf-editor
: when I set it to HighContrast
, both GTK3 and GTK4 themes change. The call to gsettings
does the same.
This creates a confusing situation though: what if a theme doesn't support GTK4? I think, in that case, only the GTK3 theme will be applied.
Two things I should say:
gtk4-demo
gives me this warning:The theme seems to still work regardless, but if this actually causes any problems, and/or anyone knows how to fix this, it'd be great.
Closes #899.