2008-04-07 Sven Herzberg <sven@imendio.com>
[hildon] / src / hildon-date-editor.c
index f6062a9..54f424c 100644 (file)
@@ -1,4 +1,5 @@
-/*
+/* vim:set sw=4 expandtab cino=(0:
+ *
  * This file is a part of hildon
  *
  * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
@@ -1298,16 +1299,15 @@ hildon_date_editor_size_allocate                (GtkWidget *widget,
     f_alloc.x = img_alloc.x = allocation->x +
         MAX (allocation->width - max_req.width, 0) / 2;
 
-    /* allocate frame */
-    if (GTK_WIDGET_VISIBLE (priv->frame)) {
+    /* calculate allocations */
+    if (GTK_WIDGET_VISIBLE (widget)) {
+        /* allocate frame */
         gtk_widget_get_child_requisition (priv->frame, &req);
 
         f_alloc.width = req.width;
         f_alloc.height = max_req.height;
-    }
 
-    /* allocate icon */
-    if (GTK_WIDGET_VISIBLE (priv->d_button_image)) {
+        /* allocate icon */
         gtk_widget_get_child_requisition (priv->d_button_image,
                 &req);
 
@@ -1320,14 +1320,14 @@ hildon_date_editor_size_allocate                (GtkWidget *widget,
             img_alloc.x = f_alloc.x;
             f_alloc.x  += img_alloc.width + HILDON_MARGIN_DEFAULT;
         }
-    }
 
-    if (GTK_WIDGET_VISIBLE (priv->d_button_image)) {
-        gtk_widget_size_allocate (priv->d_button_image, &img_alloc);
-    }
+        if (GTK_WIDGET_VISIBLE (priv->d_button_image)) {
+            gtk_widget_size_allocate (priv->d_button_image, &img_alloc);
+        }
 
-    if (GTK_WIDGET_VISIBLE (priv->frame)) {
-        gtk_widget_size_allocate (priv->frame, &f_alloc);
+        if (GTK_WIDGET_VISIBLE (priv->frame)) {
+            gtk_widget_size_allocate (priv->frame, &f_alloc);
+        }
     }
 
     /* FIXME: We really should not alloc delimeters by hand (since they