From 55a4d6fd1fd82a7f42b6aabb945528475ac6f831 Mon Sep 17 00:00:00 2001 From: poire-z Date: Tue, 17 Aug 2021 15:44:21 +0200 Subject: [PATCH] Button: avoid cut words when switching to multilines Followup to 954ba960 --- frontend/ui/widget/button.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/ui/widget/button.lua b/frontend/ui/widget/button.lua index 76f732a7f..e565a2f3d 100644 --- a/frontend/ui/widget/button.lua +++ b/frontend/ui/widget/button.lua @@ -109,7 +109,11 @@ function Button:init() bold = self.text_font_bold, face = Font:getFace(self.text_font_face, font_size_2_lines) } - break + if not self.label_widget.has_split_inside_word then + break + end + -- No good wrap opportunity (split inside a word): ignore this TextBoxWidget + -- and go on with a TextWidget with the smaller font size end if new_size < 8 then -- don't go too small break