Merge pull request #38559 from Chaosus/button_icon_styles

Reveals Button "icon_color" style properties to the user
This commit is contained in:
Rémi Verschelde 2021-01-26 22:34:35 +01:00 committed by GitHub
commit e330b945b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -139,6 +139,21 @@
<theme_item name="hseparation" type="int" default="2">
The horizontal space between [Button]'s icon and text.
</theme_item>
<theme_item name="icon_disabled_color" type="Color" default="Color( 1, 1, 1, 1 )">
Icon modulate [Color] used when the [Button] is disabled.
</theme_item>
<theme_item name="icon_hover_color" type="Color" default="Color( 1, 1, 1, 1 )">
Icon modulate [Color] used when the [Button] is being hovered.
</theme_item>
<theme_item name="icon_hover_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )">
Icon modulate [Color] used when the [Button] is being hovered and pressed.
</theme_item>
<theme_item name="icon_normal_color" type="Color" default="Color( 1, 1, 1, 1 )">
Default icon [Color] of the [Button].
</theme_item>
<theme_item name="icon_pressed_color" type="Color" default="Color( 1, 1, 1, 1 )">
Icon modulate [Color] used when the [Button] is being pressed.
</theme_item>
<theme_item name="normal" type="StyleBox">
Default [StyleBox] for the [Button].
</theme_item>

View file

@ -191,6 +191,12 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color("font_disabled_color", "Button", control_font_disabled_color);
theme->set_color("font_outline_color", "Button", Color(1, 1, 1));
theme->set_color("icon_normal_color", "Button", Color(1, 1, 1, 1));
theme->set_color("icon_pressed_color", "Button", Color(1, 1, 1, 1));
theme->set_color("icon_hover_color", "Button", Color(1, 1, 1, 1));
theme->set_color("icon_hover_pressed_color", "Button", Color(1, 1, 1, 1));
theme->set_color("icon_disabled_color", "Button", Color(1, 1, 1, 1));
theme->set_constant("hseparation", "Button", 2 * scale);
// LinkButton