From f92117be84bc8d1c3e8703b2bbd656d2c3b2ab92 Mon Sep 17 00:00:00 2001 From: Josh Elsasser Date: Sat, 4 Feb 2006 06:14:43 +0000 Subject: [PATCH] Fix a couple of positioning bugs with right-to-left languages. --- gtk/trcellrenderertorrent.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk/trcellrenderertorrent.c b/gtk/trcellrenderertorrent.c index c2ce72b42..a3b618d5a 100644 --- a/gtk/trcellrenderertorrent.c +++ b/gtk/trcellrenderertorrent.c @@ -281,13 +281,15 @@ render(GtkCellRenderer *cell, GdkWindow *window, GtkWidget *widget, complete.width = (bar.width - style->xthickness * 2) * tcell->priv->value; complete.height = bar.height - style->ythickness * 2; if(rtl) - complete.x += bar.width - complete.width; + complete.x += bar.width - (complete.width + style->xthickness * 2); /* set up the dimensions for the text under the bar */ text.x = bar.x; text.y = bar.y + bar.height; text.width = bar.width; text.height = area->height - bar.height; + if(rtl && text.width > trect.width) + text.x += text.width - trect.width; /* draw the background of the bar */ if(complete.width < bar.width) @@ -300,7 +302,7 @@ render(GtkCellRenderer *cell, GdkWindow *window, GtkWidget *widget, NULL, widget, "bar", RECTARGS(complete)); /* draw the text under the bar */ - gtk_paint_layout(style, window, (GTK_CELL_RENDERER_SELECTED & flags ? + gtk_paint_layout(widget->style, window, (GTK_CELL_RENDERER_SELECTED & flags ? GTK_STATE_SELECTED : GTK_STATE_NORMAL), FALSE, &text, widget, "cellrenderertext", text.x, text.y, tlayout);