From a92d15fe300f589041965f063c1a062ca86309bb Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Wed, 19 May 2021 10:09:40 +0200 Subject: [PATCH] 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. --- data/core/rootview.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/core/rootview.lua b/data/core/rootview.lua index 17bb7c77..7cdc78cb 100644 --- a/data/core/rootview.lua +++ b/data/core/rootview.lua @@ -466,9 +466,9 @@ end function Node:target_tab_width() - local tabs_number = self:get_visible_tabs_number() - local sbw = get_scroll_button_width() - return math.min(style.tab_width, (self.size.x - sbw * 2) / tabs_number) + local n = self:get_visible_tabs_number() + local w = self.size.x - get_scroll_button_width() * 2 + return common.clamp(style.tab_width, w / config.max_tabs, w / n) end