From ae65dfa4ec82dd59f7aaa0b4fa48ba28f878b72c Mon Sep 17 00:00:00 2001 From: neikeq Date: Thu, 5 Nov 2015 15:22:50 +0100 Subject: [PATCH] Small PopupMenu changes --- scene/gui/popup_menu.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 6c21ea639f1..95d45031628 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;