Skip to content

Conversation

@AufarZakiev
Copy link
Contributor

@AufarZakiev AufarZakiev commented Nov 13, 2025

Fixes #5274

Description of the Change

  1. Bumps WxWidgets version to be higher than 3.3
  2. Forces common elements to use OS theme
  3. Retrieves dark theme flag and carefully repaints
  • Charts (Statistics, Disk panels)
  • Progress bars (to make progress values easily visible)
  • Notices list

Note: wxWidgets' IsDark() returns false on Win 11 now even if dark mode is enabled. Therefore, registry reading mechanism was introduced as an additional check

Tested on Win 11.

Alternate Designs

  • Should we force version bump? If WxWidgets is outdated, the code still works in always-light mode. Vcpkg complains about this version constraint too

Screenshots:

image image image

Release Notes
Add Dark Mode support for Windows

@AufarZakiev AufarZakiev marked this pull request as draft November 13, 2025 21:20
@AufarZakiev AufarZakiev force-pushed the feature/dark-mode-win branch from 790880a to d0a5c6f Compare November 13, 2025 21:20
@AufarZakiev
Copy link
Contributor Author

Nice PR number for such a change, btw

@AenBleidd
Copy link
Member

@AufarZakiev,

Note: wxWidgets' IsDark() returns false on Win 11 now even if dark mode is enabled. Therefore, registry reading mechanism was introduced as an additional check

For Windows use IsSystemDark() function instead:
https://docs.wxwidgets.org/latest/classwx_system_appearance.html#ac6c70858bb3e4c35a0b1af42997b6c42

@AufarZakiev
Copy link
Contributor Author

AreAppsDark() fits better, doesn't it?
At least, apps on my desktop react on this value and ignore IsSystemDark()

@AenBleidd
Copy link
Member

AreAppsDark() fits better, doesn't it?

Yes, it looks like this is really better. Good catch!

// wxWidgets' IsDark() returns false on Win 11 now even if dark mode is enabled
// so we need to additionally check the registry for the dark mode setting
m_isDarkMode = m_isDarkMode || IsWindowsInDarkMode();
MSWEnableDarkMode(wxApp::DarkMode_Auto);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is needed? I do remember when I tested the dark mode, I didn't have this enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it according to docs. Yes, without it just ignores OS settings

@CharlieFenton
Copy link
Contributor

@AufarZakiev @AenBleidd Please make absolutely sure that all your changes are guarded by #ifdef _WIN32 to prevent creating problems for Mac and Linux.

@CharlieFenton
Copy link
Contributor

@AufarZakiev @AenBleidd Please make absolutely sure that all your changes are guarded by #ifdef _WIN32 to prevent creating problems for Mac and Linux.

or #ifdef __WXMSW__

@AenBleidd
Copy link
Member

@CharlieFenton, of course we will, no worries. This is too far from being finished, and it's too early to talk about this now, but this is definitely something I will keep in mind while doing a review of the code.

@AufarZakiev AufarZakiev force-pushed the feature/dark-mode-win branch from d0a5c6f to 6f72d16 Compare November 14, 2025 12:59
@AufarZakiev AufarZakiev force-pushed the feature/dark-mode-win branch from 6f72d16 to 83f4cf0 Compare November 14, 2025 17:26
@AufarZakiev AufarZakiev marked this pull request as ready for review November 16, 2025 05:28
@AufarZakiev
Copy link
Contributor Author

@AenBleidd , do you have a chance to review PR?

@AenBleidd
Copy link
Member

I had no chance to test this on devices I have.
Hopefully will be done during this weekend.

@AenBleidd
Copy link
Member

@AufarZakiev, we have a progress bar that has a self-written function to draw itself.
It blinks when in dark mode (see the video).
This is something that need to be fixed, because otherwise very annoying.
I have tested this on Win11 and Win10 (video was recorded on Win11, but on Win10 blinking is even more visible).
After this is fixed, I will retest it including Linux.
https://github.com/user-attachments/assets/0e415283-8840-48e5-8f48-4a841a5ed6be

Copy link
Contributor

@CharlieFenton CharlieFenton Dec 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you changing all these colors? The contents of the graphs do not need to be changed for dark mode. In my opinion, it is wrong to change them. Furthermore, you have not guarded your changes by #ifdef _WIN32 or #ifdef __WXMSW__ to prevent creating problems for Mac and Linux. This file already had all the changes needed for dark mode. Here is how the light and dark mode appear on the Mac with the existing code:

Statistics tab light mode Statistics tab dark mode

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CharlieFenton, maybe we still can change these colors to be less bright when in Dark mode?
Personally I think with this change they look (at least on Windows) way more consistent than on macOS:
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the screenshot. Now that I've seen it, I feel even more certain that the changes in this PR are wrong. It looks terrible and it is very difficult to see the grid lines. You can do what you want on Windows, but please do not change the appearance on the Mac. The BOINC dark mode has been available on the Mac for quite some time, and people have been happy with it as is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to have the same look and feel on all platforms. Maybe we can adjust the intensity of the grid lines to make them more visible while keeping more dark background?
@davidpanderson, what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are making wholesale changes affecting all platforms, including Mac and Linux. This is unacceptable. You must take care not to change anything affecting the Mac by guarding your changes with #ifdef _WIN32 or #ifdef __WXMSW__

@CharlieFenton CharlieFenton self-assigned this Dec 7, 2025
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note also that on MS Windows, BOINC uses the native list control, but on Mac and Linux it uses wxWidgets' wxGenericListCtrl built from wxWidgets source code.

@davidpanderson
Copy link
Contributor

I agree that, in dark mode, the background of the graphs should be fairly dark
(but if this is a problem on the Mac, the light background is OK)

@CharlieFenton
Copy link
Contributor

I think it is worthwhile to take a step back and look at what Microsoft and Apple say about Dark Mode.

This article from Microsoft says:

Light mode is typically the standard setting for most computers, but lots of users are making the switch to Dark mode for a variety of reasons. Here are some benefits to turning on Dark mode:
Aesthetic preference: A common reason why people prefer Dark mode is because it aligns with their aesthetic better than Light mode. If you prefer darker colors over lighter ones, Dark mode will likely fit your style.
Easier on the eyes: Dark mode is often credited for reducing eyestrain, which is a syndrome that can occur if you look at a bright screen for too long. Turning on Dark mode may also make the letters easier to read.
Better for darker locations: A bright screen in a dark room can be harsh on the eyes and could potentially bother those around you. Using Dark mode in a dimly lit airplane cabin or a shared bedroom will help reduce the brightness of your screen to make it stand out less.
Preserves battery: Does Dark mode save battery life? You bet!

I've seen some websites say Reduce eyestrain rather than Easier on the eyes. I think that is primarily about reducing the glare that comes from black letters on a white background. It's pretty clear to me that Dark mode doesn't necessarily involve inverting all colors. If you scroll down a bit in this section of this microsoft article you can see that a color quite similar to our graph background is unchanged in dark mode.

When I asked Google for Microsoft dark mode programming guidelines it replied:

Microsoft's dark mode guidelines focus on using dark grays for backgrounds, lighter surfaces for importance (elevation), avoiding pure white/saturated colors, ensuring accessibility (contrast, focus indicators)

and

Elevation: Use lighter shades of gray for more important surfaces (like dialogs) and darker grays for less important ones to create depth.
Avoid Pure White: Use dark grays for backgrounds and avoid pure white (#FFFFFF) for text/elements to reduce eye strain in dark mode.
Don't Invert: Don't simply invert colors; design specifically for dark mode for optimal results.
Accessibility: Ensure focus indicators (like blue outlines) remain visible.

Another important consideration I see mentioned in the above articles and various others is accessibility. Contrast among elements must be high enough to help people with impaired vision understand the display. That means the grid lines must be more prominent than the screenshot from this PR. I feel the pale blue background we have in Light Mode also works well in Dark Mode and allows the grid lines and data to be easily visible without causing eye strain or glare.

I am willing to consider using the colors that we settle on for Windows in the statistics tab on the Mac if they are pleasing (aesthetic preference) and satisfy all the other considerations discussed above. But I feel the current proposal does not meet those criteria.

Finally, please remember that BOINC has supported Dark Mode on the Mac since June 2023 and the current implementation has been very well received.

@AenBleidd
Copy link
Member

Finally, please remember that BOINC has supported Dark Mode on the Mac since June 2023 and the current implementation has been very well received.

That doesn't mean that it's perfect and cannot be made better ;)

If you scroll down a bit in this section of this microsoft article you can see that a color quite similar to our graph background is unchanged in dark mode.

True, but the color itself is a little bit more soft and darker in comparison with the color we have in BOINC Manager.

But I do agree. I do not want to say that the set of colors in this PR is the final.
I'm open for a discussion, and we need to find the solution that will be satisfiable for all of us.
Personally I don't like graphs background in macOS version because I find it too bright, however on the real macOS screen they might look differently (we all remember that display calibration of macOS devices is one of the best, and other displays usually show slightly different colors.

This needs to be further discussed to find better colors for the next try.

@AenBleidd
Copy link
Member

@CharlieFenton, some examples of graphics from GitHub I personally like:
image
image
I'm not pushing to use them as a guideline, however I like them because they don't have big areas that are too bright or too dark in comparison with the other surrounding areas.

Again, need to be further discussed.

@AenBleidd
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Review in progress

Development

Successfully merging this pull request may close these issues.

[Manager] Add dark mode support on Windows

4 participants