Skip to content

Commit

Permalink
Always pick widest style as min width between unselected and hovered …
Browse files Browse the repository at this point in the history
…in `TabBar`

(cherry picked from commit e33a95f)
  • Loading branch information
YeldhamDev authored and Spartan322 committed Jan 18, 2025
1 parent d2be04d commit 9030601
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/gui/tab_bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1481,8 +1481,8 @@ int TabBar::get_tab_width(int p_idx) const {
style = theme_cache.tab_disabled_style;
} else if (current == p_idx) {
style = theme_cache.tab_selected_style;
// Use the unselected style's width if the hovered one is shorter, to avoid an infinite loop when switching tabs with the mouse.
} else if (hover == p_idx && theme_cache.tab_hovered_style->get_minimum_size().width >= theme_cache.tab_unselected_style->get_minimum_size().width) {
// Always pick the widest style between hovered and unselected, to avoid an infinite loop when switching tabs with the mouse.
} else if (theme_cache.tab_hovered_style->get_minimum_size().width > theme_cache.tab_unselected_style->get_minimum_size().width) {
style = theme_cache.tab_hovered_style;
} else {
style = theme_cache.tab_unselected_style;
Expand Down

0 comments on commit 9030601

Please sign in to comment.