summaryrefslogtreecommitdiff
path: root/scene/gui/shortcut.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-08-03 17:27:45 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-08-05 13:48:43 +0200
commitde2c2be19bed9f78be627045fb671367b2b93122 (patch)
treecacdc888b9e0afa64d2b80b0d1faf8480064bd57 /scene/gui/shortcut.h
parent1eff610e2bd71521db6d0f4fee25a641e1c7bdd6 (diff)
Shortcut: Rename `shortcut` property to `event`
Having a property which has the same name as its class leads to confusing situations (e.g. `BaseButton` has a `shortcut` property of type `Shortcut` which has a `shortcut` property of type `InputEvent`). Also renames `is_event` to `matches_event`, and `is_valid` to `has_valid_event` to better reflect what the methods check.
Diffstat (limited to 'scene/gui/shortcut.h')
-rw-r--r--scene/gui/shortcut.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/scene/gui/shortcut.h b/scene/gui/shortcut.h
index ea91f29b5d..249dd1971f 100644
--- a/scene/gui/shortcut.h
+++ b/scene/gui/shortcut.h
@@ -37,20 +37,18 @@
class Shortcut : public Resource {
GDCLASS(Shortcut, Resource);
- Ref<InputEvent> shortcut;
+ Ref<InputEvent> event;
protected:
static void _bind_methods();
public:
- void set_shortcut(const Ref<InputEvent> &p_shortcut);
- Ref<InputEvent> get_shortcut() const;
- bool is_shortcut(const Ref<InputEvent> &p_event) const;
- bool is_valid() const;
+ void set_event(const Ref<InputEvent> &p_shortcut);
+ Ref<InputEvent> get_event() const;
+ bool matches_event(const Ref<InputEvent> &p_event) const;
+ bool has_valid_event() const;
String get_as_text() const;
-
- Shortcut();
};
#endif // SHORTCUT_H