[gnome-control-center] background: Set the size request only on the parent



commit 7585b836be499983ffa5f862393e3ea5bfa236fe
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Oct 3 14:32:44 2013 +0200

    background: Set the size request only on the parent
    
    Instead of setting the size on each child, set it on the parent grid
    because only one of those children are visible at any given point.
    
    We are cheating a bit by ignoring the fact there is a second child
    which is always shown -- the button box. This will make the other
    children lose some height and the dialog will be smaller. However it is
    still too big for smaller screens.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708943

 panels/background/cc-background-chooser-dialog.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/panels/background/cc-background-chooser-dialog.c 
b/panels/background/cc-background-chooser-dialog.c
index a1a9ec1..1568265 100644
--- a/panels/background/cc-background-chooser-dialog.c
+++ b/panels/background/cc-background-chooser-dialog.c
@@ -300,6 +300,7 @@ cc_background_chooser_dialog_init (CcBackgroundChooserDialog *chooser)
   gtk_grid_set_row_spacing (GTK_GRID (grid), 12);
   gtk_grid_set_column_spacing (GTK_GRID (grid), 0);
   gtk_container_add (GTK_CONTAINER (vbox), grid);
+  gtk_widget_set_size_request (grid, 860, 550);
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
   gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
@@ -350,10 +351,6 @@ cc_background_chooser_dialog_init (CcBackgroundChooserDialog *chooser)
   gtk_widget_set_hexpand (priv->sw_content, TRUE);
   gtk_widget_set_vexpand (priv->sw_content, TRUE);
   gtk_container_add (GTK_CONTAINER (grid), priv->sw_content);
-  g_object_set (priv->sw_content,
-                "width-request", 860,
-                "height-request", 550,
-                NULL);
 
   priv->empty_pictures_box = gtk_grid_new ();
   gtk_widget_set_no_show_all (priv->empty_pictures_box, TRUE);
@@ -363,10 +360,6 @@ cc_background_chooser_dialog_init (CcBackgroundChooserDialog *chooser)
   context = gtk_widget_get_style_context (priv->empty_pictures_box);
   gtk_style_context_add_class (context, "dim-label");
   gtk_container_add (GTK_CONTAINER (grid), priv->empty_pictures_box);
-  g_object_set (priv->empty_pictures_box,
-                "width-request", 860,
-                "height-request", 550,
-                NULL);
   img = gtk_image_new_from_icon_name ("emblem-photos-symbolic", GTK_ICON_SIZE_DIALOG);
   gtk_image_set_pixel_size (GTK_IMAGE (img), 64);
   gtk_widget_set_halign (img, GTK_ALIGN_END);


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