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

Suggestion: Hint DE to use dark theme if available #352

Open
ZwS opened this issue Aug 22, 2021 · 3 comments
Open

Suggestion: Hint DE to use dark theme if available #352

ZwS opened this issue Aug 22, 2021 · 3 comments
Labels
controller Specific to the main application dependencies A library or dependency affecting Polychromatic feedback Opinion and thoughts to be taken on-board theme Affects this app's Qt theme or when using native theme

Comments

@ZwS
Copy link

ZwS commented Aug 22, 2021

Details about the problem

Hint DE to use dark theme for the application window. For default branded style it would give dark headerbar.

Default theme with dark header bar enabled
Imgur

For system theme it would provide better readability for icons, since green-on-white lacks contrast. But I'm not sure is there is reliable way to enable dark theme for Qt that would work indepently from theme engine.

Adwaita
Imgur
Adwaita Dark variant
Imgur

@ZwS ZwS added the bug Faults with Polychromatic itself label Aug 22, 2021
@lah7 lah7 added feature request New functionality that is wished for feedback Opinion and thoughts to be taken on-board and removed bug Faults with Polychromatic itself labels Aug 22, 2021
@lah7
Copy link
Member

lah7 commented Aug 22, 2021

This is a good idea. Unfortunately, I can't see a way how to do this, since this isn't a GTK application.

If there's an environment variable we can set, or something similar, that would be great.

@ZwS
Copy link
Author

ZwS commented Aug 23, 2021

For dark titlebar I found following command:
xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT dark
I' m not familiar with GUI toolkits but for me it looks like this is some kind of flag that should be set during window creation.

As for theming I was unable to find some generic way to tell app to use dark theme. The look you can see on my screenshot was achieved by using adwaita-qt style plugin and setting it's dark variant. It's possible that there is some better way to achieve same result (e.g. some option like for headers) but I was unable to find it.

@lah7
Copy link
Member

lah7 commented Aug 23, 2021

Thanks. It appears to be a window property. This could work for the main window only:

xprop -name "Polychromatic" -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT dark

I'm using Fedora 34 with GNOME as a test, as it has Adwaita. What's strange is that xprop is designed for X11, but it works on Wayland 😕 🤷🏼

Sadly, it looks like any attempt at this would be an ugly hack. There's python-xlib which might be able to do it too, but I wouldn't want to depend on X11 code, and xprop is not usually pre-installed.

Qt has a concept of "window flags" but there's nothing to provide a hint for dark theme. It would make sense for Qt to support this since Windows apps (and maybe macOS?) have the same problem.

@lah7 lah7 added the controller Specific to the main application label Jan 7, 2022
@lah7 lah7 added theme Affects this app's Qt theme or when using native theme dependencies A library or dependency affecting Polychromatic and removed feature request New functionality that is wished for labels Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
controller Specific to the main application dependencies A library or dependency affecting Polychromatic feedback Opinion and thoughts to be taken on-board theme Affects this app's Qt theme or when using native theme
Projects
None yet
Development

No branches or pull requests

2 participants