-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Horizontal scroll for Tree #62744
Horizontal scroll for Tree #62744
Conversation
Maybe these 4 cases for up/down and left/right scrolling can be simplified by taking the core of the logic and putting it in a helper method that takes a scroll node and a direction (as 1 or -1)? I think that would reduce the chances to make a mistake if you need to modify this code in future. |
@YuriSizov That's a great idea! I'll take a look at that tomorrow! |
My immediate idea is: Will test it out tomorrow, as I'm now having dinner |
The existing code doesn't handle several directions at the same time, so that wouldn't be useful without other changes. But if you do implement it like that, then you don't need to pass the scroll nodes. You already have access to them from the class. I only suggested passing a scroll node reference so that both vertical and horizontal could be handled by the same helper. |
Thank you Though there is the pan gesture that scrolls both directions at once, though I don't have any input device for that currently so wouldn't be able to test it I was thinking of putting this function in ScrollBar so it could be used by Scroll Container and other classes as well But I'll see about adding that as a separate thing for convenience later now taht I thought about it |
181ba90
to
534fa12
Compare
There, unified scrolling into a helper function, and horizontal scrolling should now work on Tree as well I'll see if the uses of pan in scrolling like this is widespread enough to add a helper function possibly in Scroll Bar to unify this and make it easy to tweak, but unrelated to this so leaving it for later (Shouldn't write code late at night) |
d85456c
to
bf755aa
Compare
3109099
to
56d6536
Compare
56d6536
to
bed6589
Compare
@AThousandShips Please try not to push updates to your PR so much (over 20 times in 20 hours). Since you're still a first-time contributor the CI doesn't run automatically but otherwise it would and this would really hammer the CI runners unnecessarily. You can rebase when there are conflicts, or if a lot of time has passed and you suspect that some merged PRs might impact the behavior of your PR. |
@akien-mga Got it! Thank you for informing me, wasn't aware how the CI worked in that regard |
Thanks! And congrats for your first merged Godot contribution 🎉 |
Adds horizontal scroll WHEEL_LEFT/WHEEL_RIGHT support to Tree
Fixes proposals 4816