You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-30 16:26:50 +00:00
Add theming support for hovered tabs
Tabs can now be styled differently when hovered by the mouse pointer.
This commit is contained in:
@@ -747,6 +747,12 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
style_tab_selected->set_border_color(tab_highlight);
|
||||
style_tab_selected->set_corner_radius_all(0);
|
||||
|
||||
Ref<StyleBoxFlat> style_tab_hovered = style_tab_base->duplicate();
|
||||
|
||||
style_tab_hovered->set_bg_color(dark_color_1.lerp(base_color, 0.4));
|
||||
// Hovered tab has a subtle highlight between normal and selected states.
|
||||
style_tab_hovered->set_corner_radius_all(0);
|
||||
|
||||
Ref<StyleBoxFlat> style_tab_unselected = style_tab_base->duplicate();
|
||||
style_tab_unselected->set_expand_margin(SIDE_BOTTOM, 0);
|
||||
style_tab_unselected->set_bg_color(dark_color_1);
|
||||
@@ -1319,17 +1325,21 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_stylebox("tabbar_background", "TabContainer", style_tabbar_background);
|
||||
|
||||
theme->set_stylebox("tab_selected", "TabContainer", style_tab_selected);
|
||||
theme->set_stylebox("tab_hovered", "TabContainer", style_tab_hovered);
|
||||
theme->set_stylebox("tab_unselected", "TabContainer", style_tab_unselected);
|
||||
theme->set_stylebox("tab_disabled", "TabContainer", style_tab_disabled);
|
||||
theme->set_stylebox("tab_selected", "TabBar", style_tab_selected);
|
||||
theme->set_stylebox("tab_hovered", "TabBar", style_tab_hovered);
|
||||
theme->set_stylebox("tab_unselected", "TabBar", style_tab_unselected);
|
||||
theme->set_stylebox("tab_disabled", "TabBar", style_tab_disabled);
|
||||
theme->set_stylebox("button_pressed", "TabBar", style_menu);
|
||||
theme->set_stylebox("button_highlight", "TabBar", style_menu);
|
||||
theme->set_color("font_selected_color", "TabContainer", font_color);
|
||||
theme->set_color("font_hovered_color", "TabContainer", font_color);
|
||||
theme->set_color("font_unselected_color", "TabContainer", font_disabled_color);
|
||||
theme->set_color("font_outline_color", "TabContainer", font_outline_color);
|
||||
theme->set_color("font_selected_color", "TabBar", font_color);
|
||||
theme->set_color("font_hovered_color", "TabBar", font_color);
|
||||
theme->set_color("font_unselected_color", "TabBar", font_disabled_color);
|
||||
theme->set_color("font_outline_color", "TabBar", font_outline_color);
|
||||
theme->set_color("drop_mark_color", "TabContainer", tab_highlight);
|
||||
|
||||
Reference in New Issue
Block a user