Merge pull request #2734 from neikeq/popupmenu_imp

Small PopupMenu behaviour changes
This commit is contained in:
Juan Linietsky 2015-11-18 18:59:56 -03:00
commit ee944e0da2
1 changed files with 8 additions and 2 deletions

View File

@ -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;