[chore, fix, UX] UI sizes unification and refactoring#3203
[chore, fix, UX] UI sizes unification and refactoring#3203Frenzie merged 4 commits intokoreader:masterfrom
Conversation
That means that it's finally scaling as it should. To make them smaller one should look in TouchMenu or possibly IconButton imo. This video review recently drew my attention to this issue, although of course I've always been aware that the buttons are a lot smaller on my H2O than on most other devices: https://www.youtube.com/watch?v=i2oSOeAnD10 But on the One it starts to verge into too small territory. Edit: I actually like the size on my H2O, which is quite a bit smaller than the originally intended size.
Look familiar? That's also why the emulator defaults to what it does. ;-) |
|
Quoting @poire-z
I too prefer it more like this (screenshot from my H2O). |
|
OK, I get it, you're just doing "scaling for dpi" rightly. But Not sure about my current feeling: most people, like me, will get surprised with bigger buttons. |
|
Btw, which device (+resolution) do you have? I'm thinking that if we simply stick something like a FrameContainer with some padding around the image (not yet sure whether in TouchMenu or IconButton), we can simply size it down to roughly how it looks on a Kobo Aura or a Kobo Aura HD without giving up on the extra touch space. Incidentally, here's a link to relevant Android info for icons: https://developer.android.com/guide/practices/screens_support.html#qualifiers
The idea being that you generate icons in those sizes and then you scale down from the nearest one. |
|
(Glo HD: 1072 x 1448 , 300 dpi.) |
f7ee6b9 to
84e6603
Compare
|
Mentionning it here: May be it's a question of habbit, and I could get used to the bigger borders, but I kinda dislike them :) Too thick = feel like some kid's toy. Personally, when chosing sizes for my devs, I of course code on the emulator, but check and tweak in the end the look on my kobo. Dunno if others do the same, but, may be, if there is any absolute size that needs to be scaleBySize()'ed, may be it should be adjusted a bit lower than the original size (so scaleBySize() gets it back near the original value) ? |
Are there any that I missed in this PR?
Only the output needs to be an integer number of pixels; the input can be a float. I suspect you would like |
Many (with different values, 0, 1, 2, 3)... But those that I saw with the latest nightly are just those that inherit the FrameContainer bordersize (changed from 2 to scaleBySize(2) in #3194). But I feel no problem with the previous border sizes :)
1.5 looks fine on the emulator. Can't check how it looks on kobo before this evening. |
I don't see this PR as deciding anything. It's just fixing a few long-standing bugs. :-) Edit: ah yes, something like |
df3893c to
11b3069
Compare
|
1.5 looks ~ok on my Kobo (I'm sensitive to change :) so it's not a full OK! but I guess I could get used to that).
Well, by adding and use them directly in the widgets, so confirmbox, infomessage... would all use MODAL_OUTSIDE_*, so they would have a similar look. |
Everything will finally look how it's supposed to look. And let me be clear: I'm not always the biggest fan of how it's supposed to look.
Yes, that's one of the stretch goals. Kind of like the fonts in #2814. There are still a few remaining That being said, why should these be different at all? MODAL_OUTSIDE_BORDER = scaleBySize(1.5)
NOTIFICATION_BORDER = scaleBySize(1)Now that I've got all the problem areas tagged in this series of commits it's a lot easier to gain an overview of the whole shebang. I suppose I can do it all as one PR. |
We currently have some bordersize =1, 2, 3. I'm not sure the people who chose to put there 1, 2 or 3 really though the one they choose among 1, 2 or 3 was the one fitting in their context.
Personal feeling :) (I could get used to border=3 for real middle-of-the-screen modals like confirmbox and infomessage on my kobo, but it still looked too thick for the notification with 3 or 4 words in it at top of screen - edit: or may be it just need its padding=5 scaleBySized too). Anyway, I'll be more willing to adapt to any change if it's due to some thought rules (even if i disagree with them), than just to scaleBySize(what was already there). |
I don't mean "why should they be different than whatever they currently are" but rather "why should window border sizes be different than each other, these two in particular, but probably period." |
11b3069 to
d706851
Compare
| function ListMenu:_updateItemsBuildUI() | ||
| -- Build our list | ||
| -- We separate items with a 1px LineWidget (no need for | ||
| -- scaleBySize, thin is fine) |
There was a problem hiding this comment.
Really ?!
I made some esthetic choices (which can be disagreed), added a comment explaining it, and you're making it a 2px width now on most devices,, and removing the comment, as part of this scaleBySize campaign ? :|
There was a problem hiding this comment.
At 600 DPI it's not a design choice but a bug. I would've changed it to 0.5 but right now this merely functions as a tag for the next step. ;-)
There was a problem hiding this comment.
More concretely, this'll become something like your proposed ui.elements.commonui.THIN_LINE = scaleBySize(0.5) property.
| margin = 0, | ||
| padding = 0, | ||
| bordersize = 1, | ||
| bordersize = Screen:scaleBySize(1), |
6db11ab to
c2720f3
Compare
|
@poire-z I've pushed a Size module proposal. Are there any objections or suggestions pertaining to the architecture I have in mind before I get started? |
|
I don't think Size.border -- returns defaultis possible. Lua evaluates the stuff from left to right, so I don't think a metatable.__index function could know that another thing is going to be evaluated on the right by the time it has to decide what to do with Size.border. But sure, having to explicitly specify Size.border.defaultis probably much simpler and preferable. When you put it like that, I'm not even sure why I bothered writing that much more complicated function. Perhaps mainly because it was fun. :-P (Maybe |
Wait, what do you mean by that exactly? If you mean Size.border.supercalifragilisticexpialidociousThen it'd probably be trivial to print a logger.warn("The Spanish grain did not stand", k)But would there be any upside in doing that? |
|
Thought the main reason for your code was that |
|
Well no, the point is the opposite (debug guard forced crash rather than regular mode nil) :p Not entirely sure if I can sensibly implement that in metatable but it may not be too important. |
|
@poire-z I do believe this to be quite a bit more elegant. Thank you. if dbg.is_on then
local logger = require("logger")
local mt = {
__index = function(t, k)
local prop_value = rawget(t, k)
local prop_exists = prop_value ~= nil
if not prop_exists then logger.warn("Size: this property does not exist:", k) end
assert(prop_exists)
return prop_value
end
}
setmetatable(Size, mt)
for el, _ in pairs(Size) do
setmetatable(Size[el], mt)
end
end |
ed905c1 to
2a95b3f
Compare
|
Indeed :) (and a first time for me to see the how and why of using setmetatable) |
|
TimeVal that we looked at the other day has some pretty fancy metatable stuff going on. :-P Actually I've been vaguely curious to see if there's any performance difference in how the widgets are constructed. We do stuff like this: local MultiConfirmBox = InputContainer:new{
modal = true,
-- yada yada
}But it'll also work like this: local MultiConfirmBox = {
modal = true,
--yada yada
}
setmetatable(MultiConfirmBox, {__index = InputContainer})Then it'll look in InputContainer for any property it doesn't have. |
3210782 to
1a9cdbf
Compare
ff07ef1 to
9cf504a
Compare
As pointed out by @poire-z * [fix, UX] SkimToWidget scaling * [fix] Button scaling * [fix, UX] Scale ProgressWidget * [fix, UX] Scale confirmbox * [fix, UX] Scale just about everything
d580b47 to
59d72fe
Compare
|
@poire-z This is basically finished but it'd be nice if you could take a quick look. |
I don't think you're quite right about "most devices" but insofar as they were legacy values from the early Kindle days that would be a logical result of the bug fix on your 300 DPI Kobo Aura I-forget-which and on my ~265 DPI H2O.
They are, but I think I'd still rather see such a big visual change as a separate PR than as part of this bug fix. Btw, what would be the proper way to scale these images in ImageWidget? 'cause right now the assumption is that 64x64 at 800x600-ish (~160 DPI) is the proper size, but basically you and I want 64x64 to be the size at something closer to 250-300 DPI, which means downscaling to 40x40 (same for InfoMessage). But if I'm not mistaken, something as simple as passing scaleBySize(40) won't take aspect ratio into account. Now I think all of our icons are square, but still…
The funny thing about your remark is that it should actually be 3. :-P But yes, I'd like probably all borders to be thinner myself.
Not really sure what you mean.
I dislike them, and as indicated above I still think think it's besides the point. :-P These things should be torpedoed as far as I'm concerned, probably to be replaced by some very regular → type arrows. But like I said, I don't want to make a bug fix PR into a more contentious PR that actually changes things. Just look at your reaction to the one actual change I stuck in there. :-P (I consider getting rid of all such typographical abuses bug fixes as well, but the specific way to go is less obvious and more open to interpretation.) Did you give some of the related symbols a try? E.g., ◁◁ ▷▷, ◅◅ ▻▻. |
It's a bug if you consider "all things should scale" a requirement :) (which may be it was and is, but it wasn't implemented fully, and that bug didn't feel like one). There may be a few that don't need to scale linearly.
Dunno, I suck at DPI arithmetic. With that fact known and forgiven :) I would go that way:
By inkblot: when the 4px border happens to align with the baseline of the book text, it appears (like it does a bit on the screenshots above) like they melt, and that the border is not a straight line with a fixed stroke size and was drawn with a bad pencil without a ruler... (may depend on font size, but I never had that feeling when borders were 2 px or 3 px).
◁ and ▷ look indeed nicer, their weight goes better with the weight of text in other buttons (but they may still have a bit too much height). But no real other alternative arrows available in Noto Sans. |
|
Alright, I'll stick in the other arrows and merge this. Feel free to start proposing any changes immediately in PRs as I don't yet have anything concrete lined up.
It is. One of the biggest crimes perpetrated in present-day GUIs from Apple to Microsoft to GNOME is this odd notion that all interface elements should scale equally. The only reason I had such ridiculously large fonts in the taskbar and menus and such was that otherwise it would be illegible. On the UHD monitor I've had since 2014 I've been using my GUI fonts as ever so slightly larger (let's say 1.4-1.5) and content fonts at 2x. That looks like this:
I prefer to call it reasonable DPI. We've been suffering low DPI; now we have reasonable DPI. ;-) https://techcrunch.com/2017/05/25/feast-your-eyes-on-this-600-dpi-e-paper-screen/ |
000199a to
b9f82a0
Compare













See #3194 (comment)
@poire-z I get what looks like good results by removing the flooring.
Before
After
Custom DPI "high"
Doesn't look too shabby with a custom DPI either, although it has some beauty flaws (not the ImageWidget, but the GUI in general).
Custom DPI 600
600 is the maximum. If there is a maximum it should be 1200 imo, but that aside. Of course it all depends on the device.