From 5548c6058245e85856b1af4183b5b9393ef7fab9 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 25 Oct 2024 12:30:08 +0800 Subject: [PATCH] Fix Button not listing `hover_pressed` stylebox (cherry picked from commit cc11089786de6fc84a58f4b0af004997131b5b02) --- doc/classes/Button.xml | 3 +++ scene/resources/default_theme/default_theme.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index a520fbbd0fb..6ea73ca4075 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -113,6 +113,9 @@ [StyleBox] used when the [Button] is being hovered. + + [StyleBox] used when the [Button] is being hovered and pressed. + Default [StyleBox] for the [Button]. diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 375d711e4d5..bb94d2e22c5 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -230,6 +230,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_stylebox("normal", "Button", sb_button_normal); theme->set_stylebox("pressed", "Button", sb_button_pressed); theme->set_stylebox("hover", "Button", sb_button_hover); + theme->set_stylebox("hover_pressed", "Button", sb_button_hover); theme->set_stylebox("disabled", "Button", sb_button_disabled); theme->set_stylebox("focus", "Button", sb_button_focus);