Skip to content

qt gui: could remove qdarkstyle dependency and use uniform dark theme #9690

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

Open
f321x opened this issue Apr 1, 2025 · 0 comments
Open

qt gui: could remove qdarkstyle dependency and use uniform dark theme #9690

f321x opened this issue Apr 1, 2025 · 0 comments

Comments

@f321x
Copy link
Member

f321x commented Apr 1, 2025

Description

Currently the qt gui uses qdarkstyle if the "Dark" mode is explicitly enabled by the user. If the "Light" default mode is enabled it is light if the system theme is light too, if the system theme is dark the Electrum theme will be dark on some plattforms (KDE for example) but not on all (on Gnome it will stay light). This is weird because the user expects "Light" to be light and not dynamic. Also the dark "light" mode looks different than the qdarkstyle explicit dark mode, which is also unexpected.

By using the QT Fusion style with app.setStyle("Fusion") we can explicitly set the theme app.styleHints().setColorScheme(Qt.ColorScheme.Dark) or allow for a default config option that changes the theme depending on system theme. This Fusion style should be available for all platforms.
Doing this we can also get rid of the qdarkstyle dependency as the Fusion style provides light and dark styles.

However the setColorScheme() method currently doesn't work on Linux (pyqt 6.8.1 / qt 6.8.2) because it's not implemented for Linux yet. See qt issue https://bugreports.qt.io/browse/QTBUG-129917
Once setColorScheme() is functional on Linux we can do this. I subscribed to the QT issue.

may contain useful info: https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5

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

1 participant