Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR has three main goals:
gtk_box_pack
, which takes, for newcomers, unintuitive parameters. The newdt_gui_vbox
anddt_gui_hbox
combine the creation and adding a list of widgets in one go. This also makes them nestable. For already existing boxes, usedt_gui_box_add
to add a list of widgets. The resulting code is often more compact and, when all widgets are added in one go, makes the intended layout more easily discernable and amendable. This PR is intended as a showcase with many examples.gtk_box_pack
and thefill
andexpand
child properties it sets. Instead, the same effect has to be achieved usingh/vexpand
andh/valign
. Using these now should make eventual porting somewhat easier (ideally only requiring a trivial change ingtk.c
). It also drops the idea of packing widgets either atstart
orend
of the box. Aligning buttons to the right can now usually be achieved by wrapping the first one indt_gui_expand
beforedt_gui_box_add
ing it. Buttons then should no longer be added in reverse order.GTK_WIDGET
when adding them to andt_gui_v/hbox
and there will usually be a more helpful error when an uninitialised widget is added. Something like5.5440 [...]/src/develop/blend_gui.c:3734 dt_iop_gui_init_blending: trying to add invalid widget to box (#2)
Again, this should hopefully be helpful to newcomers.
@ralfbrown since you've been doing a fair amount of gtk work recently, would you have any suggestions? Looking, for example, at the changed code in
splash.c
This PR at the moment converts about 100 calls to
gtk_box_new
and 300gtk_box_pack_start/end
. There are 400 and 900 remaining, so still a fair bit of work. I'm unlikely to do all of it, so help is needed. Some of that work should allow for opportunities to simplify/improve/correct/clean, so it is not a completely mindless conversion, but on the other hand, it could be something for a dedicated new contributor to bite into. In the end the intended result is that "nothing changes", so testing should be straightforward. I am willing to do a limited amount of review/mentoring. A FR marked "good first contribution" could be raised (after this is merged).