From 10ded583b9270c5c76c023bb9a52c7df0ee1855d Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sun, 6 Mar 2016 22:41:17 -0800 Subject: [PATCH] minor: adjust kvpage and dictlookup for new closebutton --- frontend/ui/widget/dictquicklookup.lua | 7 +++++-- frontend/ui/widget/keyvaluepage.lua | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/ui/widget/dictquicklookup.lua b/frontend/ui/widget/dictquicklookup.lua index 242ad32f1..cdbb0c5e5 100644 --- a/frontend/ui/widget/dictquicklookup.lua +++ b/frontend/ui/widget/dictquicklookup.lua @@ -126,7 +126,7 @@ function DictQuickLookup:update() text = self.dictionary, face = self.title_face, bold = true, - width = self.width - self.button_padding, + width = self.width, } } -- lookup word @@ -218,7 +218,10 @@ function DictQuickLookup:update() } self.dict_bar = OverlapGroup:new{ - dimen = {w = button_table:getSize().w, h = self.dict_title:getSize().h}, + dimen = { + w = button_table:getSize().w + self.button_padding, + h = self.dict_title:getSize().h + }, self.dict_title, } diff --git a/frontend/ui/widget/keyvaluepage.lua b/frontend/ui/widget/keyvaluepage.lua index caaf91660..1774133b1 100644 --- a/frontend/ui/widget/keyvaluepage.lua +++ b/frontend/ui/widget/keyvaluepage.lua @@ -77,6 +77,7 @@ function KeyValueTitle:init() else show_title_txt = self.title end + -- title and close button table.insert(self, OverlapGroup:new{ dimen = { w = self.width }, TextWidget:new{ @@ -85,12 +86,14 @@ function KeyValueTitle:init() }, self.close_button, }) + -- page count and separation line self.page_cnt = FrameContainer:new{ padding = 4, margin = 0, bordersize = 0, background = Blitbuffer.COLOR_WHITE, - overlap_offset = {0, -18}, + -- overlap offset x will be updated in setPageCount method + overlap_offset = {0, -15}, TextWidget:new{ text = "", -- page count fgcolor = Blitbuffer.COLOR_GREY, @@ -117,8 +120,7 @@ function KeyValueTitle:setPageCount(curr, total) return end self.page_cnt[1]:setText(curr .. "/" .. total) - self.page_cnt.overlap_offset[1] = (self.width - self.page_cnt:getSize().w - - self.close_button:getSize().w) + self.page_cnt.overlap_offset[1] = (self.width - self.page_cnt:getSize().w - 10) self.title_bottom[2] = self.page_cnt end