summaryrefslogtreecommitdiff
path: root/scene/gui/base_button.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-10-24 11:55:23 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-10-24 11:55:23 -0300
commitb38118c5cb363c9aa07fa90bf246eee8edeff203 (patch)
tree3adfcbbd2abec220dcc9c27315244ca29a4789fd /scene/gui/base_button.cpp
parenta494538337a0e31792eac589717b560eb615393f (diff)
parent41d1f9b7d64300be0e9c75893f8c2c515b07529b (diff)
Merge pull request #817 from grabiller/radfac#004b
Fix BaseButton "Click on Press" issue. Now a button correctly show its...
Diffstat (limited to 'scene/gui/base_button.cpp')
-rw-r--r--scene/gui/base_button.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index ac2417d539..7745ce11fc 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -55,6 +55,9 @@ void BaseButton::_input_event(InputEvent p_event) {
if (b.pressed) {
if (!toggle_mode) { //mouse press attempt
+
+ status.press_attempt=true;
+ status.pressing_inside=true;
pressed();
emit_signal("pressed");
@@ -71,8 +74,15 @@ void BaseButton::_input_event(InputEvent p_event) {
}
+ } else {
+
+ if (status.press_attempt &&status.pressing_inside) {
+ pressed();
+ emit_signal("pressed");
+ }
+ status.press_attempt=false;
}
-
+ update();
break;
}