From 18de4552e2313a902b9448432dfd6802b47d3d56 Mon Sep 17 00:00:00 2001 From: rxi Date: Wed, 3 Jun 2020 13:34:10 +0100 Subject: [PATCH] Made tab's text left-aligned if wider than the tab --- data/core/rootview.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/core/rootview.lua b/data/core/rootview.lua index 0b50566..389525f 100644 --- a/data/core/rootview.lua +++ b/data/core/rootview.lua @@ -349,7 +349,9 @@ function Node:draw_tabs() color = style.text end core.push_clip_rect(x, y, w, h) - common.draw_text(style.font, color, text, "center", x, y, w, h) + x, w = x + style.padding.x, w - style.padding.x * 2 + local align = style.font:get_width(text) > w and "left" or "center" + common.draw_text(style.font, color, text, align, x, y, w, h) core.pop_clip_rect() end