[UX] Smaller menu icons#3253
Conversation
| local spacing_width = (self.width - content_width)/(#self.icons*2) | ||
| local icon_padding = math.min(spacing_width, Screen:scaleBySize(20)) | ||
| self.height = tmp_ib:getSize().h + Screen:scaleBySize(10) | ||
| local icon_padding = math.min(spacing_width, Size.span.horizontal_default) |
There was a problem hiding this comment.
Would look fine (= as before) to me on kobo with a Size.span.horizontal_menuicons = scaleBySize(16) (instead of horizontal_default = Screen:scaleBySize(10))
There was a problem hiding this comment.
I thought 20 looked on the large side but I suppose half that might indeed be a bit small.
Should it be in Size? This seems like pretty much a one-off value to me. For the bottom menu perhaps?
There was a problem hiding this comment.
Dunno, depend if that same value plays well in the bottom menu too. Same for your icon_width = Screen:scaleBySize(40).
And if it happens it works as well on the InfoMessage icon and others alike, it may well fit in Size.
May be with a specific key (but it mess with your existing hierarchy padding > icons):
Size.icons = {
horizontal_pading = Screen:scaleBySize(16),
width = Screen:scaleBySize(40),
...
}|
I think that larger icons (before) are better. It will be easier to tap. |
|
My screenshots were a bit lazily executed and therefore deceptive. As @poire-z pointed out I should just keep the padding pretty much the way it is, with scaleBySize(16). Current Kobo Aura OneAfter Kobo Aura One (=actually larger icons, this time with padding 16) |
Actually, since a PR i made 1 or 2 weeks ago, they should already be easier to tap: you can now tap on the padding, the blank space in between them, and the nearest one should react. But I dunno, may be some people will actually like this big look. |
|
This feels right to me now (after the padding adjustment). And yes, while fairly insignificant on the surface, for me #3213 is one of the biggest improvements of the year. I hadn't even realized how often I occasionally mistapped. Edit:
We can do both. Merge this change for the top menu, keep the bottom menu as is (i.e., monstrous) for comparison. Edit 2: Alright, I merged it. Since this isn't a monster change it'll be easy to adjust if desired. :-) |
|
What about bottom menu (widget/configdialog.lua) ? :) |
|
I don't have anything prepared. Feel free to create a quick PR, or like I said in my edit we could keep it for the next nightly so it'd be easy for everyone to see the two sizes side by side. |
|
(no quick PR either from me this evening, so let's keep it) |
|
Indeed, the sizing down algorithm isn't exactly the nicest. I only "intended" the sized up icons to look suboptimal in the short term. |
|
Is there any chance to fix algorithm? Or maybe we should use unicode symbols instead of icons... |
|
Looks like the scaling is not done by mupdf... koreader/frontend/ui/widget/imagewidget.lua Line 137 in 88aba42 Even if one provides self.width and self.height = 40 to this, we get a bb of size 64x64. And the scaling is done with: koreader/frontend/ui/widget/imagewidget.lua Line 206 in 88aba42 which "uses very simple nearest neighbour scaling": https://github.com/koreader/koreader-base/blob/82d9eab8bae9e3e7737a01827362f9a063bd4a83/ffi/blitbuffer.lua#L763-L766 (I don't get why sometimes github includes the code snippet, and sometimes does not...) edit: mupdf may ignore the width and height given to the internal function we are using (except not may be for svg) |
|
@poire-z Thanks for the closer look. I misremembered and/or assumed incorrectly. In that case the fix should be rather simple, at least theoretically because I haven't looked at the how or what: get a scaled image out of MuPDF. MuPDF uses "an algorithm based on a Graphics Gem when downscaling images, and simple bilinear interpolation when magnifying images" (source).
Looks to me like the code snippets that work are from this repo and the ones that don't are from another (such as base). |
|
Simplest would be to implement bilinear or such in pure lua in ffi/blitbuffer.lua BB_mt.__index:scale(). |
Upstream MuPDF has changed around a bit there.
For some value of simple. I'm not sure if writing a half-performant bilinear interpolation filter is particularly simple, even setting aside future concerns. :-P
Cool, thanks. :-) |
|
If you guys could check for this koreader-base koreader/koreader-base#517 (2 lua files patchable manually in ffi/), if you actually get better icons at various sizes/dpi. |









This is to get discussion started but it does reflect my input.
Small screen before/after
Kobo Aura One before/after
Edited to add screenshots after @poire-z's comment.