From 99e33092960e131427af6de24a386c7ab3f6593d Mon Sep 17 00:00:00 2001 From: DualMatrix Date: Mon, 24 Sep 2018 01:56:30 +0200 Subject: 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. --- scene/gui/button.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'scene/gui/button.cpp') diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index dd6d66ac62..2d17fb1391 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -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"); -- cgit v1.2.3