mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Better vertical centering of text in its box
Decide baseline vertical position according to font metrics, instead of the hardcoded 0.7 (in textwidget, which made the text a little bit up in its box), and 0.75 (in toggleswitch, which made the text a little bit down in its box). This usually gives a value around 0.72 or 0.73 with our ui fonts, which looks about right. ReaderFooter: add bottom padding, now that our text goes a few pixels lower
This commit is contained in:
@@ -116,6 +116,7 @@ local ReaderFooter = WidgetContainer:extend{
|
||||
height = Screen:scaleBySize(DMINIBAR_CONTAINER_HEIGHT),
|
||||
horizontal_margin = Screen:scaleBySize(10),
|
||||
text_left_margin = Screen:scaleBySize(10),
|
||||
bottom_padding = Screen:scaleBySize(1),
|
||||
settings = {},
|
||||
-- added to expose them to unit tests
|
||||
textGeneratorMap = footerTextGeneratorMap,
|
||||
@@ -186,6 +187,7 @@ function ReaderFooter:init()
|
||||
background = Blitbuffer.COLOR_WHITE,
|
||||
bordersize = 0,
|
||||
padding = 0,
|
||||
padding_bottom = self.bottom_padding,
|
||||
}
|
||||
self.footer_container = BottomContainer:new{
|
||||
dimen = Geom:new{ w = 0, h = self.height*2 },
|
||||
|
||||
Reference in New Issue
Block a user