1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Added hover_pressed style to CheckBox and CheckButton

Added hover_pressed style to CheckBox and CheckButton.
If no style is defined for this property it will default to the pressed property.
This commit is contained in:
DualMatrix
2018-09-24 01:56:30 +02:00
parent 2c7908739a
commit 99e3309296
4 changed files with 24 additions and 1 deletions

View File

@@ -88,6 +88,21 @@ void Button::_notification(int p_what) {
if (has_color("icon_color_normal"))
color_icon = get_color("icon_color_normal");
} break;
case DRAW_HOVER_PRESSED: {
if (has_stylebox("hover_pressed") && has_stylebox_override("hover_pressed")) {
style = get_stylebox("hover_pressed");
if (!flat)
style->draw(ci, Rect2(Point2(0, 0), size));
if (has_color("font_color_hover_pressed"))
color = get_color("font_color_hover_pressed");
else
color = get_color("font_color");
if (has_color("icon_color_hover_pressed"))
color_icon = get_color("icon_color_hover_pressed");
break;
}
}
case DRAW_PRESSED: {
style = get_stylebox("pressed");