Open alt-tosc opened 3 years ago
Hey, sorry I am currently working on fidget 2 - the complete rewrite. I don't know if I will be doing anything with fidget 1.
I want this to connect with scrollBars it seems like you went for a more complex system scroll system.
I think the speed of the scroll should depend OS not user setting? I don't know how to get that though.
Hello, I'm curious and I can't wait for your new implementation to be published :)
I have a lot to say so I'll add numbers to ease replies:
I want this to connect with scrollBars it seems like you went for a more complex system scroll system.
I also tried to connect this to some scrollBars, I've considered the approach of scrollbars drawn as Fidget nodes. With this approach I see two advantages:
With what I propose in this PR I have mixed feelings about scrollSpeed which is set at the level of the child node:
computeLayout
which also seems a bad idea.I think the speed of the scroll should depend OS not user setting? I don't know how to get that though.
I've just done a little experiment (I work on Gnome desktop): when I change scroll setting to "natural scroll", the change is reflected on the input given to the callback proc onScroll(window: staticglfw.Window, xoffset, yoffset: float64)
set by window.setScrollCallback(onScroll)
. I don't have settings in Gnome to change scroll speed (and from a quick search it seems complicated to change on Linux desktops).
It will probably be a good practice to not change the scrollSpeed inside Fidget and let by default scrollSpeed=1. But as mentioned earlier in point 2, scrollSpeed at the level of child node gives some interesting flexibility.
In some applications (like in browsers) I have the feeling the scroll speed is not linear with respect to the 'wheel displacement'. Also scrolling does not stop immediately at the end the 'wheel displacement'. But I suppose this could be added in a further iteration.
Let me know if I can help, even If I'm not the most qualified for this, I will have some free time in the next few weeks ;)
Dear treeform,
This merge request is related to https://github.com/treeform/fidget/issues/108.
I would like to have your review on this proposed implementation. All your feedbacks are welcome: I'm not used neither to Nim, nor to contribute to public open source projects on github.
Current changes summary:
scrollable
andscrollSpeed
attributes added to Node, and corresponding setters.minimal_scroll
example.Todo: