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

DynamicGridLayout - Initial Draft #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BieHDC
Copy link

@BieHDC BieHDC commented Dec 31, 2024

This is a revised version of the dynamic grid i used in fic to display a preview of a folders's images. It takes the available space and tries to fit as many items as possible and if it can fit them all it tries to stretch them out over the available space. So if a folder has only few images, they are as large as possible, and if it has a lot of images it will squeeze as much as possible by checking each MinSize and scaling everything by the largest encountered size.

There are various fixme-s in the code that need addressing, however a general discussion beforehand on how this layout should work takes priority. In the Video you see one of those bugs which in real world use you likely wont encounter, because you would fill it with pretty much same sized widgets, but it would be a hard blocker for me to release.

And right now the code is in main because of heavy development. If this gets accepted and finalised, it goes into the layout folder of course.
11
22
33

dynamicgriddemo-2024-12-31_21.04.37.mp4

@Jacalz
Copy link
Member

Jacalz commented Jan 6, 2025

How is this different from widget.GridWrap upstream in Fyne?

@BieHDC
Copy link
Author

BieHDC commented Jan 6, 2025

How is this different from widget.GridWrap upstream in Fyne?

It does not make a scroll container, it only uses the available space.
When there is more space than elements, it increases the sizes of the elements to fill as much space as possible.
It puts the user directly into control on which widgets are being up into it instead of the length, create and updateitem strategy.
And that also allows for a easier method of selecting which widgets are being embedded.
There is no and there is not meant to be an inner item select handling. The items handle themselves.

Those are the main points.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification. That sounds like a different container indeed. Would you mind creating a container package here and adding it as an importable type? Right now it is just a runnable demo and no container that can be used by other people.

@Jacalz
Copy link
Member

Jacalz commented Jan 6, 2025

Ah, sorry. I read now that you wanted a discussion about it. Let's have that before. Disregard my previous comment.

@andydotxyz
Copy link
Member

Would you mind creating a container package here and adding it as an importable type?

It could also just be a layout as @BieHDC implied above.

@BieHDC
Copy link
Author

BieHDC commented Jan 6, 2025

Once the fixmes in the code have been answered i will turn it into a proper package.

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.

3 participants