diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/metaaccellabel.c | 28 |
2 files changed, 28 insertions, 5 deletions
@@ -1,3 +1,8 @@ +2007-06-04 Thomas Thurman <thomas@thurman.org.uk> + + * src/metaaccellabel.c (meta_accel_label_expose_event): fix + label layout for RTL languages. Closes #433400. + 2007-06-03 Thomas Thurman <thomas@thurman.org.uk> * src/frames.c (meta_frames_ensure_layout): Pango layout for diff --git a/src/metaaccellabel.c b/src/metaaccellabel.c index 0c2a76d3..cdc86369 100644 --- a/src/metaaccellabel.c +++ b/src/metaaccellabel.c @@ -271,15 +271,33 @@ meta_accel_label_expose_event (GtkWidget *widget, if (widget->allocation.width >= widget->requisition.width + ac_width) { - int x; - int y; - + GtkTextDirection direction = gtk_widget_get_direction (widget); + gint x; + gint y; + + if (direction == GTK_TEXT_DIR_RTL) + { + widget->allocation.x += ac_width; + } widget->allocation.width -= ac_width; + if (GTK_WIDGET_CLASS (parent_class)->expose_event) GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event); - widget->allocation.width += ac_width; - x = widget->allocation.x + widget->allocation.width - misc->xpad - ac_width; + if (direction == GTK_TEXT_DIR_RTL) + { + widget->allocation.x -= ac_width; + } + widget->allocation.width += ac_width; + + if (direction == GTK_TEXT_DIR_RTL) + { + x = widget->allocation.x + misc->xpad; + } + else + { + x = widget->allocation.x + widget->allocation.width - misc->xpad - ac_width; + } y = (widget->allocation.y * (1.0 - misc->yalign) + (widget->allocation.y + widget->allocation.height - |