diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-11-16 09:34:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-16 09:34:28 +0100 |
commit | 94875f5f481d17fce4db68b44ecd657afbe9d66e (patch) | |
tree | e89c85d453c70ac44ad2b30cd70e8986dabc8604 /scene/gui/popup_menu.h | |
parent | d7176e9040c6db885dace95a942bcc2c6889e15b (diff) | |
parent | c482e8ec85e75f8900c11ba04213c3e42fd64db6 (diff) |
Merge pull request #41851 from EricEzaM/PR/popup-menu-hysteresis
Added hysteresis for popup sub-menus
Diffstat (limited to 'scene/gui/popup_menu.h')
-rw-r--r-- | scene/gui/popup_menu.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index e8f82ba869..a2e7d7e6cd 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -86,6 +86,9 @@ class PopupMenu : public Popup { } }; + bool close_allowed = false; + + Timer *minimum_lifetime_timer = nullptr; Timer *submenu_timer; List<Rect2> autohide_areas; Vector<Item> items; @@ -102,7 +105,7 @@ class PopupMenu : public Popup { void _scroll_to_item(int p_item); void _gui_input(const Ref<InputEvent> &p_event); - void _activate_submenu(int over); + void _activate_submenu(int p_over); void _submenu_timeout(); uint64_t popup_time_msec = 0; @@ -130,6 +133,9 @@ class PopupMenu : public Popup { void _draw_items(); void _draw_background(); + void _minimum_lifetime_timeout(); + void _close_pressed(); + protected: friend class MenuButton; void _notification(int p_what); |