1
0
Fork 0

Always pick widest style as min width between unselected and hovered in `TabBar`

This commit is contained in:
Michael Alexsander 2025-01-14 12:13:04 -03:00
parent a69ccee151
commit e33a95f6ab
No known key found for this signature in database
GPG Key ID: A9C91EE110F4EABA
1 changed files with 2 additions and 2 deletions

View File

@ -1488,8 +1488,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;