Size: settle the focus underline on one thickness (#15988)

This commit is contained in:
Igor Velkov authored and GitHub committed 2026-09-03 09:50:17 +02:00
1 parent 2b19472a55
commit 64dfa3102b
4 files changed
+7 -5

No files matched your search

+4 -2
View File
@@ -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 = {
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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