[gnome-control-center] shell: Set the minimum content height



commit f264ebea0bea905113de1d1e35a3db8f11a49357
Author: Bastien Nocera <hadess hadess net>
Date:   Tue May 8 18:48:06 2012 +0100

    shell: Set the minimum content height
    
    Instead of using gtk_widget_size_request() on the parent scrolled
    window, to make sure that border are taken into account when sizing
    the icon views.

 shell/gnome-control-center.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c
index 3507915..095bad7 100644
--- a/shell/gnome-control-center.c
+++ b/shell/gnome-control-center.c
@@ -838,8 +838,8 @@ notebook_switch_page_cb (GtkNotebook               *book,
 
       gtk_widget_get_preferred_height_for_width (GTK_WIDGET (priv->main_vbox),
                                                  FIXED_WIDTH, NULL, &nat_height);
-      gtk_widget_set_size_request (priv->scrolled_window, FIXED_WIDTH,
-                                   priv->small_screen ? SMALL_SCREEN_FIXED_HEIGHT : nat_height);
+      gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window),
+                                                  priv->small_screen ? SMALL_SCREEN_FIXED_HEIGHT : nat_height);
     }
   else
     {
@@ -849,7 +849,7 @@ notebook_switch_page_cb (GtkNotebook               *book,
          the window to be larger than this panel */
       gtk_widget_get_preferred_height_for_width (GTK_WIDGET (priv->window),
                                                  FIXED_WIDTH, NULL, &nat_height);
-      gtk_widget_set_size_request (priv->scrolled_window, FIXED_WIDTH, MIN_ICON_VIEW_HEIGHT);
+      gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (priv->scrolled_window), MIN_ICON_VIEW_HEIGHT);
       gtk_window_resize (GTK_WINDOW (priv->window),
                          FIXED_WIDTH,
                          nat_height);
@@ -1164,7 +1164,7 @@ update_small_screen_settings (GnomeControlCenter *self)
   if (small)
     {
       gtk_window_set_resizable (GTK_WINDOW (self->priv->window), TRUE);
-      gtk_widget_set_size_request (self->priv->scrolled_window, FIXED_WIDTH, SMALL_SCREEN_FIXED_HEIGHT);
+      gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (self->priv->scrolled_window), SMALL_SCREEN_FIXED_HEIGHT);
 
       if (!self->priv->small_screen_set
           && self->priv->small_screen != small) {
@@ -1237,6 +1237,7 @@ gnome_control_center_init (GnomeControlCenter *self)
 
   priv->notebook = W (priv->builder, "notebook");
   priv->scrolled_window = W (priv->builder, "scrolledwindow1");
+  gtk_widget_set_size_request (priv->scrolled_window, FIXED_WIDTH, -1);
   priv->main_vbox = W (priv->builder, "main-vbox");
   g_signal_connect (priv->notebook, "switch-page",
                     G_CALLBACK (notebook_switch_page_cb), priv);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]