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

Loading…
Cancel
Save