summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorDaniel J. Ramirez <djrmuv@gmail.com>2017-07-18 11:03:06 -0500
committerDaniel J. Ramirez <djrmuv@gmail.com>2017-07-18 11:03:06 -0500
commit337c1238b9a4da1c0ccb0547a1be370c4ac6a56c (patch)
tree6c782c17d4cb3ef088416d55f57e2230ce165a47 /scene
parent0afa77a8a2e148fac6b57fab3e85c6e631e12c63 (diff)
Fixed button flat behavior when not in normal state.
Also changed some buttons to flat mode
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/button.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index a456759281..03798c01a2 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -89,7 +89,8 @@ void Button::_notification(int p_what) {
case DRAW_PRESSED: {
style = get_stylebox("pressed");
- style->draw(ci, Rect2(Point2(0, 0), size));
+ if (!flat)
+ style->draw(ci, Rect2(Point2(0, 0), size));
if (has_color("font_color_pressed"))
color = get_color("font_color_pressed");
else
@@ -101,7 +102,8 @@ void Button::_notification(int p_what) {
case DRAW_HOVER: {
style = get_stylebox("hover");
- style->draw(ci, Rect2(Point2(0, 0), size));
+ if (!flat)
+ style->draw(ci, Rect2(Point2(0, 0), size));
color = get_color("font_color_hover");
if (has_color("icon_color_hover"))
color_icon = get_color("icon_color_hover");
@@ -110,7 +112,8 @@ void Button::_notification(int p_what) {
case DRAW_DISABLED: {
style = get_stylebox("disabled");
- style->draw(ci, Rect2(Point2(0, 0), size));
+ if (!flat)
+ style->draw(ci, Rect2(Point2(0, 0), size));
color = get_color("font_color_disabled");
if (has_color("icon_color_disabled"))
color_icon = get_color("icon_color_disabled");