[gnome-control-center] background: Make icon list smaller on netbooks



commit 470f0dd13aad4a40c4521802cb218624c39801f3
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Mar 26 01:20:57 2011 +0000

    background: Make icon list smaller on netbooks
    
    The default treeview is quite tall by default, and with the addition
    of the shell's toolbar, the titlebar and the GNOME shell panel,
    the background panel would be too tall for netbook computers.
    
    This works around the issue by setting a smaller height request
    for the icon list when the screen on which the panel will be shown
    are no taller than 768 pixels.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645649

 panels/background/cc-background-panel.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index e1baf5a..752317c 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -1077,6 +1077,22 @@ load_current_bg (CcBackgroundPanel *self)
 }
 
 static void
+scrolled_realize_cb (GtkWidget         *scrolled,
+                     CcBackgroundPanel *self)
+{
+  /* FIXME, hack for https://bugzilla.gnome.org/show_bug.cgi?id=645649 */
+  GdkScreen *screen;
+  GdkRectangle rect;
+  int monitor;
+
+  screen = gtk_widget_get_screen (scrolled);
+  monitor = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (scrolled));
+  gdk_screen_get_monitor_geometry (screen, monitor, &rect);
+  if (rect.height <= 768)
+    g_object_set (G_OBJECT (scrolled), "height-request", 280, NULL);
+}
+
+static void
 cc_background_panel_init (CcBackgroundPanel *self)
 {
   CcBackgroundPanelPrivate *priv;
@@ -1102,6 +1118,10 @@ cc_background_panel_init (CcBackgroundPanel *self)
       return;
     }
 
+  /* See shell_notify_cb for details */
+  g_signal_connect (WID ("scrolledwindow1"), "realize",
+                    G_CALLBACK (scrolled_realize_cb), self);
+
   priv->settings = g_settings_new (WP_PATH_ID);
   g_settings_delay (priv->settings);
 



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