[CoverBrowser.MosaicMenu] Increase focus underline thickness (#12189)

This commit is contained in:
David
2024-08-05 09:19:16 +01:00
committed by GitHub
parent 949b996ad7
commit 3992438872
2 changed files with 11 additions and 5 deletions

View File

@@ -64,6 +64,7 @@ local Size = {
thin = Screen:scaleBySize(0.5),
medium = Screen:scaleBySize(1),
thick = Screen:scaleBySize(1.5),
focus_indicator = Screen:scaleBySize(5),
progress = Screen:scaleBySize(7),
},
item = {

View File

@@ -408,19 +408,24 @@ function MosaicMenuItem:init()
-- for compatibility with keyboard navigation
-- (which does not seem to work well when multiple pages,
-- even with classic menu)
self.underline_h = 1 -- smaller than default (3), don't waste space
local underline_h = Size.line.focus_indicator
local underline_padding = Size.padding.tiny
self._underline_container = UnderlineContainer:new{
vertical_align = "top",
padding = 0,
padding = underline_padding,
dimen = Geom:new{
x = 0, y = 0,
w = self.width,
h = self.height
h = self.height + underline_h + underline_padding,
},
linesize = self.underline_h,
linesize = underline_h,
-- widget : will be filled in self:update()
}
self[1] = self._underline_container
-- (This MosaicMenuItem will be taller than self.height, but will be put
-- in a Container with a fixed height=item_height, so it will overflow it
-- on the bottom, in the room made by item_margin=Screen:scaleBySize(10),
-- so we should ensure underline_h + underline_padding stays below that.)
-- Remaining part of initialization is done in update(), because we may
-- have to do it more than once if item not found in db
@@ -435,7 +440,7 @@ function MosaicMenuItem:update()
local dimen = Geom:new{
w = self.width,
h = self.height - self.underline_h
h = self.height,
}
-- We'll draw a border around cover images, it may not be