From 3639c3e7c6060990a945e4a2113343dc0f46aa3f Mon Sep 17 00:00:00 2001 From: poire-z Date: Mon, 23 Oct 2017 23:17:52 +0200 Subject: [PATCH] [UX] Fix dict title width to not go over CloseButton (#3414) --- frontend/ui/widget/dictquicklookup.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/ui/widget/dictquicklookup.lua b/frontend/ui/widget/dictquicklookup.lua index 99d60833d..a4d1cf803 100644 --- a/frontend/ui/widget/dictquicklookup.lua +++ b/frontend/ui/widget/dictquicklookup.lua @@ -188,6 +188,7 @@ function DictQuickLookup:update() self.height = math.min(self.region.h*0.7, Screen:getHeight()*0.5) end -- dictionary title + local close_button = CloseButton:new{ window = self, padding_top = self.title_margin, } local dict_title_text = TextWidget:new{ text = self.dictionary, face = self.title_face, @@ -415,8 +416,10 @@ function DictQuickLookup:update() h = self.dict_title:getSize().h }, self.dict_title, - CloseButton:new{ window = self, padding_top = self.title_margin, }, + close_button, } + -- Fix dict title max width now that we know the final width + dict_title_text.width = self.dict_bar.dimen.w - close_button:getSize().w self.dict_frame = FrameContainer:new{ radius = Size.radius.window,