After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 336159 - GtkButtonBox should also have a Center style.
GtkButtonBox should also have a Center style.
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.8.x
Other All
: Normal enhancement
: Small API
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-03-27 08:29 UTC by Itai Bar-Haim
Modified: 2007-02-08 12:13 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Implementation of GTK_BUTTONBOX_CENTER (3.46 KB, patch)
2007-01-18 14:35 UTC, Xan Lopez
none Details | Review
testcase (2.28 KB, text/plain)
2007-01-18 14:37 UTC, Xan Lopez
  Details
Fixed patch (3.53 KB, patch)
2007-01-24 13:15 UTC, Xan Lopez
none Details | Review
Updated testcase. (4.67 KB, text/plain)
2007-01-24 13:16 UTC, Xan Lopez
  Details
ready-to-commit patch (11.71 KB, patch)
2007-02-07 17:12 UTC, Michael Natterer
none Details | Review

Description Itai Bar-Haim 2006-03-27 08:29:24 UTC
GtkButtonBoxStyle should also include Center, in that case GtkButtonBox will 
place the buttons grouped in the middle of the box.
Comment 1 Xan Lopez 2007-01-18 14:35:54 UTC
Created attachment 80601 [details] [review]
Implementation of GTK_BUTTONBOX_CENTER

A possible implementation of GTK_BUTTONBOX_CENTER. I added the new enum member to the end and changed the checks for correct values because I guess adding it to the middle would count as an ABI change. I'll also attach a simple testcase.
Comment 2 Xan Lopez 2007-01-18 14:37:07 UTC
Created attachment 80602 [details]
testcase
Comment 3 Tim Janik 2007-01-23 11:05:52 UTC
Xan, can you please add a license to your test case, e.g. LGPL?
we can't take unlicensed contrbutions. as for the _CENTER patch, it looks unsymmetric in that the vertical case doesn't update secondary_y, while the horizontal case does update secondary_x. 
i suppose that needs fixing? 
and if so, the test case should prolly be extended to catch the omission of (not) updating secondary coordinates in the h/v cases.
Comment 4 Xan Lopez 2007-01-23 12:00:29 UTC
Yes, the secondary_y setting is missing in the vertical box part, I'll add it.
About extending the test case, do you want it to check the coordinates of the secondary button when they are enabled and print a warning if they don't change? Or what other kind of catching do you have in mind other than the current lack of visual effect?
Comment 5 Tim Janik 2007-01-23 12:23:19 UTC
(In reply to comment #4)
> Yes, the secondary_y setting is missing in the vertical box part, I'll add it.
> About extending the test case, do you want it to check the coordinates of the
> secondary button when they are enabled and print a warning if they don't
> change? Or what other kind of catching do you have in mind other than the
> current lack of visual effect?

i was just thinkink of the current lack of visual effect.
Comment 6 Xan Lopez 2007-01-23 13:02:14 UTC
Any idea for a better feedback than the current idea? Also, if this is going to be  a proper test inside GTK+ I'd probably add a way to test the vertical button box too.
Comment 7 Xan Lopez 2007-01-24 13:15:40 UTC
Created attachment 81069 [details] [review]
Fixed patch

Update secondary_y in GtkVButtonBox.
Comment 8 Xan Lopez 2007-01-24 13:16:18 UTC
Created attachment 81070 [details]
Updated testcase.
Comment 9 Michael Natterer 2007-02-07 17:12:27 UTC
Created attachment 82090 [details] [review]
ready-to-commit patch

Tested it and it seems to work perfectly.
Comment 10 Tim Janik 2007-02-08 12:13:17 UTC
thanks, applied.