diff options
author | Thomas Thurman <thomas@thurman.org.uk> | 2007-06-04 12:50:50 +0000 |
---|---|---|
committer | Thomas James Alexander Thurman <tthurman@src.gnome.org> | 2007-06-04 12:50:50 +0000 |
commit | 1004bd8b600be94be4abc27f0772eb6848558c95 (patch) | |
tree | 88b3ca43f61b69b9907d29fe1a2130c6200b68a1 | |
parent | 45966f581bcaa63a95d66e7ef68c73a0e970d8fe (diff) | |
download | metacity-1004bd8b600be94be4abc27f0772eb6848558c95.tar.gz |
fix label layout for RTL languages. Closes #433400.
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.
svn path=/trunk/; revision=3228
-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 - |