-
Notifications
You must be signed in to change notification settings - Fork 303
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
Added dark mode support for Linux #4415
base: master
Are you sure you want to change the base?
Conversation
I've now added a fix for illegible text in dark and light mode which resolves #3538 and resolves #2731 The GUI uses a map of predetermined color values to use when switching from dark <--> light mode. After lots of debugging, in dark mode it uses {"#FFFFFF", "#2D2D31"} and {"#A6A9AA", "#2D2D29"} to switch light to dark mode of the background and foreground(text) respectively. In RGB values the map would look like {"(255, 255, 255)", "(45, 45, 45)"} for the background and {"(166, 169, 170)", "(45, 45, 41)"} for the foreground. Based on this light to dark mode conversion, background is set to (45, 45, 45) and foreground is (45, 45, 41) making it basically impossible to read the text. Light mode is a similar issue, but there seems to still be a slight issue where the text is a bit light (an issue where there is no predefined conversion in the color map). However, it's still very much readable after my fix. I've now added logic if the background and foreground colors are similar (FG is within +/-10 of BG RGB values), invert the foreground color to make the text legible. |
Hi there @lanewei120 @walterwongbbl, Thank you for all your hard work on this project. I'm really looking forward to this fix! I understand maintaining an open-source project can be time-consuming. Do you have any idea when PRs like this usually get reviewed, merged, and released? It would be greatly appreciated by me and other Linux users who are affected by this issue. Thanks again! |
@calvindo95 hi, I repackaged the code to test on ubuntu 24.04 and it doesn't work. |
Hey! I just switched to a Fedora 40 Gnome laptop, and installed BambuStudio 19.5.51 (flatpak). Still no Dark Mode. Would be happy to test if you need it. -Chris |
Good job working on this. There's one problem that I could see though, there are ways for apps to know whether a system-wide dark mode is selected. The configuration option should probably be a tri-state: "Follow System" (the default), on and off. You'll find loads of example of that tri-state looking for "dark setting follow system" on Google. However, I want to note that you probably shouldn't be changing the theme name. Using Finally, following the system setting should work out-of-the-box (at least on GNOME and Flatpak'ed BambuStudio) using: This is what I've now implemented in the Flatpak: |
Spent a couple days learning about wxWidgets/GTK/BambuStudio and added the ability to enable/disable dark mode for Linux, which potentially resolves #3542
Linux dark mode uses the existing settings.conf variable "dark_color_mode".
This feature uses GTK's gtk-theme-name setting to change themes from dark <--> light mode, but it has some undocumented behaviors that need testing from other Linux users.
This has been tested on my system:
Kubuntu 24.04
KDE Plasma Breeze-Dark
This feature needs people using different Distros and GTK themes to test this
UPDATE: I've now added a fix for illegible text in dark and light mode which resolves #3538 and resolves #2731