* src/hildon-bread-crumb-trail.c: (hildon_bread_crumb_trail_size_allocate):
authorXan Lopez <xan.lopez@nokia.com>
Fri, 4 May 2007 11:36:49 +0000 (11:36 +0000)
committerXan Lopez <xan.lopez@nokia.com>
Fri, 4 May 2007 11:36:49 +0000 (11:36 +0000)
Make the back button always a square.

ChangeLog
src/hildon-bread-crumb-trail.c

index 4fbb7c8..ef67463 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 2007-05-04  Xan Lopez  <xan.lopez@nokia.com>
 
        * src/hildon-bread-crumb-trail.c:
+       (hildon_bread_crumb_trail_size_allocate): 
+
+       Make the back button always a square.
+
+2007-05-04  Xan Lopez  <xan.lopez@nokia.com>
+
        * src/hildon-bread-crumb-trail.h: Include hildon-bread-crumb-widget.h
        from the .c file as it's a private file. 
 
index 0a483bd..e203d93 100644 (file)
@@ -224,6 +224,7 @@ hildon_bread_crumb_trail_size_allocate (GtkWidget *widget,
   gint border_width, width;
   gint extra_space;
   GList *p, *first_show, *first_hide;
+  gint back_button_size;
   HildonBreadCrumbTrailPrivate *priv = HILDON_BREAD_CRUMB_TRAIL (widget)->priv;
 
   widget->allocation = *allocation;
@@ -235,10 +236,11 @@ hildon_bread_crumb_trail_size_allocate (GtkWidget *widget,
   child_allocation.x = allocation->x + border_width;
   child_allocation.y = allocation->y + border_width;
   gtk_widget_get_child_requisition (priv->back_button, &child_requisition);
-  child_allocation.width = child_requisition.width;
-  child_allocation.height = child_requisition.height;
+  /* We want the back button to be a square */
+  back_button_size = MAX (child_requisition.width, child_requisition.height);
+  child_allocation.width = child_allocation.height = back_button_size;
   gtk_widget_size_allocate (priv->back_button, &child_allocation);
-  child_allocation.x += child_allocation.width;
+  child_allocation.x += back_button_size;
 
   /* If there are no buttons there's nothing else to do */
   if (priv->item_list == NULL)
@@ -247,7 +249,7 @@ hildon_bread_crumb_trail_size_allocate (GtkWidget *widget,
   /* We find out how many buttons can we show, starting from the
      the last one in the logical path (the first item in the list) */
 
-  width = child_allocation.width;
+  width = back_button_size;
   p = priv->item_list;
   first_show = NULL;
   first_hide = NULL;