[InfoMessage] stop force_one_line if font is too small#13337
Conversation
| end | ||
| end | ||
| if self.force_one_line and orig_size < self._initial_orig_size * 0.7 then | ||
| -- Do not reduce the font size by more than 30 percent, at around orig_size 15 or 16 (30% of defualt font size), our font is too small |
There was a problem hiding this comment.
I must admit that it took me quite a while to find where the typo was, ;)
|
I agree some minimal font size (like we have a few around, i remember in CoverBrowser I set some when reducing title or authors) feels better than a random % made from what's ok with the default font size). (Even if |
| if self.force_one_line and orig_font == "xx_smallinfofont" and orig_size < 16 then | ||
| -- Do not reduce the font size any longer, at around this point, our font is too small for the max_height check to be useful |
There was a problem hiding this comment.
Just pick a min size - no matter the font name or nickname.
In other places we go smaller than 16 - but up to you for this "feature".
koreader/frontend/ui/widget/infomessage.lua
Line 196 in 316eb87
koreader/plugins/coverbrowser.koplugin/listmenu.lua
Lines 591 to 594 in 316eb87
There was a problem hiding this comment.
okay, in this feature, (note the missing " ") going below means the box trick stops working because two lines of text at those small sizes are still less than the height of icon_heinght. so it makes no sense to continue reducing the font if we know the check no longer makes sense.
what's new
frontend/ui/widget/infomessage.lua: Added logic to store the original font and size whenforce_one_lineis enabled, preventing excessive font size reduction.frontend/ui/widget/infomessage.lua: Implemented a condition to stop reducing the font size by more than 30 percent and reset to the original font and size if necessary.related to #13107
This change is