From 89f48d718978e197adfcdfc519c1073ca26724ab Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 6 Dec 2003 00:41:38 +0000 Subject: [PATCH] Implement RTL flipping for GtkAlignment. (#127585) Sat Dec 6 01:42:04 2003 Matthias Clasen * gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement RTL flipping for GtkAlignment. (#127585) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gtk/gtkalignment.c | 8 ++++++-- 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b7dfc3da7..02ac54009 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Dec 6 01:42:04 2003 Matthias Clasen + + * gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement + RTL flipping for GtkAlignment. (#127585) + Sat Dec 6 01:13:09 2003 Matthias Clasen * gtk/gtkcombo.c (gtk_combo_get_pos): Fix the position of the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b7dfc3da7..02ac54009 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Sat Dec 6 01:42:04 2003 Matthias Clasen + + * gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement + RTL flipping for GtkAlignment. (#127585) + Sat Dec 6 01:13:09 2003 Matthias Clasen * gtk/gtkcombo.c (gtk_combo_get_pos): Fix the position of the diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b7dfc3da7..02ac54009 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Sat Dec 6 01:42:04 2003 Matthias Clasen + + * gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement + RTL flipping for GtkAlignment. (#127585) + Sat Dec 6 01:13:09 2003 Matthias Clasen * gtk/gtkcombo.c (gtk_combo_get_pos): Fix the position of the diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b7dfc3da7..02ac54009 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Sat Dec 6 01:42:04 2003 Matthias Clasen + + * gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement + RTL flipping for GtkAlignment. (#127585) + Sat Dec 6 01:13:09 2003 Matthias Clasen * gtk/gtkcombo.c (gtk_combo_get_pos): Fix the position of the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b7dfc3da7..02ac54009 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Sat Dec 6 01:42:04 2003 Matthias Clasen + + * gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement + RTL flipping for GtkAlignment. (#127585) + Sat Dec 6 01:13:09 2003 Matthias Clasen * gtk/gtkcombo.c (gtk_combo_get_pos): Fix the position of the diff --git a/gtk/gtkalignment.c b/gtk/gtkalignment.c index 275189595..785fb32c6 100644 --- a/gtk/gtkalignment.c +++ b/gtk/gtkalignment.c @@ -476,7 +476,7 @@ gtk_alignment_size_allocate (GtkWidget *widget, gint border_width; gint padding_horizontal, padding_vertical; GtkAlignmentPrivate *priv; - + gfloat xalign; padding_horizontal = 0; padding_vertical = 0; @@ -512,7 +512,11 @@ gtk_alignment_size_allocate (GtkWidget *widget, else child_allocation.height = height; - child_allocation.x = alignment->xalign * (width - child_allocation.width) + allocation->x + border_width + priv->padding_left; + xalign = alignment->xalign; + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) + xalign = 1.0 - xalign; + + child_allocation.x = xalign * (width - child_allocation.width) + allocation->x + border_width + priv->padding_left; child_allocation.y = alignment->yalign * (height - child_allocation.height) + allocation->y + border_width + priv->padding_top; gtk_widget_size_allocate (bin->child, &child_allocation);