Use all the available space for tabs

Use a tab's width larger than style.tab_width if there is enough
available space to display the number of tabs specified in
config.max_tabs.
This commit is contained in:
Francesco Abbate 2021-05-19 10:09:40 +02:00
parent ca05562cc0
commit a92d15fe30
1 changed files with 3 additions and 3 deletions

View File

@ -466,9 +466,9 @@ end
function Node:target_tab_width() function Node:target_tab_width()
local tabs_number = self:get_visible_tabs_number() local n = self:get_visible_tabs_number()
local sbw = get_scroll_button_width() local w = self.size.x - get_scroll_button_width() * 2
return math.min(style.tab_width, (self.size.x - sbw * 2) / tabs_number) return common.clamp(style.tab_width, w / config.max_tabs, w / n)
end end