summaryrefslogtreecommitdiff
path: root/scene/gui/tabs.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/tabs.h')
-rw-r--r--scene/gui/tabs.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h
index 1a8352bc93..5a4533c3d2 100644
--- a/scene/gui/tabs.h
+++ b/scene/gui/tabs.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -45,10 +45,9 @@ public:
enum CloseButtonDisplayPolicy {
- SHOW_ALWAYS,
- SHOW_ACTIVE_ONLY,
- SHOW_HOVER,
- SHOW_NEVER
+ CLOSE_BUTTON_SHOW_NEVER,
+ CLOSE_BUTTON_SHOW_ACTIVE_ONLY,
+ CLOSE_BUTTON_SHOW_ALWAYS,
};
private:
@@ -59,12 +58,21 @@ private:
Ref<Texture> icon;
int ofs_cache;
int size_cache;
+ int x_cache;
+ int x_size_cache;
+
Ref<Texture> right_button;
Rect2 rb_rect;
- Ref<Texture> close_button;
Rect2 cb_rect;
+
};
+
+ int offset;
+ int max_drawn_tab;
+ int hilite_arrow;
+ bool buttons_visible;
+ bool missing_right;
Vector<Tab> tabs;
int current;
Control *_get_tab(int idx) const;
@@ -79,6 +87,9 @@ private:
int hover; // hovered tab
+ int get_tab_width(int p_idx) const;
+ void _ensure_no_over_offset();
+
protected:
void _input_event(const InputEvent& p_event);
@@ -98,13 +109,11 @@ public:
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_close_button(int p_tab, const Ref<Texture>& p_close_button);
- Ref<Texture> get_tab_close_button(int p_tab) const;
- void set_tab_close_display_policy(CloseButtonDisplayPolicy p_cb_displaypolicy);
-
void set_tab_align(TabAlign p_align);
TabAlign get_tab_align() const;
+ void set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy);
+
int get_tab_count() const;
void set_current_tab(int p_current);
int get_current_tab() const;
@@ -113,6 +122,8 @@ public:
void clear_tabs();
+ void ensure_tab_visible(int p_idx);
+
Size2 get_minimum_size() const;
Tabs();