GNOME Bugzilla – Bug 110365
Add padding to GtkAlignment
Last modified: 2011-02-04 16:12:26 UTC
As disussed on gtk-devel, and as agreed by Owen Taylor, here is a patch (gtk_alignment_padding.patch) to add 4-sided (or 1, 2, or 3 sides) padding to GtkAligmnment. This is not a cvs patch - it's against an old checkout because I have connection problems.. Also, sorry for forgetting to patch the ChangeLog. This patch needs to be revised when the private-data feature is in glib 2.4. At the moment it just adds struct fields so it breaks API.
Created attachment 15594 [details] [review] gtk_alignment_padding.patch
Also, this patch adds examples/alignment_padding, which exercises the new functionality.
Here (gtk_alignment_padding2.patch) is a revised patch, taking into account Owen Taylor's comments on gtk-devel. Also, I added some dull reference docs for the new functions.
Created attachment 15674 [details] [review] gtk_alignment_padding2.patch
Just a few tiny comments: * A couple of places, you have: + GtkAlignmentPrivate *priv = 0; the = 0 should be removed; not only do we use NULL, putting an assignment here just defeats GCC's uninitialized variable warnings and thus increases the chance of error. * In: guint* padding_top, We would generally put the * flush with the p of padding rather than on the other side. * The doc comments need function bodies as well as parameter description. gtk_alignment_set_padding: [...] Sets the padding on the different sides of the widget. The padding is ... gtk_alignment_get_padding: [...] Gets the padding on the different sides of the widget. See gtk_alignment_set_padding()
Created attachment 16987 [details] [review] gtk_alignment_padding3.patch
OK, so here's the revised patch (gtk_alignment_padding3.patch).
Looks great to commit.
Done. Didn't know it was branched already.