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

scroll method in WidgetExt #1544

Closed
arthmis opened this issue Jan 21, 2021 · 3 comments · Fixed by #1600
Closed

scroll method in WidgetExt #1544

arthmis opened this issue Jan 21, 2021 · 3 comments · Fixed by #1600
Labels
enhancement adds or requests a new feature good first issue requires little knowledge of druid's internals

Comments

@arthmis
Copy link
Collaborator

arthmis commented Jan 21, 2021

From my limited experience, I sometimes wished I could just add a .scroll to the end of a widget definition. Wrapping a widget in a scroll isn't too annoying but it does, at least to me, make things a bit more difficult to read. The function definition would look like this

// I don't know if this definition is the correct one, specifically for the return type
pub fn scroll(self, direction: ScrollDirection) -> Scroll<T, Self> {
 // within here there can be some matching on the `ScrollDirection` which would 
// create the Scroll appropriately
}
pub enum ScrollDirection {
    Horizontal,
    Vertical,
    Both,

Would this sort of change be welcome in WidgetExt?

@cmyr
Copy link
Member

cmyr commented Feb 17, 2021

Oops, missed this one!

yes, this would totally be a welcome addition.

I don't even think we need the direction argument; once you get the Scroll widget back, you can call vertical() or horizontal() on it as you wish, like:

my_widget.padding(8.0)
    .scroll()
    .vertical()

@cmyr cmyr added the enhancement adds or requests a new feature label Feb 17, 2021
@arthmis
Copy link
Collaborator Author

arthmis commented Feb 17, 2021

Can someone mark this issue as good first issue. I think this should be easy for someone to do who is new to druid.

@cmyr cmyr added the good first issue requires little knowledge of druid's internals label Feb 17, 2021
@cmyr
Copy link
Member

cmyr commented Feb 17, 2021

@arthmis I've sent you an invite for 'triage' access to this repo, so you can add tags and do other things like that as you see fit. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement adds or requests a new feature good first issue requires little knowledge of druid's internals
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants