Give TabBar overridable colors per tab

This commit is contained in:
Logan Detrick 2025-05-10 19:18:08 -07:00
parent fc7065d2b4
commit 914a72f8a4
2 changed files with 55 additions and 4 deletions

View file

@ -52,11 +52,22 @@ public:
CLOSE_BUTTON_MAX
};
enum DrawMode {
DRAW_NORMAL,
DRAW_PRESSED,
DRAW_HOVER,
DRAW_DISABLED,
DRAW_MAX,
};
private:
struct Tab {
mutable RID accessibility_item_element;
mutable bool accessibility_item_dirty = true;
// Corresponds to color overrides for the DrawMode enum
Color font_color_overrides[DrawMode::DRAW_MAX] = { Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0) };
String text;
String tooltip;
@ -228,6 +239,10 @@ public:
void set_tab_icon_max_width(int p_tab, int p_width);
int get_tab_icon_max_width(int p_tab) const;
void set_font_color_override_all(int p_tab, const Color &p_color);
void set_font_color_override(int p_tab, DrawMode p_draw_mode, const Color &p_color);
Color get_font_color_override(int p_tab, DrawMode p_draw_mode) const;
void set_tab_disabled(int p_tab, bool p_disabled);
bool is_tab_disabled(int p_tab) const;