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 553573 - Add orientation API to GtkBox
Add orientation API to GtkBox
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 304099 (view as bug list)
Depends on:
Blocks: 541009
 
 
Reported: 2008-09-24 12:21 UTC by Michael Natterer
Modified: 2010-07-10 03:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch implementing the above (41.32 KB, patch)
2008-09-24 12:29 UTC, Michael Natterer
none Details | Review
Implement GtkOrientable instead of having an own orientation API (39.99 KB, patch)
2008-10-02 11:46 UTC, Michael Natterer
committed Details | Review

Description Michael Natterer 2008-09-24 12:21:21 UTC
See bug #541009.

Here are the patches for GtkBox, GtkHBox and GtkVBox.
Comment 1 Michael Natterer 2008-09-24 12:29:44 UTC
Created attachment 119295 [details] [review]
Patch implementing the above

Add orientation API to GtkBox, move all of GtkHBox' and GtkVBox' code to
GtkBox.

Unrelated: move the newly added "spacing_set" boolean to GtkBoxPrivate

Will do deprecations in separate commits because they imply lots of
related changes.
Comment 2 Matthias Clasen 2008-09-27 01:51:24 UTC
+                       "homogeneous", homogeneous ? TRUE : FALSE,

+  private->spacing_set = spacing_set ? TRUE : FALSE;

Why ? 
These are already booleans...


-  guint GSEAL (spacing_set) : 1;


Why remove this field from the public struct ? 


You'll have to add the new functions to gtk.symbols and gtk-sections.txt.


Other than this, looks fine to me.


Would be great to add some example of box flipping to gtk-demo.
Comment 3 Michael Natterer 2008-09-30 14:28:13 UTC
> +  private->spacing_set = spacing_set ? TRUE : FALSE;
> 
> Why ? 
> These are already booleans...

To make sure that only TRUE and FALSE ends up in the member, especially
since there is only one bit available (call it paranoia).

> -  guint GSEAL (spacing_set) : 1;
> 
> Why remove this field from the public struct ?

Because it's newly added in unstable and should go into the private
struct now that one is available.

> Would be great to add some example of box flipping to gtk-demo.

I have some flipping test code that I will commit with all affected
flippable widgets one the whole bunch of patches is in.
Comment 4 Matthias Clasen 2008-10-02 03:08:46 UTC
Interestingly, some bugzilla archeology turned out an old duplicate
Comment 5 Matthias Clasen 2008-10-02 03:09:24 UTC
*** Bug 304099 has been marked as a duplicate of this bug. ***
Comment 6 Michael Natterer 2008-10-02 11:46:16 UTC
Created attachment 119764 [details] [review]
Implement GtkOrientable instead of having an own orientation API
Comment 7 Matthias Clasen 2008-10-07 02:17:12 UTC
Looks good to me.
Comment 8 Michael Natterer 2008-10-07 07:44:41 UTC
Committed. Leaving the bug open since deprecation needs to be discussed.

2008-10-07  Michael Natterer  <mitch@imendio.com>

	Bug 553573 – Add orientation API to GtkBox

	* gtk/gtkbox.[hh]: implement the GtkOrientable interface and
	swallow all code from GtkHBox and GtkVBox. Add gtk_box_new()
	which takes a GtkOrientation argument. Also move the newly
	added "spacing_set" boolean from struct GtkBox to the new
	private struct.

	* gtk/gtkhbox.[ch]
	* gtk/gtkvbox.[ch]: remove all code except the constructor and
	call gtk_orientable_set_orientation() in init().

	* gtk/gtk.symbols: add gtk_box_new().
Comment 9 Michael Natterer 2008-10-07 09:02:27 UTC
We also need to discuss changing the new instantiatable widget's defaults
(like defaulting to visible instead of invisible) before this bug
can be closed.
Comment 10 Matthias Clasen 2010-07-10 03:49:26 UTC
Closing since we gave up on visible