Skip to content
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

Some Scrolling tweaks #729

Closed
wants to merge 4 commits into from
Closed

Some Scrolling tweaks #729

wants to merge 4 commits into from

Conversation

13r0ck
Copy link
Member

@13r0ck 13r0ck commented Feb 5, 2021

While all of the changes work well, I am quite new to Rust, and I imagine that many changes will have to be made for the code quality to meet the rest of the Iced code base.

3 things in this pull request:

  1. Adding scroll to pick_lists
    I think that this functionality for pick_lists should be expected. Just allows for selecting from a pick_list by scrolling over a closed pick_list. Though I am not confident with my code quality. It works reliably, but code is a mess. Please let me know how to improve it.

  2. Adding on_scroll functions to text_input
    I added on_scroll_up and on_scroll_down to Text_Inputs. I am not confident on implementation nor code quality on this one. I needed it on my project specifically for Text_Inputs that the user enters integers, and then scroll for tweaks if wanted (think a timer input that allows to typing in the time as well as scrolling to the time). These functions could also be useful for other widgets (on_scroll_left could be useful for a slider for example). Though I am open to any code implementation ideas.

3. Adding convenience functions for scrollables
Simple functions just for convenience, rather than having to play with Rectangles and content, just one function call to scroll to the bottom. (I use this on a GUI that creates new elements in a list above the create button. The create button is always at the bottom of a Scrollable thus scrolling to the bottom after pressing the create button is convenient).

Implemented by #607

@yusdacra
Copy link
Contributor

yusdacra commented Feb 5, 2021

Have you seen #607 ?

@13r0ck
Copy link
Member Author

13r0ck commented Feb 5, 2021

Oh no, I haven't. Thanks for bringing it up. #607 is better than my implementation.
I'll drop the third change from my commit

@13r0ck
Copy link
Member Author

13r0ck commented Feb 6, 2021

I had a discussion on discord about this commit. They had suggested that the changes I made to the text_input makes more sense in a new Sequential widget. I'm open to the idea, and willing to make it, just looking for some input on what that should look like?

Also would it still be valuable to add on_scroll methods to other widgets like Sliders?

@13r0ck
Copy link
Member Author

13r0ck commented May 10, 2021

Closed by #872

@13r0ck 13r0ck closed this May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants