-
Notifications
You must be signed in to change notification settings - Fork 63
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 settings to center buttons-grid #426
base: main
Are you sure you want to change the base?
Conversation
buttonsGrid is using flowbox as the container, with default halign set to FILL, for which users have to tweak the button size to make it really fill the space or it will not be centered. this add options to make the buttonGrid centered properly
set options only when it's present
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.
Would be great if the column min/max wouldn't be needed, but that's sadly just how GTK works...
Not sure how one would fix this without needing those config properties. Any ideas?
if (center != null && center) | ||
container.set_halign(Gtk.Align.CENTER); | ||
|
||
int? col_min = get_prop<int> (config, "column-min"); | ||
if (col_min != null && col_min > 0) | ||
container.set_min_children_per_line(col_min); | ||
|
||
int? col_max = get_prop<int> (config, "column-max"); | ||
if (col_max != null && col_max > 0) | ||
container.set_max_children_per_line(col_max); |
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.
The linter requires spaces between the function name and the parenthesis. Also, I'd prefer if you use brackets on small if-statments.
Not sure why GitHub isn't allowing me to run my GitHub Linting Actions…
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.
The vala dev settings on my laptop not seems to be stable enough, reformat with uncrustify, feel free to adjust the code on merge if you like ;)
Maybe use some other container other than flowbox. Anyway, for flowbox, align to center seems to require |
For future reference: Here's something that would work as a replacement https://gitlab.gnome.org/GNOME/libadwaita/-/merge_requests/219 |
buttonsGrid is using flowbox as the container, with default halign set
to FILL, for which users have to tweak the button size to make it really
fill the space or it will not be centered.
This adds options to make the buttonGrid centered properly