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

[RFE] Add some logic to pick a Kvantum theme based on Gtk3 theme when the names don't match #54

Open
teohhanhui opened this issue Feb 25, 2020 · 12 comments

Comments

@teohhanhui
Copy link

Distro: Manjaro GNOME Edition

gtk3 theme name: "Matcha-dark-sea"
kvantum theme name: "Matcha-Dark"

Is this a case of gtk3 / kvantum theme name mismatch?

Log: https://gist.github.com/teohhanhui/be57cbfe713a60047c2c3be8ef700c95

@teohhanhui
Copy link
Author

teohhanhui commented Feb 26, 2020

Hmm... Looking at the code, that does seem to be the case. There's no fuzzy matching between gtk3 theme name and kvantum theme name.

Do you think this is something that should be fixed on the Kvantum / Manjaro end, or on the QGnomePlatform end?

@grulja grulja changed the title Kvantum theme not being used? Add some logic to pick a Kvantum theme based on Gtk3 theme when the names don't match Apr 20, 2020
@grulja
Copy link
Collaborator

grulja commented Apr 20, 2020

There is none and most likely won't be one implemented, at least from my side. Our primary focus is Adwaita-qt theme, I have never used Kvantum and I don't plan extending its support. Feel free to send a patch and I will review it, otherwise you will have to wait if someone decides to fix it or rather fix it in Manjaro, if possible.

@yochananmarqos
Copy link

@teohhanhui
Try setting export QT_STYLE_OVERRIDE="kvantum" in your ~/.profile.

@teohhanhui
Copy link
Author

@yochananmarqos Tried that. It didn't change anything.

But I've noticed that actually the client decorations are handled separately by https://github.com/FedoraQt/QGnomePlatform/blob/0.6.0/decoration/qgnomeplatformdecoration.cpp, which doesn't seem to support Kvantum.

Is my understanding correct?

@yochananmarqos
Copy link

yochananmarqos commented May 4, 2020

@teohhanhui
You may have to edit /etc/environment instead and disable using qt5ct:

#QT_QPA_PLATFORMTHEME="qt5ct"
QT_STYLE_OVERRIDE="kvantum"

Have you added QT_QPA_PLATFORMTHEME="gnome" anywhere?

@teohhanhui
Copy link
Author

@yochananmarqos Thanks for trying to help, but that's not going to change anything - yes, I'm already using QGnomePlatform:

$ QT_QPA_PLATFORM=wayland QT_QPA_PLATFORMTHEME=gnome QT_DEBUG_PLUGINS=1 telegram-desktop

Please see the link above. The client decorations are handled by a separate Qt plugin. QT_DEBUG_PLUGINS=1 helped figure that out.

@teohhanhui
Copy link
Author

teohhanhui commented May 4, 2020

Unfortunately:

(2) Kvantum does not provide window decorations. Such jobs are done by the window manager.

https://store.kde.org/p/1005410/

See also tsujan/Kvantum#442 and https://bugreports.qt.io/browse/QTBUG-63969

@yochananmarqos
Copy link

yochananmarqos commented May 4, 2020

Maybe it's just a Wayland thing, then. QBittorrent is using my Kvantum theme on GNOME using Xorg. I have qgnomeplatform-git and kvantum-qt5 installed; qt5ct and adwaita-qt are not installed.

/etc/environment:

QT_AUTO_SCREEN_SCALE_FACTOR=1

# Requires qt5ct
#QT_QPA_PLATFORMTHEME="qt5ct"

# Requires qgnomeplatform
# adwaita-qt theme will be used if installed, otherwise override with Kvantum
QT_QPA_PLATFORMTHEME="gnome"

# Requires kvantum-qt5
QT_STYLE_OVERRIDE="kvantum"
$ QT_LOGGING_RULES="qt.qpa.qgnomeplatform=true" qbittorrent
qt.qpa.qgnomeplatform: Font name:  "Noto Sans"  (size  12 )
qt.qpa.qgnomeplatform: Monospace font name:  "Hack"  (size  12 )
qt.qpa.qgnomeplatform: TitleBar font name:  "Noto Sans"  (size  12 )
qt.qpa.qgnomeplatform: Cursor blink time:  1200
qt.qpa.qgnomeplatform: Double click time:  400
qt.qpa.qgnomeplatform: Long press time:  500
qt.qpa.qgnomeplatform: Double click distance:  5
qt.qpa.qgnomeplatform: Dnd drag threshold:  8
qt.qpa.qgnomeplatform: Password hint timeout:  0
qt.qpa.qgnomeplatform: Icon theme:  "Papirus-Dark-Maia"
qt.qpa.qgnomeplatform: Theme name:  "Adwaita-maia-dark"
qt.qpa.qgnomeplatform: Dark version:  yes

@yochananmarqos
Copy link

@teohhanhui

Is my understanding correct?

In theory, it should find a matching Kvantum theme:

@memeplex
Copy link

memeplex commented May 5, 2020

@teohhanhui you can force usage of XWayland by doing QT_QPA_PLATFORM=xcb so that decorations are rendered by the compositor. You might also try luck with QT_WAYLAND_DISABLE_WINDOWDECORATION=1.

@teohhanhui
Copy link
Author

@yochananmarqos @memeplex The point is to move forward with Wayland.

Let's continue the discussion in the Manjaro forum thread if it's not relevant to this issue: https://forum.manjaro.org/t/gnome-wayland-qt-kvantum-theme-not-being-used/126090

@Ste74
Copy link

Ste74 commented May 5, 2020

Hi there, Manjaro dev here and Manjaro Gnome maintainer. This is the first time i'm pinged in our forum for this problem and i appreciate the feedback of @memeplex . Also i see for the first time this issue opend 2 months ago because @yochananmarqos point me out. Generally i don't use anything of qt app apart our manjaro settings manager, calamares and libreoffice but since i don't use also plasma or any other QT DE i never thinking more at this problems ( for calamares i have set the kvantum theme in live iso via .config as root user ). So at the end i really appreciate if we can find a confortable solution for this behaviours here or in our forum.

@grulja grulja changed the title Add some logic to pick a Kvantum theme based on Gtk3 theme when the names don't match [RFE] Add some logic to pick a Kvantum theme based on Gtk3 theme when the names don't match Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants