minor: adjust kvpage and dictlookup for new closebutton

pull/1873/head
Qingping Hou 8 years ago
parent 34e0238b6f
commit 10ded583b9

@ -126,7 +126,7 @@ function DictQuickLookup:update()
text = self.dictionary, text = self.dictionary,
face = self.title_face, face = self.title_face,
bold = true, bold = true,
width = self.width - self.button_padding, width = self.width,
} }
} }
-- lookup word -- lookup word
@ -218,7 +218,10 @@ function DictQuickLookup:update()
} }
self.dict_bar = OverlapGroup:new{ 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, self.dict_title,
} }

@ -77,6 +77,7 @@ function KeyValueTitle:init()
else else
show_title_txt = self.title show_title_txt = self.title
end end
-- title and close button
table.insert(self, OverlapGroup:new{ table.insert(self, OverlapGroup:new{
dimen = { w = self.width }, dimen = { w = self.width },
TextWidget:new{ TextWidget:new{
@ -85,12 +86,14 @@ function KeyValueTitle:init()
}, },
self.close_button, self.close_button,
}) })
-- page count and separation line
self.page_cnt = FrameContainer:new{ self.page_cnt = FrameContainer:new{
padding = 4, padding = 4,
margin = 0, margin = 0,
bordersize = 0, bordersize = 0,
background = Blitbuffer.COLOR_WHITE, background = Blitbuffer.COLOR_WHITE,
overlap_offset = {0, -18}, -- overlap offset x will be updated in setPageCount method
overlap_offset = {0, -15},
TextWidget:new{ TextWidget:new{
text = "", -- page count text = "", -- page count
fgcolor = Blitbuffer.COLOR_GREY, fgcolor = Blitbuffer.COLOR_GREY,
@ -117,8 +120,7 @@ function KeyValueTitle:setPageCount(curr, total)
return return
end end
self.page_cnt[1]:setText(curr .. "/" .. total) self.page_cnt[1]:setText(curr .. "/" .. total)
self.page_cnt.overlap_offset[1] = (self.width - self.page_cnt:getSize().w self.page_cnt.overlap_offset[1] = (self.width - self.page_cnt:getSize().w - 10)
- self.close_button:getSize().w)
self.title_bottom[2] = self.page_cnt self.title_bottom[2] = self.page_cnt
end end

Loading…
Cancel
Save