Respecting Dark Style Preference

When the user sets its preference to ‘dark’ on Macos, the window decoration for Blender follows that preference, matching the other native apps on the platform.

GNOME and KDE Plasma now also support this dark style preference and it would be nice if Blender would opt in to support it, even if for the window decoration alone (by setting the window hint to _GTK_THEME_VARIANT=dark). Running a dark theme with a light window decoration creates a nasty out-of-place contrast.

2 Likes

Testing on Pop!_OS & Gnome, this works fine for me already. Do you have a specific case maybe where it doesn’t?

Yes, unfortunately Ubuntu and Ubuntu derivatives like PopOS went the other route and force a stylesheet/theme for all apps rather than allowing apps to opt in to the preference. I can see how it can be hard to comprehend from the point of an app that supports arbitrary themes like Blender.

But since you asked – GNOME OS 42 or Fedora 36.

In the dark style preference world, Blender can be aware that the user prefers a dark style and could potentially pick a dark chrome for all of its UI (a concept that probably doesn’t exist), just like it exists on the web using media queries. But setting the WM hint sounded like a nice and easy first step.


2 Likes

I use dark theme on win11, and Blender’s window border does not seem to respect the dark theme.

You mean the title bar color? That is “non-client” area in that it is under the control of the OS. Here’s my system, set to Dark theme with a custom accent color set to black:

1 Like

That is interesting. Are you on Win 10 or Win 11?

How to use your OS settings to change the titlebar colors of all your apps, is far off this thread’s topic. Why not just google it? https://windowsloop.com/how-to-change-title-bar-color-in-windows-11/

2 Likes

The Technology Path

Since Windows 10 1809, Microsoft has provided an API for modifying only the color of the window title bar.

The method reference is
stackoverflow.com/questions/39261826/change-the-color-of-the-title-bar-caption-of-a-win32-application

Documentation see
docs.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute

At the same time, this API does not affect compatibility with older versions, and on Windows 7 or earlier versions of Windows, the API will not work and will not cause strange errors.

2 Likes