summaryrefslogtreecommitdiffstats
path: root/scene/gui/option_button.h
diff options
context:
space:
mode:
authorMounir Tohami <53877170+WhalesState@users.noreply.github.com>2023-08-03 08:38:20 +0000
committerMounir Tohami <53877170+WhalesState@users.noreply.github.com>2023-08-03 08:38:20 +0000
commit2cec27a3f1630a12dab94c1186fbac5620ccd12a (patch)
tree199d90e17e8f483a675249411141ab14eed022df /scene/gui/option_button.h
parent237bd0a615df8a0e57bc3d299894abece7b43a0c (diff)
downloadredot-engine-2cec27a3f1630a12dab94c1186fbac5620ccd12a.tar.gz
Add shortcut handling to OptionButton
Diffstat (limited to 'scene/gui/option_button.h')
-rw-r--r--scene/gui/option_button.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/gui/option_button.h b/scene/gui/option_button.h
index 7dcb3319c6..e29f14ad54 100644
--- a/scene/gui/option_button.h
+++ b/scene/gui/option_button.h
@@ -37,6 +37,7 @@
class OptionButton : public Button {
GDCLASS(OptionButton, Button);
+ bool disable_shortcuts = false;
PopupMenu *popup = nullptr;
int current = -1;
bool fit_to_longest_item = true;
@@ -79,6 +80,7 @@ protected:
void _get_property_list(List<PropertyInfo> *p_list) const;
void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
+ virtual void shortcut_input(const Ref<InputEvent> &p_event) override;
public:
// ATTENTION: This is used by the POT generator's scene parser. If the number of properties returned by `_get_items()` ever changes,
@@ -129,6 +131,8 @@ public:
PopupMenu *get_popup() const;
void show_popup();
+ void set_disable_shortcuts(bool p_disabled);
+
OptionButton(const String &p_text = String());
~OptionButton();
};