[anjuta] AnjutaTabber: correctly order tabs in RTL locales
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] AnjutaTabber: correctly order tabs in RTL locales
- Date: Fri, 9 Jul 2010 22:07:49 +0000 (UTC)
commit 842fceebc9a0a581deb92c76aabab41085241964
Author: Abderrahim Kitouni <a kitouni gmail com>
Date: Mon Jul 5 21:29:55 2010 +0100
AnjutaTabber: correctly order tabs in RTL locales
https://bugzilla.gnome.org/show_bug.cgi?id=623116
libanjuta/anjuta-tabber.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/libanjuta/anjuta-tabber.c b/libanjuta/anjuta-tabber.c
index 8b0796c..d58b15d 100644
--- a/libanjuta/anjuta-tabber.c
+++ b/libanjuta/anjuta-tabber.c
@@ -185,7 +185,12 @@ anjuta_tabber_size_allocate(GtkWidget* widget, GtkAllocation* allocation)
AnjutaTabber* tabber = ANJUTA_TABBER (widget);
GList* child;
- gint x = allocation->x;
+ gint x;
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+ x = allocation->x;
+ else
+ x = allocation->x + allocation->width;
+
gint y = allocation->y;
gint padding = anjuta_tabber_get_padding (widget);
gint child_width;
@@ -216,11 +221,18 @@ anjuta_tabber_size_allocate(GtkWidget* widget, GtkAllocation* allocation)
child_alloc.width = child_width;
child_alloc.height = MAX(child_req.height, allocation->height);
- child_alloc.x = x + style->xthickness + padding;
+
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+ child_alloc.x = x + style->xthickness + padding;
+ else
+ child_alloc.x = x - child_width - style->xthickness - padding;
child_alloc.y = y + style->ythickness + padding;
gtk_widget_size_allocate (GTK_WIDGET (child->data), &child_alloc);
- x += child_width + style->xthickness + 2 * padding;
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+ x += child_width + style->xthickness + 2 * padding;
+ else
+ x -= child_width + style->xthickness + 2 * padding;
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]