Cleanup: Remove titlebar text color from decoration style settings

When the colored titlebar decoration style was implemented in
PR #123982, both the titlebar background and foreground were exposed
to the OS backends to be used when styling the Blender window titlebar.

In practice, both backends that implement this decoration style (Win32
and macOS/Cocoa) only use the background color, and they either rely on
the OS to automatically set the text color or use the color HSV value
component to switch between the OS dark/white color.

While it was thought to still keep this value around for a potential
future backend implementation, the color settings parsed to obtain the
titlebar color (`TH_BUTBACK_TEXT_HI`, which wasn't properly suited for
this feature to begin with) has been replaced by `TH_TEXT` in #140726,
which ends up being too bright to be used as titlebar text for most
themes/use cases.

As such, this PR removes this unused titlebar decoration style setting.
Future backends that wishes the implement the colored titlebar
decoration style should either use an existing OS/DE text color or use
a set white/dark text color, similarly to what the Cocoa backend does.

Pull Request: https://projects.blender.org/blender/blender/pulls/140823
This commit is contained in:
Jonas Holzman
2025-06-22 22:17:02 +02:00
parent 34f97c8f6f
commit c8aa20f8b3
2 changed files with 1 additions and 4 deletions

View File

@@ -741,7 +741,6 @@ typedef struct {
typedef struct {
float colored_titlebar_bg_color[3];
float colored_titlebar_fg_color[3];
} GHOST_WindowDecorationStyleSettings;
#ifdef WITH_VULKAN_BACKEND

View File

@@ -660,11 +660,9 @@ static void wm_window_decoration_style_set_from_theme(const wmWindow *win, const
UI_SetTheme(0, RGN_TYPE_WINDOW);
}
float titlebar_bg_color[3], titlebar_fg_color[3];
float titlebar_bg_color[3];
UI_GetThemeColor3fv(TH_BACK, titlebar_bg_color);
UI_GetThemeColor3fv(TH_TEXT, titlebar_fg_color);
copy_v3_v3(decoration_settings.colored_titlebar_bg_color, titlebar_bg_color);
copy_v3_v3(decoration_settings.colored_titlebar_fg_color, titlebar_fg_color);
GHOST_SetWindowDecorationStyleSettings(static_cast<GHOST_WindowHandle>(win->ghostwin),
decoration_settings);