From e2fcc41b4a2ff30a67d8a6aeb59133bdce79ebe1 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Sat, 15 May 2021 14:17:36 +0200 Subject: [PATCH] Ensure tabs don't extend beyond window's width --- data/core/rootview.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/core/rootview.lua b/data/core/rootview.lua index 5664c08f..4cf50b55 100644 --- a/data/core/rootview.lua +++ b/data/core/rootview.lua @@ -278,7 +278,8 @@ end function Node:get_tab_rect(idx) - local tw = math.min(style.tab_width, math.ceil(self.size.x / #self.views)) + local twp = math.floor((self.size.x - style.padding.x) / #self.views + 0.5) + local tw = math.min(style.tab_width, twp) local h = style.font:get_height() + style.padding.y * 2 return self.position.x + (idx-1) * tw, self.position.y, tw, h end