diff --git a/frontend/ui/size.lua b/frontend/ui/size.lua index ddb648583..5e968cfd2 100644 --- a/frontend/ui/size.lua +++ b/frontend/ui/size.lua @@ -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 = { diff --git a/plugins/coverbrowser.koplugin/mosaicmenu.lua b/plugins/coverbrowser.koplugin/mosaicmenu.lua index d7e253823..34b35946a 100644 --- a/plugins/coverbrowser.koplugin/mosaicmenu.lua +++ b/plugins/coverbrowser.koplugin/mosaicmenu.lua @@ -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