RadioMark: down shift (#8771)

This commit is contained in:
hius07
2022-02-04 06:08:07 +02:00
committed by GitHub
parent cb7e670c4a
commit 12344261f0

View File

@@ -11,6 +11,9 @@ local RadioMark = InputContainer:new{
face = Font:getFace("smallinfofont"),
baseline = 0,
_mirroredUI = BD.mirroredUILayout(),
-- round radio mark looks a little bit higher than the button/menu text
-- default vertical down shift ratio (to the text height) looks good in touchmenu
v_shift_ratio = 0.03,
}
function RadioMark:init()
@@ -21,6 +24,7 @@ function RadioMark:init()
para_direction_rtl = self._mirroredUI,
}
self.baseline = widget:getBaseline()
widget.forced_baseline = self.baseline + math.floor(widget:getSize().h * self.v_shift_ratio)
self[1] = widget
self.dimen = widget:getSize()
end