Use "odd" style for TabContainers on base BG color

- Use the "odd" style for TabContainers that are on a background with the same color as the default TabContainer background color to add contrast
This commit is contained in:
FireForge 2022-05-26 21:12:09 -05:00
parent 9d28e10276
commit eb573da2b5
10 changed files with 16 additions and 10 deletions

View file

@ -1152,14 +1152,16 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
style_content_panel->set_border_color(dark_color_2);
theme->set_stylebox("panel", "TabContainer", style_content_panel);
// These styleboxes can be used on tabs against the base color background (e.g. nested tabs).
// TabContainerOdd can be used on tabs against the base color background (e.g. nested tabs).
theme->set_type_variation("TabContainerOdd", "TabContainer");
Ref<StyleBoxFlat> style_tab_selected_odd = style_tab_selected->duplicate();
style_tab_selected_odd->set_bg_color(disabled_bg_color);
theme->set_stylebox("tab_selected_odd", "TabContainer", style_tab_selected_odd);
theme->set_stylebox("tab_selected", "TabContainerOdd", style_tab_selected_odd);
Ref<StyleBoxFlat> style_content_panel_odd = style_content_panel->duplicate();
style_content_panel_odd->set_bg_color(disabled_bg_color);
theme->set_stylebox("panel_odd", "TabContainer", style_content_panel_odd);
theme->set_stylebox("panel", "TabContainerOdd", style_content_panel_odd);
// This stylebox is used in 3d and 2d viewports (no borders).
Ref<StyleBoxFlat> style_content_panel_vp = style_content_panel->duplicate();