summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-11-18 18:59:56 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-11-18 18:59:56 -0300
commitee944e0da21b4cf4c382b56927417af1f1dd7dea (patch)
tree134a27d6bbdfff3b59b42f5d54dca50358b9eee5 /scene/gui
parentb4f88eb4b6dff2b22f333c14d77634bc0cf727ba (diff)
parentae65dfa4ec82dd59f7aaa0b4fa48ba28f878b72c (diff)
Merge pull request #2734 from neikeq/popupmenu_imp
Small PopupMenu behaviour changes
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/popup_menu.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 89354322e3..99663fb2e2 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -323,11 +323,14 @@ void PopupMenu::_input_event(const InputEvent &p_event) {
invalidated_click=false;
break;
}
- if (over<0 || items[over].separator || items[over].disabled) {
+ if (over<0) {
hide();
break; //non-activable
}
+ if (items[over].separator || items[over].disabled)
+ break;
+
if (items[over].submenu!="") {
_activate_submenu(over);
@@ -362,8 +365,11 @@ void PopupMenu::_input_event(const InputEvent &p_event) {
int over=_get_mouse_over(Point2(m.x,m.y));
int id = (over<0 || items[over].separator || items[over].disabled)?-1:items[over].ID;
- if (id<0)
+ if (id<0) {
+ mouse_over=-1;
+ update();
break;
+ }
if (items[over].submenu!="" && submenu_over!=over) {
submenu_over=over;