Font: unify font styling and KeyValuePage: improve looks#2814
Font: unify font styling and KeyValuePage: improve looks#2814houqp merged 3 commits intokoreader:masterfrom
Conversation
2d19b06 to
e890ae8
Compare
|
Couldn't we also decrease font size, and add some small margin to the page ? |
|
I'm personally fine with that but do note #2563. |
|
Yes indeed (dunno how that book status looks on kobo mini, if it's unreadable or if there's there some font adjusment depending on device screen). |
|
It did occur to me that I ever so slightly mismatched the font sizes and didn't even notice (I thought it was because it was bold). From font.lua: cfont = 24,
tfont = 26,The size @baskerville used was |
frontend/ui/widget/keyvaluepage.lua
Outdated
| if key_w >= value_w then | ||
| self.show_key = RenderText:truncateTextByWidth(self.key, self.cface, self.width-value_w) | ||
| self.show_value = self.value | ||
| local frame_padding = 8 |
There was a problem hiding this comment.
where is this magic number 8 coming from? If it's used somewhere else in this module, we should create a module global variable for it or reuse the same variable.
There was a problem hiding this comment.
From @poire-z's suggestion to add padding? That is, just from playing around with a few values.
There was a problem hiding this comment.
i see. We should use Screen:scaleBySize on raw numbers to make it consistent on different screen sizes.
frontend/ui/widget/keyvaluepage.lua
Outdated
| key = nil, | ||
| value = nil, | ||
| cface = Font:getFace("cfont"), | ||
| cface = Font:getFace("cfont", 22), |
There was a problem hiding this comment.
Font size should be wrapped by Screen:scaleBySize. And I suggest changing the default size in Font module so we get a consistent experience across the app.
There was a problem hiding this comment.
It shouldn't; that's done by getFace and if it weren't that's still where it should be done. ;-)
There was a problem hiding this comment.
Ha, good catch, I forgot Font module already does this internally ;)
|
Two nitpicks, the rest looks good to me. It looks much better after the patch 👍 |
Fixes koreader#2578. * key bolded * values normally left-aligned at 50% * allows misalignment for the sake of fitting everything on one line
328ebdb to
40321ff
Compare
8669694 to
b397712
Compare
b397712 to
1c47d73
Compare
1c47d73 to
a552c1a
Compare



Fixes #2578.
Before
After
Before
After
Before
After
Overflow
This change is thanks to @houqp, because otherwise I'd have spent my time on #2809 instead. ;-)