diff options
| author | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
| commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
| tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /scene/gui/tabs.h | |
| parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) | |
| download | godot-5dbf180.tar.gz godot-5dbf180.tar.zst godot-5dbf180.zip | |
A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
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 83dcce261..39811f13c 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); |
