diff --git a/ChangeLog b/ChangeLog index cef1753c2d..a8926ec183 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-07-09 Matthias Clasen + + * gtk/gtkcontainer.c (gtk_container_focus_sort_tab): Consider the text direction + when sorting children. (#116540, Soeren Sandmann) + Tue Jul 8 17:36:21 2003 Owen Taylor * gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index cef1753c2d..a8926ec183 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2003-07-09 Matthias Clasen + + * gtk/gtkcontainer.c (gtk_container_focus_sort_tab): Consider the text direction + when sorting children. (#116540, Soeren Sandmann) + Tue Jul 8 17:36:21 2003 Owen Taylor * gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index cef1753c2d..a8926ec183 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +2003-07-09 Matthias Clasen + + * gtk/gtkcontainer.c (gtk_container_focus_sort_tab): Consider the text direction + when sorting children. (#116540, Soeren Sandmann) + Tue Jul 8 17:36:21 2003 Owen Taylor * gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index cef1753c2d..a8926ec183 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2003-07-09 Matthias Clasen + + * gtk/gtkcontainer.c (gtk_container_focus_sort_tab): Consider the text direction + when sorting children. (#116540, Soeren Sandmann) + Tue Jul 8 17:36:21 2003 Owen Taylor * gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index cef1753c2d..a8926ec183 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2003-07-09 Matthias Clasen + + * gtk/gtkcontainer.c (gtk_container_focus_sort_tab): Consider the text direction + when sorting children. (#116540, Soeren Sandmann) + Tue Jul 8 17:36:21 2003 Owen Taylor * gdk/x11/gdkasync.[ch] gdk/gdkdnd-x11.c: diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index 44483298d1..53f2472325 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -1570,10 +1570,12 @@ gtk_container_focus (GtkWidget *widget, static gint tab_compare (gconstpointer a, - gconstpointer b) + gconstpointer b, + gpointer data) { const GtkWidget *child1 = a; const GtkWidget *child2 = b; + GtkTextDirection text_direction = GPOINTER_TO_INT (data); gint y1 = child1->allocation.y + child1->allocation.height / 2; gint y2 = child2->allocation.y + child2->allocation.height / 2; @@ -1583,7 +1585,10 @@ tab_compare (gconstpointer a, gint x1 = child1->allocation.x + child1->allocation.width / 2; gint x2 = child2->allocation.x + child2->allocation.width / 2; - return (x1 < x2) ? -1 : ((x1 == x2) ? 0 : 1); + if (text_direction == GTK_TEXT_DIR_RTL) + return (x1 < x2) ? 1 : ((x1 == x2) ? 0 : -1); + else + return (x1 < x2) ? -1 : ((x1 == x2) ? 0 : 1); } else return (y1 < y2) ? -1 : 1; @@ -1595,7 +1600,8 @@ gtk_container_focus_sort_tab (GtkContainer *container, GtkDirectionType direction, GtkWidget *old_focus) { - children = g_list_sort (children, tab_compare); + GtkTextDirection text_direction = gtk_widget_get_direction (GTK_WIDGET (container)); + children = g_list_sort_with_data (children, tab_compare, GINT_TO_POINTER (text_direction)); /* if we are going backwards then reverse the order * of the children.