TabContainer bottom position

This commit is contained in:
kit
2023-09-27 17:23:22 -04:00
parent 89cc635c05
commit f6a212837b
5 changed files with 112 additions and 36 deletions

View File

@@ -516,7 +516,13 @@ void TabBar::_draw_tab(Ref<StyleBox> &p_tab_style, Color &p_font_color, int p_in
bool rtl = is_layout_rtl();
Rect2 sb_rect = Rect2(p_x, 0, tabs[p_index].size_cache, get_size().height);
if (tab_style_v_flip) {
draw_set_transform(Point2(0.0, p_tab_style->get_draw_rect(sb_rect).size.y), 0.0, Size2(1.0, -1.0));
}
p_tab_style->draw(ci, sb_rect);
if (tab_style_v_flip) {
draw_set_transform(Point2(), 0.0, Size2(1.0, 1.0));
}
if (p_focus) {
Ref<StyleBox> focus_style = theme_cache.tab_focus_style;
focus_style->draw(ci, sb_rect);
@@ -1367,6 +1373,10 @@ bool TabBar::get_clip_tabs() const {
return clip_tabs;
}
void TabBar::set_tab_style_v_flip(bool p_tab_style_v_flip) {
tab_style_v_flip = p_tab_style_v_flip;
}
void TabBar::move_tab(int p_from, int p_to) {
if (p_from == p_to) {
return;