diff options
Diffstat (limited to 'scene/gui/tab_container.cpp')
-rw-r--r-- | scene/gui/tab_container.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 98a8db336e..6e50614e8f 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -264,9 +264,9 @@ void TabContainer::_notification(int p_what) { if (popup) { x -= menu->get_width(); if (mouse_x_cache > x) - menu_hl->draw(get_canvas_item(), Size2(x, 0)); + menu_hl->draw(get_canvas_item(), Size2(x, (header_height - menu_hl->get_height()) / 2)); else - menu->draw(get_canvas_item(), Size2(x, 0)); + menu->draw(get_canvas_item(), Size2(x, (header_height - menu->get_height()) / 2)); } // Draw the navigation buttons. @@ -367,7 +367,7 @@ void TabContainer::add_child_notify(Node *p_child) { current = 0; previous = 0; } - c->set_area_as_parent_rect(); + c->set_anchors_and_margins_preset(Control::PRESET_WIDE); if (tabs_visible) c->set_margin(MARGIN_TOP, _get_top_margin()); Ref<StyleBox> sb = get_stylebox("panel"); @@ -401,7 +401,7 @@ void TabContainer::set_current_tab(int p_current) { Control *c = tabs[i]; if (i == current) { c->show(); - c->set_area_as_parent_rect(); + c->set_anchors_and_margins_preset(Control::PRESET_WIDE); if (tabs_visible) c->set_margin(MARGIN_TOP, _get_top_margin()); c->set_margin(Margin(MARGIN_TOP), c->get_margin(Margin(MARGIN_TOP)) + sb->get_margin(Margin(MARGIN_TOP))); |