-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add GridWrap widget #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done. This is looking great. I just have a few comments inline about making the code more readable in some places.
We talked a bit on Slack about changing the name to something like GridWrap
. I think the List
part makes it a bit unclear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done. I mostly just had one small comment in line. Would you mind adding a few simple tests? With that done, I think this should be ready to land.
Co-authored-by: Jacob Alzén <jacalz@tutanota.com>
Done! |
This comment was marked as outdated.
This comment was marked as outdated.
Ignore my previous comment. I had forgotten a refresh call :/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have one minor comment inline. This is looking very good :)
Co-authored-by: Jacob Alzén <jacalz@tutanota.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'm very happy with this. Well done!
Perhaps @andydotxyz or @Bluebugs can review before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really great, thanks.
However I'm not sure about the data binding aspect.
When you attach a DataList
it is a list of binding items, it will be triggered if the list changes in dimension, but any child item can be updated when that data changes.
In this implementation those child changes will not be reflected in the UI as the item is not bound, nor is it refreshed on a child change.
I'd recommend removing the binding code for now, landing this, and then working on that separately...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies, it seems I may have not read the data item code correctly. Looks good.
Happy to proceed if @Jacalz agrees the data binding code is cool to land together with the main API.
I think it is fine. It looks to be the same as what we already have in the List widget. |
Thanks for your work on this @dweymouth. We appreciate it. This widget is going to be very useful :) |
Initial implementation was by @dweymouth over at fyne-io/fyne-x#56. This PR includes that work plus selection support and some of the improvements that I have done (see fyne-io/fyne-x#61 and https://github.com/fyne-io/fyne-x/compare/master...Jacalz:gridwrap-selection?expand=1). This was done as a PR directly to Fyne and not fyne-x as the `.super()` call from `widget.BaseWidget` wasn't public and not using it made the selection work bad. All of the changes in this PR compared to the widget in fyne-x can be found here: https://github.com/fyne-io/fyne-x/compare/master...Jacalz:gridwrap-selection?expand=1 Co-authored-by: Drew Weymouth <dweymouth@gmail.com>
With fyne-io/fyne-x#56 merged, the local implementation can be removed to rely on the upstream version.
With fyne-io/fyne-x#56 merged, the local implementation can be removed to rely on the upstream version.
This is a port from fyne to fyne-x of the GridWrapList component I made for Supersonic used for the album grid view. I stripped out the use of private APIs (
internal/widget/scroll
,BaseWidget.super()
) and copied others (syncPool
).