From 6d4d5f92729f876b8c4e18ef90f2d6608ebded44 Mon Sep 17 00:00:00 2001 From: Nick Christodoulou <80926890+SlienCode@users.noreply.github.com> Date: Sun, 22 Sep 2024 20:07:46 +0200 Subject: [PATCH] Fix `font_hover_pressed_color` and `icon_hover_pressed_color` not working for no stylebox use on `Button` You now don't need to have a `hover_pressed` stylebox to make use of `font_hover_pressed_color` and `icon_hover_pressed_color`. --- scene/gui/button.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index dd344121e1a..2268c79074d 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -298,19 +298,12 @@ void Button::_notification(int p_what) { } } break; case DRAW_HOVER_PRESSED: { - // Edge case for CheckButton and CheckBox. - if (has_theme_stylebox("hover_pressed")) { - if (has_theme_color(SNAME("font_hover_pressed_color"))) { - font_color = theme_cache.font_hover_pressed_color; - } - if (has_theme_color(SNAME("icon_hover_pressed_color"))) { - icon_modulate_color = theme_cache.icon_hover_pressed_color; - } - - break; + font_color = theme_cache.font_hover_pressed_color; + if (has_theme_color(SNAME("icon_hover_pressed_color"))) { + icon_modulate_color = theme_cache.icon_hover_pressed_color; } - } - [[fallthrough]]; + + } break; case DRAW_PRESSED: { if (has_theme_color(SNAME("font_pressed_color"))) { font_color = theme_cache.font_pressed_color;