summaryrefslogtreecommitdiffstats
path: root/scene/gui/menu_button.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-04-18 12:24:17 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-04-18 12:24:17 +0200
commit043ca7c63c31b0f271a13998151cb03f0ff826ba (patch)
treeebebc5f2bf73d8aeaf5a059a378539927110820c /scene/gui/menu_button.h
parent3a88373a4c3e024aa96f94d08dd5f979e9af0f1c (diff)
parente95e954c68a9a694ad43f622e5424d9e3ec87819 (diff)
downloadredot-engine-043ca7c63c31b0f271a13998151cb03f0ff826ba.tar.gz
Merge pull request #88306 from KoBeWi/PropertyListHelper_will_come_for_you
Add PropertyListHelper in all simple cases
Diffstat (limited to 'scene/gui/menu_button.h')
-rw-r--r--scene/gui/menu_button.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/scene/gui/menu_button.h b/scene/gui/menu_button.h
index eea6b8e877..2bd577ddd0 100644
--- a/scene/gui/menu_button.h
+++ b/scene/gui/menu_button.h
@@ -33,6 +33,7 @@
#include "scene/gui/button.h"
#include "scene/gui/popup_menu.h"
+#include "scene/property_list_helper.h"
class MenuButton : public Button {
GDCLASS(MenuButton, Button);
@@ -42,13 +43,18 @@ class MenuButton : public Button {
bool disable_shortcuts = false;
PopupMenu *popup = nullptr;
+ static inline PropertyListHelper base_property_helper;
+ PropertyListHelper property_helper;
+
void _popup_visibility_changed(bool p_visible);
protected:
void _notification(int p_what);
bool _set(const StringName &p_name, const Variant &p_value);
bool _get(const StringName &p_name, Variant &r_ret) const;
- void _get_property_list(List<PropertyInfo> *p_list) const;
+ void _get_property_list(List<PropertyInfo> *p_list) const { property_helper.get_property_list(p_list, popup->get_item_count()); }
+ bool _property_can_revert(const StringName &p_name) const { return property_helper.property_can_revert(p_name); }
+ bool _property_get_revert(const StringName &p_name, Variant &r_property) const { return property_helper.property_get_revert(p_name, r_property); }
static void _bind_methods();
virtual void shortcut_input(const Ref<InputEvent> &p_event) override;