diff options
author | Yuri Sizov <yuris@humnom.net> | 2022-08-29 17:40:17 +0300 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2022-08-29 23:43:32 +0300 |
commit | 8b196be85568b95e532d02cb56e68c790dc69f87 (patch) | |
tree | 4514a87271176ba390626c20fc458d25a529ef04 /scene | |
parent | 051f24b067642a241d0a4acbb1b7644e11700bfc (diff) |
Add background to TabContainer's tabbar and editor docks
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/tab_container.cpp | 4 | ||||
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 10a6d18330..a981cda485 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -163,6 +163,10 @@ void TabContainer::_notification(int p_what) { int header_height = _get_top_margin(); + // Draw background for the tabbar. + Ref<StyleBox> tabbar_background = get_theme_stylebox(SNAME("tabbar_background")); + tabbar_background->draw(canvas, Rect2(0, 0, size.width, header_height)); + // Draw the background for the tab's content. panel->draw(canvas, Rect2(0, header_height, size.width, size.height - header_height)); // Draw the popup menu. diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 410f35e597..73ad1ceff7 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -831,6 +831,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("tab_unselected", "TabContainer", style_tab_unselected); theme->set_stylebox("tab_disabled", "TabContainer", style_tab_disabled); theme->set_stylebox("panel", "TabContainer", make_flat_stylebox(style_normal_color, 0, 0, 0, 0)); + theme->set_stylebox("tabbar_background", "TabContainer", make_empty_stylebox(0, 0, 0, 0)); theme->set_icon("increment", "TabContainer", icons["scroll_button_right"]); theme->set_icon("increment_highlight", "TabContainer", icons["scroll_button_right_hl"]); |