diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2002-11-02 00:18:14 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2002-11-02 00:18:14 +0000 |
commit | 00943af834ae457e5989daf7836cda0feb007544 (patch) | |
tree | 3bc4928450fd091fed2762131187556980872772 /gtk/gtkaccellabel.c | |
parent | ca00536f34bfbb895b8b5e01b1faf9c1c60545bf (diff) | |
download | gtk+-00943af834ae457e5989daf7836cda0feb007544.tar.gz |
Automatic RTL flipping for some more widgets.
Diffstat (limited to 'gtk/gtkaccellabel.c')
-rw-r--r-- | gtk/gtkaccellabel.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index 4190d3fca5..92df11be27 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -204,8 +204,6 @@ gtk_accel_label_init (GtkAccelLabel *accel_label) accel_label->accel_closure = NULL; accel_label->accel_group = NULL; accel_label->accel_string = NULL; - - gtk_accel_label_refetch (accel_label); } GtkWidget* @@ -312,7 +310,10 @@ gtk_accel_label_expose_event (GtkWidget *widget, { GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (widget); GtkMisc *misc = GTK_MISC (accel_label); - + GtkTextDirection direction; + + direction = gtk_widget_get_direction (widget); + if (GTK_WIDGET_DRAWABLE (accel_label)) { guint ac_width; @@ -327,12 +328,19 @@ gtk_accel_label_expose_event (GtkWidget *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); + if (direction == GTK_TEXT_DIR_RTL) + widget->allocation.x -= ac_width; widget->allocation.width += ac_width; - x = widget->allocation.x + widget->allocation.width - misc->xpad - 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; label_layout = gtk_label_get_layout (GTK_LABEL (accel_label)); gtk_label_get_layout_offsets (GTK_LABEL (accel_label), NULL, &y); |