Menu widget: title bar resize (#8603)

reviewable/pr8609/r1
hius07 2 years ago committed by GitHub
parent 3450290af9
commit da7ef64773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -666,10 +666,10 @@ function Menu:init()
-----------------------------------
-- start to set up widget layout --
-----------------------------------
local icon_size = Screen:scaleBySize(DGENERIC_ICON_SIZE * 0.8) -- left and right title buttons
local icon_size = Screen:scaleBySize(DGENERIC_ICON_SIZE * 0.6) -- left and right title buttons
local title_text_width = self.inner_dimen.w - 2 * Size.padding.large
self.menu_title = TextWidget:new{
face = Font:getFace("tfont"),
face = Font:getFace("smalltfont"),
text = self.title,
max_width = title_text_width - (Device:isTouchDevice() and 2 * icon_size or 0),
overlap_align = "center",
@ -701,7 +701,7 @@ function Menu:init()
end
self.menu_title_group = VerticalGroup:new{
align = "center",
VerticalSpan:new{width = self.header_padding},
VerticalSpan:new{width = Screen:scaleBySize(3)},
menu_title_container,
path_text_container,
}
@ -926,15 +926,15 @@ function Menu:init()
-- start to set up input event callback --
------------------------------------------
if Device:isTouchDevice() then
local button_padding = Screen:scaleBySize(8)
local button_padding = Screen:scaleBySize(11)
if self.has_extra_button then
self.extra_button = IconButton:new{
icon = self.extra_button_icon or "appbar.menu",
width = icon_size,
height = icon_size,
padding = button_padding,
padding_right = icon_size, -- extend button tap zone
padding_bottom = 0,
padding_right = 2 * icon_size, -- extend button tap zone
padding_bottom = icon_size,
overlap_align = "left",
callback = function() self:onExtraButtonTap() end,
hold_callback = function() self:onExtraButtonHold() end,
@ -947,8 +947,8 @@ function Menu:init()
width = icon_size,
height = icon_size,
padding = button_padding,
padding_left = icon_size, -- extend button tap zone
padding_bottom = 0,
padding_left = 2 * icon_size, -- extend button tap zone
padding_bottom = icon_size,
overlap_align = "right",
callback = function() self:onClose() end,
}

Loading…
Cancel
Save