alloc.width = priv->caption_area->allocation.width + HILDON_CAPTION_SPACING;
alloc.height = MIN (req.height + (2 * widget->style->ythickness), priv->caption_area->allocation.height);
- alloc.x = priv->caption_area->allocation.x;
+
+ alloc.x = priv->caption_area->allocation.x - HILDON_CAPTION_SPACING; /* - left margin */
alloc.y = priv->caption_area->allocation.y +
MAX(((priv->caption_area->allocation.height - alloc.height) * align), 0);
GtkRequisition req;
GtkWidget *child = NULL;
HildonCaptionPrivate *priv = NULL;
+
g_assert( HILDON_IS_CAPTION(widget) );
priv = HILDON_CAPTION_GET_PRIVATE(widget);
gtk_widget_get_child_requisition( priv->caption_area, &req );
allocA.height = allocB.height = allocation->height;
- allocA.width = allocB.width = allocation->width;
+ allocA.width = allocB.width = allocation->width;
allocA.x = allocB.x = allocB.y = allocA.y = 0;
/* Center the captioned widget */
allocB.width = req.width;
}
+ /* Leave at least the space of the HILDON_CAPTION_SPACING in the left */
+ allocB.x = HILDON_CAPTION_SPACING;
+
/* Leave room for the other drawable parts of the caption control */
allocA.width -= req.width + HILDON_CAPTION_SPACING * 2;
{
GtkRequisition child_req;
gtk_widget_get_child_requisition( child, &child_req );
- allocA.width = MIN( allocA.width, child_req.width );
+ allocA.width = MIN( allocA.width, child_req.width );
allocA.height = MIN( allocA.height, child_req.height );
}
if (child && GTK_WIDGET_VISIBLE(child) )
gtk_widget_size_allocate( child, &allocA );
+
gtk_widget_size_allocate( priv->caption_area, &allocB );
}