diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-13 14:08:30 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-13 14:08:30 -0300 |
commit | de8cc309d66641d52a6832ad65f26ce73378fb88 (patch) | |
tree | 0ae019462739e97ba4ae562ba527696fe8c2f253 /scene/gui/base_button.h | |
parent | e53c247cb16b25b828461f32533da64f4fab0e0b (diff) | |
download | redot-engine-de8cc309d66641d52a6832ad65f26ce73378fb88.tar.gz |
Renamed button functions to be more verboes, same with Range unit value -> ratio
Diffstat (limited to 'scene/gui/base_button.h')
-rw-r--r-- | scene/gui/base_button.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h index 898c19e811..def4ff7536 100644 --- a/scene/gui/base_button.h +++ b/scene/gui/base_button.h @@ -40,11 +40,20 @@ class ButtonGroup; class BaseButton : public Control { GDCLASS( BaseButton, Control ); +public: + + enum ActionMode { + ACTION_MODE_BUTTON_PRESS, + ACTION_MODE_BUTTON_RELEASE, + }; + +private: bool toggle_mode; FocusMode enabled_focus_mode; Ref<ShortCut> shortcut; + ActionMode action_mode; struct Status { bool pressed; @@ -53,7 +62,6 @@ class BaseButton : public Control { bool pressing_inside; bool disabled; - bool click_on_press; int pressing_button; } status; @@ -100,8 +108,8 @@ public: void set_disabled(bool p_disabled); bool is_disabled() const; - void set_click_on_press(bool p_click_on_press); - bool get_click_on_press() const; + void set_action_mode(ActionMode p_mode); + ActionMode get_action_mode() const; void set_enabled_focus_mode(FocusMode p_mode); FocusMode get_enabled_focus_mode() const; @@ -120,6 +128,8 @@ public: }; VARIANT_ENUM_CAST( BaseButton::DrawMode ) +VARIANT_ENUM_CAST( BaseButton::ActionMode ) + class ButtonGroup : public Resource { |