[Scene] Add SceneStringName::hover

This commit is contained in:
Chaosus
2024-12-05 11:24:52 +03:00
parent cf038deb10
commit 9a8d6628de
11 changed files with 38 additions and 37 deletions

View File

@ -161,7 +161,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
focus->set_expand_margin_all(Math::round(2 * scale));
theme->set_stylebox(CoreStringName(normal), "Button", button_normal);
theme->set_stylebox("hover", "Button", button_hover);
theme->set_stylebox(SceneStringName(hover), "Button", button_hover);
theme->set_stylebox(SceneStringName(pressed), "Button", button_pressed);
theme->set_stylebox("disabled", "Button", button_disabled);
theme->set_stylebox("focus", "Button", focus);
@ -192,7 +192,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// MenuBar
theme->set_stylebox(CoreStringName(normal), "MenuBar", button_normal);
theme->set_stylebox("hover", "MenuBar", button_hover);
theme->set_stylebox(SceneStringName(hover), "MenuBar", button_hover);
theme->set_stylebox(SceneStringName(pressed), "MenuBar", button_pressed);
theme->set_stylebox("disabled", "MenuBar", button_disabled);
@ -235,7 +235,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
Ref<StyleBox> sb_optbutton_disabled = make_flat_stylebox(style_disabled_color, 2 * default_margin, default_margin, 2 * default_margin, default_margin);
theme->set_stylebox(CoreStringName(normal), "OptionButton", sb_optbutton_normal);
theme->set_stylebox("hover", "OptionButton", sb_optbutton_hover);
theme->set_stylebox(SceneStringName(hover), "OptionButton", sb_optbutton_hover);
theme->set_stylebox(SceneStringName(pressed), "OptionButton", sb_optbutton_pressed);
theme->set_stylebox("disabled", "OptionButton", sb_optbutton_disabled);
@ -271,7 +271,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox(CoreStringName(normal), "MenuButton", button_normal);
theme->set_stylebox(SceneStringName(pressed), "MenuButton", button_pressed);
theme->set_stylebox("hover", "MenuButton", button_hover);
theme->set_stylebox(SceneStringName(hover), "MenuButton", button_hover);
theme->set_stylebox("disabled", "MenuButton", button_disabled);
theme->set_stylebox("focus", "MenuButton", focus);
@ -298,7 +298,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox(CoreStringName(normal), "CheckBox", cbx_empty);
theme->set_stylebox(SceneStringName(pressed), "CheckBox", cbx_empty);
theme->set_stylebox("disabled", "CheckBox", cbx_empty);
theme->set_stylebox("hover", "CheckBox", cbx_empty);
theme->set_stylebox(SceneStringName(hover), "CheckBox", cbx_empty);
theme->set_stylebox("hover_pressed", "CheckBox", cbx_empty);
theme->set_stylebox("focus", "CheckBox", cbx_focus);
@ -334,7 +334,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox(CoreStringName(normal), "CheckButton", cb_empty);
theme->set_stylebox(SceneStringName(pressed), "CheckButton", cb_empty);
theme->set_stylebox("disabled", "CheckButton", cb_empty);
theme->set_stylebox("hover", "CheckButton", cb_empty);
theme->set_stylebox(SceneStringName(hover), "CheckButton", cb_empty);
theme->set_stylebox("hover_pressed", "CheckButton", cb_empty);
theme->set_stylebox("focus", "CheckButton", focus);
@ -376,12 +376,12 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
flat_button_pressed->set_bg_color(style_pressed_color * Color(1, 1, 1, 0.85));
theme->set_stylebox(CoreStringName(normal), SceneStringName(FlatButton), flat_button_normal);
theme->set_stylebox("hover", SceneStringName(FlatButton), flat_button_normal);
theme->set_stylebox(SceneStringName(hover), SceneStringName(FlatButton), flat_button_normal);
theme->set_stylebox(SceneStringName(pressed), SceneStringName(FlatButton), flat_button_pressed);
theme->set_stylebox("disabled", SceneStringName(FlatButton), flat_button_normal);
theme->set_stylebox(CoreStringName(normal), "FlatMenuButton", flat_button_normal);
theme->set_stylebox("hover", "FlatMenuButton", flat_button_normal);
theme->set_stylebox(SceneStringName(hover), "FlatMenuButton", flat_button_normal);
theme->set_stylebox(SceneStringName(pressed), "FlatMenuButton", flat_button_pressed);
theme->set_stylebox("disabled", "FlatMenuButton", flat_button_normal);
@ -733,7 +733,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
style_popup_panel->set_border_color(style_popup_border_color);
theme->set_stylebox(SceneStringName(panel), "PopupMenu", style_popup_panel);
theme->set_stylebox("hover", "PopupMenu", make_flat_stylebox(style_popup_hover_color));
theme->set_stylebox(SceneStringName(hover), "PopupMenu", make_flat_stylebox(style_popup_hover_color));
theme->set_stylebox("separator", "PopupMenu", separator_horizontal);
theme->set_stylebox("labeled_separator_left", "PopupMenu", separator_horizontal);
theme->set_stylebox("labeled_separator_right", "PopupMenu", separator_horizontal);
@ -1110,7 +1110,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("bg", "ColorPickerButton", icons["mini_checkerboard"]);
theme->set_stylebox(CoreStringName(normal), "ColorPickerButton", button_normal);
theme->set_stylebox(SceneStringName(pressed), "ColorPickerButton", button_pressed);
theme->set_stylebox("hover", "ColorPickerButton", button_hover);
theme->set_stylebox(SceneStringName(hover), "ColorPickerButton", button_hover);
theme->set_stylebox("disabled", "ColorPickerButton", button_disabled);
theme->set_stylebox("focus", "ColorPickerButton", focus);