Prevent the date&time panel from growing horizontally

This commit is contained in:
Matthias Clasen 2011-01-25 21:50:55 -05:00
parent 2c4bba74e0
commit 5bc2bbe79b

View file

@ -194,15 +194,14 @@ cc_timezone_map_get_preferred_width (GtkWidget *widget,
gint *natural) gint *natural)
{ {
CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv; CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv;
gint size;
size = gdk_pixbuf_get_width (priv->orig_background) * 0.6; /* choose a minimum size small enough to prevent the window
* from growing horizontally
/* FIXME: should natural == full pixmap size ? */ */
if (minimum != NULL) if (minimum != NULL)
*minimum = size; *minimum = 300;
if (natural != NULL) if (natural != NULL)
*natural = size; *natural = 300;
} }
static void static void
@ -213,9 +212,10 @@ cc_timezone_map_get_preferred_height (GtkWidget *widget,
CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv; CcTimezoneMapPrivate *priv = CC_TIMEZONE_MAP (widget)->priv;
gint size; gint size;
/* FIXME: should natural == full pixmap size ? */ /* The + 20 here is a slight tweak to make the map fill the
size = gdk_pixbuf_get_height (priv->orig_background) * 0.6; * 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) if (minimum != NULL)
*minimum = size; *minimum = size;
if (natural != NULL) if (natural != NULL)