diff options
Diffstat (limited to 'scene/gui/popup_menu.cpp')
-rw-r--r-- | scene/gui/popup_menu.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 6c21ea639f..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; @@ -774,6 +780,7 @@ void PopupMenu::add_separator() { void PopupMenu::clear() { items.clear(); + mouse_over=-1; update(); idcount=0; |