From 64dfa3102b136fce9c991d2567ec73ef8a4a85ce Mon Sep 17 00:00:00 2001 From: Igor Velkov <325961+iav@users.noreply.github.com> Date: Thu, 3 Sep 2026 10:50:17 +0300 Subject: [PATCH] Size: settle the focus underline on one thickness (#15988) --- frontend/ui/size.lua | 6 ++++-- frontend/ui/widget/menu.lua | 2 +- frontend/ui/widget/touchmenu.lua | 2 +- plugins/coverbrowser.koplugin/listmenu.lua | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/ui/size.lua b/frontend/ui/size.lua index cd5467e64..acc05465b 100644 --- a/frontend/ui/size.lua +++ b/frontend/ui/size.lua @@ -64,9 +64,11 @@ local Size = { thin = Screen:scaleBySize(0.5), medium = Screen:scaleBySize(1), thick = Screen:scaleBySize(1.5), - -- 5 px reads at a glance where scaleBySize maps one to one; - -- denser screens get a similar relative weight out of 3. + -- Underline under a focused mosaic cover. focus_indicator = Screen:scaleBySize(Screen:getDPI() < 200 and 5 or 3), + -- Underline under a focused row, thicker below 200 DPI so that it stands apart from + -- the separators around it. + focus_row = Screen:scaleBySize(Screen:getDPI() < 200 and 5 or 1.5), progress = Screen:scaleBySize(7), }, item = { diff --git a/frontend/ui/widget/menu.lua b/frontend/ui/widget/menu.lua index 301dc22b5..580572a16 100644 --- a/frontend/ui/widget/menu.lua +++ b/frontend/ui/widget/menu.lua @@ -425,7 +425,7 @@ function MenuItem:init() self._underline_container = UnderlineContainer:new{ color = self.line_color, linesize = self.linesize, - focus_linesize = Size.line.focus_indicator, + focus_linesize = Size.line.focus_row, -- With text_bgcolor the row has a coloured frame behind its text only, so no -- single colour erases the focus bar over the whole width; without background -- set, such a row falls back to the stock full repaint. diff --git a/frontend/ui/widget/touchmenu.lua b/frontend/ui/widget/touchmenu.lua index f2bde4434..6097024fe 100644 --- a/frontend/ui/widget/touchmenu.lua +++ b/frontend/ui/widget/touchmenu.lua @@ -147,7 +147,7 @@ function TouchMenuItem:init() self._underline_container = UnderlineContainer:new{ vertical_align = "center", - focus_linesize = Size.line.focus_indicator, + focus_linesize = Size.line.focus_row, background = Blitbuffer.COLOR_WHITE, dimen = self.dimen:copy(), line_width = self.item_frame:getSize().w, -- we'll draw a shorter line diff --git a/plugins/coverbrowser.koplugin/listmenu.lua b/plugins/coverbrowser.koplugin/listmenu.lua index 10cac7a64..83e984d13 100644 --- a/plugins/coverbrowser.koplugin/listmenu.lua +++ b/plugins/coverbrowser.koplugin/listmenu.lua @@ -115,7 +115,7 @@ function ListMenuItem:init() h = self.height }, linesize = self.underline_h, - focus_linesize = Size.line.focus_indicator, + focus_linesize = Size.line.focus_row, -- widget : will be filled in self:update() } self[1] = self._underline_container