diff options
Diffstat (limited to 'scene/gui/tabs.h')
-rw-r--r-- | scene/gui/tabs.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h index 83dcce2613..39811f13c2 100644 --- a/scene/gui/tabs.h +++ b/scene/gui/tabs.h @@ -33,9 +33,9 @@ class Tabs : public Control { - GDCLASS( Tabs, Control ); -public: + GDCLASS(Tabs, Control); +public: enum TabAlign { ALIGN_LEFT, @@ -49,9 +49,8 @@ public: CLOSE_BUTTON_SHOW_ACTIVE_ONLY, CLOSE_BUTTON_SHOW_ALWAYS, }; -private: - +private: struct Tab { String text; @@ -65,10 +64,8 @@ private: Ref<Texture> right_button; Rect2 rb_rect; Rect2 cb_rect; - }; - int offset; int max_drawn_tab; int hilite_arrow; @@ -86,31 +83,29 @@ private: bool cb_pressing; CloseButtonDisplayPolicy cb_displaypolicy; - int hover; // hovered tab + int hover; // hovered tab int get_tab_width(int p_idx) const; void _ensure_no_over_offset(); protected: - - void _gui_input(const InputEvent& p_event); + void _gui_input(const InputEvent &p_event); void _notification(int p_what); static void _bind_methods(); public: + void add_tab(const String &p_str = "", const Ref<Texture> &p_icon = Ref<Texture>()); - void add_tab(const String& p_str="",const Ref<Texture>& p_icon=Ref<Texture>()); - - void set_tab_title(int p_tab,const String& p_title); + void set_tab_title(int p_tab, const String &p_title); String get_tab_title(int p_tab) const; - void set_tab_icon(int p_tab,const Ref<Texture>& p_icon); + void set_tab_icon(int p_tab, const Ref<Texture> &p_icon); Ref<Texture> get_tab_icon(int p_tab) const; - + void set_tab_disabled(int p_tab, bool p_disabled); bool get_tab_disabled(int p_tab) const; - void set_tab_right_button(int p_tab,const Ref<Texture>& p_right_button); + void set_tab_right_button(int p_tab, const Ref<Texture> &p_right_button); Ref<Texture> get_tab_right_button(int p_tab) const; void set_tab_align(TabAlign p_align); |