FedoraQt / QGnomePlatform

QPlatformTheme for a better Qt application inclusion in GNOME
GNU Lesser General Public License v2.1
262 stars 38 forks source link

Stop applying the Adwaita color palette to Kirigami apps #131

Closed naipotato closed 1 year ago

naipotato commented 1 year ago

From a recent post by a GNOME designer^1, it was found that QGnomePlatform would be causing black-on-black problems in Kirigami apps, due to applying the Adwaita-qt color palette indiscriminately to any Qt app.

Since according to the README, this project aims to apply GNOME settings to unmodified Qt apps, I suggest at least finding some way to avoid applying the Adwaita color palette on Kirigami apps.

Other parts of QGnomePlatform (like decorations) are still useful for Kirigami apps, so those should still work.

grulja commented 1 year ago

I've been trying to figure out how to identify Kirigami apps from QGnomePlatform, but I have no idea how to do that. Any idea?

nicolasfella commented 1 year ago

Kirigami isn't strictly the problem here, it's qqc2-desktop-style (which many Kirigami apps force because there is no better style available). qqc2-desktop-style uses KColorScheme (which is kind of a superset of QPalette) to do colors. The problem here is that 1) QPalette and KColorScheme are out of sync (QGnomePlatform applies Awaita colors to QPalette but KColorScheme still uses the builting Breeze default) and 2) KColorScheme knows more color roles than QPalette

I see multiple possible solutions to this: 1) Someone creates a native Adwaita QtQuick style and QGnomePlatform applies that to apps 2) Someone creates a KColorScheme file with Adwaita colors and applies that to apps 3) Someone finds a way to "derive" a KColorScheme from a QPalette and adds that to the relevant code

nicolasfella commented 1 year ago

Note that the problem isn't even specific to QML. Widgets apps sometimes use KColorScheme too and then have the same problem. try e.g. Kate on Gnome with a dark theme, there will be parts of the colors wrong

nicolasfella commented 1 year ago

Someone creates a KColorScheme file with Adwaita colors and applies that to apps

To do this create an "adwaita.colors", install it and from QGnomePlatform do qApp->setProperty("KDE_COLOR_SCHEME_PATH", "/usr/share/color-schemes/adwaita.colors");