-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 Option to CheckGroup to make Rows/Columns #5226
base: develop
Are you sure you want to change the base?
Conversation
Sorry but it actually isn’t. Your variable is indexed from one meaning that the default value of zero when creating a struct without using the constructor results in incorrect behaviour. |
True, but i can fix that. Right now i would more like to know if that feature was even wished in the main repo. Otherwise i would demote it to a new widget for fyne-x. |
Absolutely, I meant it as a review comment. Sorry if that wasn't clear. I personally think it is a useful addition :) |
This is fully backwards compatible and helps with very long lists to be better organised.
I reworked the code on the basis of gridLayout which also fixed a rendering bug and the list now also has the natural flow. And of course fixed the backwards compatibility issue. |
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.
Opened a question about the layout. Perhaps folk have thoughts?
Thanks for adding this though1
item.Resize(itemSize) | ||
item.Move(fyne.NewPos(x, y)) | ||
size := r.checks.MinSize() | ||
cellWidth := float64(size.Width) / float64(primaryObjects) |
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 doesn't seem quite right - normally a grid would spread out over the avilable space, but here it's using the minimum size instead. Is that intentional?
Initially it didn't matter because it was just 1 column but with horizontal and this grid layout I wonder if we should be respecting size...
return int(math.Ceil(float64(len(r.items)) / float64(r.countColumns()))) | ||
} | ||
|
||
func getLeading(size float64, offset int) float32 { |
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.
functions not attached to types should be at the end of the file as utilities
Description:
This adds an option to CheckGroup to make Rows/Columns instead of one long list.
I made this for a program i am currently writing and it makes sense to upstream.
It is fully backwards compatible.
Video:
https://github.com/user-attachments/assets/79bf6be3-0d93-4e51-8f94-f94c1244da75
Example Code for testing:
Checklist: