X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fhildon-time-editor.c;h=6396869eba486e5eb2c85f8b7f2729c5108bbbf3;hb=cb1db05be72c493c580dd3dbc8fc655ae6bf7002;hp=947fad91b26fc5a4518b750e1abe5436c0a37b4a;hpb=0402854c8217aa94891f691d4553a1419947fb3b;p=hildon diff --git a/src/hildon-time-editor.c b/src/hildon-time-editor.c index 947fad9..6396869 100644 --- a/src/hildon-time-editor.c +++ b/src/hildon-time-editor.c @@ -1734,9 +1734,11 @@ hildon_time_editor_size_allocate (GtkWidget *widget, HildonTimeEditorPrivate *priv = HILDON_TIME_EDITOR_GET_PRIVATE (widget); GtkAllocation alloc; GtkRequisition req, max_req; + gboolean rtl; g_assert (priv); + rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL); widget->allocation = *allocation; gtk_widget_get_child_requisition (widget, &max_req); @@ -1746,19 +1748,32 @@ hildon_time_editor_size_allocate (GtkWidget *widget, alloc.y = allocation->y + MAX (allocation->height - max_req.height, 0) / 2; /* allocate frame */ - gtk_widget_get_child_requisition (priv->frame, &req); + if (rtl) + gtk_widget_get_child_requisition (priv->iconbutton, &req); + else + gtk_widget_get_child_requisition (priv->frame, &req); alloc.width = req.width; alloc.height = max_req.height; - gtk_widget_size_allocate (priv->frame, &alloc); + if (rtl) + gtk_widget_size_allocate (priv->iconbutton, &alloc); + else + gtk_widget_size_allocate (priv->frame, &alloc); /* allocate icon */ if (GTK_WIDGET_VISIBLE (priv->iconbutton)) { - gtk_widget_get_child_requisition (priv->iconbutton, &req); + if (rtl) + gtk_widget_get_child_requisition (priv->frame, &req); + else + gtk_widget_get_child_requisition (priv->iconbutton, &req); alloc.x += alloc.width + HILDON_MARGIN_DEFAULT; alloc.width = req.width; - gtk_widget_size_allocate (priv->iconbutton, &alloc); + + if (rtl) + gtk_widget_size_allocate (priv->frame, &alloc); + else + gtk_widget_size_allocate (priv->iconbutton, &alloc); } /* FIXME: ugly way to move labels up. They just don't seem move up