summaryrefslogtreecommitdiffstats
path: root/scene/gui/tab_bar.h
diff options
context:
space:
mode:
authorkit <kitbdev@gmail.com>2024-01-14 18:39:47 -0500
committerkit <kitbdev@gmail.com>2024-01-29 14:30:34 -0500
commit6e965f6c8337eb9946a5e3da7183d89aa53aac38 (patch)
treec8300188ec0ed2e4cb0f20b09a379cb9abf7c87b /scene/gui/tab_bar.h
parentfa48a51183567934984b381ad8ec281cb24d66ba (diff)
downloadredot-engine-6e965f6c8337eb9946a5e3da7183d89aa53aac38.tar.gz
Allow tab deselection
Diffstat (limited to 'scene/gui/tab_bar.h')
-rw-r--r--scene/gui/tab_bar.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/gui/tab_bar.h b/scene/gui/tab_bar.h
index 9674187fb3..444c737220 100644
--- a/scene/gui/tab_bar.h
+++ b/scene/gui/tab_bar.h
@@ -85,8 +85,8 @@ private:
bool buttons_visible = false;
bool missing_right = false;
Vector<Tab> tabs;
- int current = 0;
- int previous = 0;
+ int current = -1;
+ int previous = -1;
AlignmentMode tab_alignment = ALIGNMENT_LEFT;
bool clip_tabs = true;
int rb_hover = -1;
@@ -94,6 +94,7 @@ private:
bool tab_style_v_flip = false;
bool select_with_rmb = false;
+ bool deselect_enabled = false;
int cb_hover = -1;
bool cb_pressing = false;
@@ -146,6 +147,7 @@ private:
int get_tab_width(int p_idx) const;
Size2 _get_tab_icon_size(int p_idx) const;
void _ensure_no_over_offset();
+ bool _can_deselect() const;
void _update_hover();
void _update_cache(bool p_update_hover = true);
@@ -250,6 +252,9 @@ public:
void set_select_with_rmb(bool p_enabled);
bool get_select_with_rmb() const;
+ void set_deselect_enabled(bool p_enabled);
+ bool get_deselect_enabled() const;
+
void ensure_tab_visible(int p_idx);
void set_max_tab_width(int p_width);