From c8aa20f8b370d44bdb3bd37fc67b93e3545a0441 Mon Sep 17 00:00:00 2001 From: Jonas Holzman Date: Sun, 22 Jun 2025 22:17:02 +0200 Subject: [PATCH] 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 --- intern/ghost/GHOST_Types.h | 1 - source/blender/windowmanager/intern/wm_window.cc | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index 0c51c3de6ab..3763ab01af1 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -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 diff --git a/source/blender/windowmanager/intern/wm_window.cc b/source/blender/windowmanager/intern/wm_window.cc index 6d9a9d18d05..cd3f0e77c78 100644 --- a/source/blender/windowmanager/intern/wm_window.cc +++ b/source/blender/windowmanager/intern/wm_window.cc @@ -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(win->ghostwin), decoration_settings);