[maemo-commits] [maemo-commits] r13936 - in projects/haf/trunk/gtk+: . gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Sep 20 14:51:10 EEST 2007
Author: tko
Date: 2007-09-20 14:51:08 +0300 (Thu, 20 Sep 2007)
New Revision: 13936

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtkbbox.c
   projects/haf/trunk/gtk+/gtk/gtkbbox.h
   projects/haf/trunk/gtk+/gtk/gtkhbbox.c
Log:
Make use of child widget sizing related style properties

2007-09-20  Tommi Komulainen  <tommi.komulainen at nokia.com>

	* gtk/gtkbbox.h
	* gtk/gtkbbox.c (_gtk_button_box_child_size_props): Export for hbox.
	* gtk/gtkhbbox.c (gtk_hbutton_box_get_children_sizes): Make use of
	child widget sizing related style properties to improve the way
	heterogeneous allocation looks.


Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2007-09-20 11:51:05 UTC (rev 13935)
+++ projects/haf/trunk/gtk+/ChangeLog	2007-09-20 11:51:08 UTC (rev 13936)
@@ -1,5 +1,13 @@
 2007-09-20  Tommi Komulainen  <tommi.komulainen at nokia.com>
 
+	* gtk/gtkbbox.h
+	* gtk/gtkbbox.c (_gtk_button_box_child_size_props): Export for hbox.
+	* gtk/gtkhbbox.c (gtk_hbutton_box_get_children_sizes): Make use of
+	child widget sizing related style properties to improve the way
+	heterogeneous allocation looks.
+
+2007-09-20  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
 	* gtk/gtkbbox.c (_gtk_button_box_child_size_props,
 	_gtk_button_box_child_requisition): Refactor getting of style
 	properties into a separate function.

Modified: projects/haf/trunk/gtk+/gtk/gtkbbox.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkbbox.c	2007-09-20 11:51:05 UTC (rev 13935)
+++ projects/haf/trunk/gtk+/gtk/gtkbbox.c	2007-09-20 11:51:08 UTC (rev 13936)
@@ -385,7 +385,7 @@
     gtk_widget_queue_resize (child);
 }
 
-static void
+void
 _gtk_button_box_child_size_props (GtkButtonBox *bbox,
                                   gint         *child_min_width,
                                   gint         *child_min_height,

Modified: projects/haf/trunk/gtk+/gtk/gtkbbox.h
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkbbox.h	2007-09-20 11:51:05 UTC (rev 13935)
+++ projects/haf/trunk/gtk+/gtk/gtkbbox.h	2007-09-20 11:51:08 UTC (rev 13936)
@@ -96,6 +96,12 @@
 					int       *nvis_secondaries,
 					int       *width,
 					int       *height);
+
+void _gtk_button_box_child_size_props  (GtkButtonBox *bbox,
+                                        gint         *child_min_width,
+                                        gint         *child_min_height,
+                                        gint         *ipad_width,
+                                        gint         *ipad_height);
 G_END_DECLS
 
 #endif /* __GTK_BUTTON_BOX_H__ */

Modified: projects/haf/trunk/gtk+/gtk/gtkhbbox.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkhbbox.c	2007-09-20 11:51:05 UTC (rev 13935)
+++ projects/haf/trunk/gtk+/gtk/gtkhbbox.c	2007-09-20 11:51:08 UTC (rev 13936)
@@ -160,7 +160,12 @@
        */
       GList *children;
       gint extra_space;
+      gint child_min_width, ipad_width;
 
+      _gtk_button_box_child_size_props (GTK_BUTTON_BOX (widget),
+                                        &child_min_width, NULL,
+                                        &ipad_width, NULL);
+
       *primary_width = 0;
       *secondary_width = 0;
       children = GTK_BOX (widget)->children;
@@ -176,11 +181,8 @@
             {
               GtkRequisition req;
 
-	      /* FIXME: take child-min-width and child-internal-pad-x style
-	       * properties into account
-	       */
-
               gtk_widget_size_request (child_widget, &req);
+              req.width = MAX(req.width + ipad_width, child_min_width);
 
               if (! child->is_secondary)
                 *primary_width += req.width;


More information about the maemo-commits mailing list