summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorGuy Rabiller <guy.rabiller@radfac.com>2014-10-24 16:33:18 +0200
committerGuy Rabiller <guy.rabiller@radfac.com>2014-10-24 16:33:43 +0200
commit41d1f9b7d64300be0e9c75893f8c2c515b07529b (patch)
tree2de399df959d43898cd988c4bee5aac41e23a792 /scene
parent88d64e7735a9b1ba99b3b6a785b394bccda8ea2d (diff)
- Fix BaseButton "Click on Press" issue. Now a button correctly show its visual "Pressed" status when "Click on Press" is enabled and the button is clicked.
Diffstat (limited to 'scene')
-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;
}