Qt: dark mode (System / Light / Dark theme setting) #50
No reviewers
Labels
No labels
do-not-open-till-X-Day
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
SubGeniusFinance/dobbscoin-source!50
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/49-dark-mode-art"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #49. Requested by dokfaux on Dobbscord.
Adds a Theme setting to the Qt wallet: System / Light / Dark.
What changes
theme, plus-theme=system|light|darkon the command line (also in-help). It takes effect after a restart, like Language.QPalette.AppsUseLightThemefrom the registry. On macOS and Linux it uses the palette the platform already hands Qt. If the platform is already dark, its native style is kept and only the artwork switches. Light on a dark desktop uses Fusion's light palette.src/qt/res/icons-dark/andimages-dark/, registered in the qrc under the same aliases. Plain silhouettes are inverted. The Dobbs heads and the overview drawings keep their art with a light outline. The method is inicons-dark/README.md.GUIUtil::ThemedResource()/ThemedIcon()return the dark variant when one exists and fall back to the original otherwise. EveryQIcon(":/icons/...")call site, the console icons, the background tile and the .ui artwork go through it. App and tray icons are unchanged.Light looks the same as before. The default is System, so existing users on a dark Windows desktop will get Dark after upgrading.
Commits
6f55433ddark-mode artb4c219f7theme setting, loader, color fixes86893c1fMining checkbox contrastTesting
BUILD_GUI=ON) against Qt 5.15.8, LinuxOptions > Display gets a Theme row, stored as QSettings "theme" and overridable with -theme=system|light|dark. Takes effect after restart, like the language setting. Dark uses Fusion with a dark QPalette. System follows the OS: the Windows AppsUseLightTheme registry value, or on macOS and Linux the palette the platform already hands Qt. When the platform is already dark, its native style is kept and only the artwork switches. Light on a dark desktop uses Fusion's light palette. GUIUtil::ThemedResource()/ThemedIcon() swap :/icons/X and :/images/X for :/icons-dark/X and :/images-dark/X when dark is active and a variant exists. All QIcon(":/icons/...") call sites, the console icons, the background tile, and the .ui artwork with a dark variant go through it. App and tray icons (networkstyle.cpp) are left alone, so the unused dark dobbscoin_testnet.png is dropped. Colors that were unreadable on dark: sync progress bar background, intro error labels, debug console command teal.