[gnome-control-center] Prevent the date&time panel from growing horizontally



commit 5bc2bbe79b9f2221e4a0259a105c5368594a2a9c
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 25 21:50:55 2011 -0500

    Prevent the date&time panel from growing horizontally

 panels/datetime/cc-timezone-map.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/panels/datetime/cc-timezone-map.c b/panels/datetime/cc-timezone-map.c
index fc835d4..2c7924a 100644
--- a/panels/datetime/cc-timezone-map.c
+++ b/panels/datetime/cc-timezone-map.c
@@ -194,15 +194,14 @@ cc_timezone_map_get_preferred_width (GtkWidget *widget,
                                      gint      *natural)
 {
   CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv;
-  gint size;
-
-  size = gdk_pixbuf_get_width (priv->orig_background) * 0.6;
 
-  /* FIXME: should natural == full pixmap size ? */
+  /* choose a minimum size small enough to prevent the window
+   * from growing horizontally
+   */
   if (minimum != NULL)
-    *minimum = size;
+    *minimum = 300;
   if (natural != NULL)
-    *natural = size;
+    *natural = 300;
 }
 
 static void
@@ -213,9 +212,10 @@ cc_timezone_map_get_preferred_height (GtkWidget *widget,
   CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv;
   gint size;
 
-  /* FIXME: should natural == full pixmap size ? */
-  size = gdk_pixbuf_get_height (priv->orig_background) * 0.6;
-
+  /* The + 20 here is a slight tweak to make the map fill the
+   * panel better without causing horizontal growing
+   */
+  size = 300 * gdk_pixbuf_get_height (priv->orig_background) / gdk_pixbuf_get_width (priv->orig_background) + 20;
   if (minimum != NULL)
     *minimum = size;
   if (natural != NULL)



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