New style property to set the size of the group of filter buttons
authorAlberto Garcia <agarcia@igalia.com>
Mon, 15 Jun 2009 10:45:48 +0000 (12:45 +0200)
committerAlberto Garcia <agarcia@igalia.com>
Mon, 15 Jun 2009 11:15:05 +0000 (13:15 +0200)
* hildon/hildon-app-menu.c
(hildon_app_menu_apply_style, hildon_app_menu_class_init):
New style property to set the size of the group of filter buttons.

Fixes: NB#122033 (Filter buttons in view menus incorrectly sized)

ChangeLog
hildon/hildon-app-menu.c

index c5089b4..7aee303 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-06-15  Alberto Garcia  <agarcia@igalia.com>
+
+       * hildon/hildon-app-menu.c
+       (hildon_app_menu_apply_style, hildon_app_menu_class_init):
+       New style property to set the size of the group of filter buttons.
+
+       Fixes: NB#122033 (Filter buttons in view menus incorrectly sized)
+
 2009-06-15  Claudio Saavedra  <csaavedra@igalia.com>
 
        [Release 2.1.82]
index e71fdaf..10dd120 100644 (file)
@@ -797,6 +797,7 @@ static void
 hildon_app_menu_apply_style                     (GtkWidget *widget)
 {
     GdkScreen *screen;
+    gint filter_group_width;
     guint horizontal_spacing, vertical_spacing, filter_vertical_spacing;
     guint inner_border, external_border;
     HildonAppMenuPrivate *priv;
@@ -806,6 +807,7 @@ hildon_app_menu_apply_style                     (GtkWidget *widget)
     gtk_widget_style_get (widget,
                           "horizontal-spacing", &horizontal_spacing,
                           "vertical-spacing", &vertical_spacing,
+                          "filter-group-width", &filter_group_width,
                           "filter-vertical-spacing", &filter_vertical_spacing,
                           "inner-border", &inner_border,
                           "external-border", &external_border,
@@ -819,6 +821,9 @@ hildon_app_menu_apply_style                     (GtkWidget *widget)
     /* Set inner border */
     gtk_container_set_border_width (GTK_CONTAINER (widget), inner_border);
 
+    /* Set width of the group of filter buttons */
+    gtk_widget_set_size_request (GTK_WIDGET (priv->filters_hbox), filter_group_width, -1);
+
     /* Compute width request */
     screen = gtk_widget_get_screen (widget);
     if (gdk_screen_get_width (screen) < gdk_screen_get_height (screen)) {
@@ -1122,6 +1127,16 @@ hildon_app_menu_class_init                      (HildonAppMenuClass *klass)
 
     gtk_widget_class_install_style_property (
         widget_class,
+        g_param_spec_int (
+            "filter-group-width",
+            "Width of the group of filter buttons",
+            "Total width of the group of filter buttons, "
+            "or -1 to use the natural size request.",
+            -1, G_MAXINT, 444,
+            G_PARAM_READABLE));
+
+    gtk_widget_class_install_style_property (
+        widget_class,
         g_param_spec_uint (
             "filter-vertical-spacing",
             "Vertical spacing between filters and menu items",