]> Pileus Git - ~andy/gtk/commitdiff
Bug 565203: RTL locales: icons are misplaced when horizontal gtkiconview
authorYair Hershkovitz <yairhr@gmail.com>
Sun, 21 Dec 2008 08:10:53 +0000 (08:10 +0000)
committerYair Hershkovitz <yairhr@src.gnome.org>
Sun, 21 Dec 2008 08:10:53 +0000 (08:10 +0000)
2008-12-21  Yair Hershkovitz  <yairhr@gmail.com>

        Bug 565203: RTL locales: icons are misplaced when horizontal
                    gtkiconview is contained in a gtkscrolledwindow.

        * gtk/gtkiconview.c (gtk_icon_view_layout_single_row):
        Fix horizontal icon positions when in RTL locale.

svn path=/trunk/; revision=21918

ChangeLog
gtk/gtkiconview.c

index c514fa786fb22a1aef427b44e0f630d0b6c1cdac..9533713bf1c14d88686427e22010b61b39f367ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-21  Yair Hershkovitz  <yairhr@gmail.com>
+
+       Bug 565203: RTL locales: icons are misplaced when horizontal 
+                   gtkiconview is contained in a gtkscrolledwindow.
+
+       * gtk/gtkiconview.c (gtk_icon_view_layout_single_row):
+       Fix horizontal icon positions when in RTL locale.
+
 2008-12-19  Matthias Clasen  <mclasen@redhat.com>
 
        * NEWS: Update
index 8b095997f3a214c163d55f18ae98a44bda312fd0..81ef0bded7ea65b00b3101e89b5b58dd979b06ec 100644 (file)
@@ -2575,7 +2575,7 @@ gtk_icon_view_layout_single_row (GtkIconView *icon_view,
       current_width += icon_view->priv->column_spacing + 2 * focus_width;
 
       item->y = *y + focus_width;
-      item->x = rtl ? GTK_WIDGET (icon_view)->allocation.width - item->width - x : x;
+      item->x = x;
 
       x = current_width - (icon_view->priv->margin + focus_width); 
 
@@ -2599,14 +2599,17 @@ gtk_icon_view_layout_single_row (GtkIconView *icon_view,
     {
       GtkIconViewItem *item = items->data;
 
+      if (rtl)
+       {
+         item->x = *maximum_width - item->width - item->x;
+         item->col = col - 1 - item->col;
+       }
+
       gtk_icon_view_calculate_item_size2 (icon_view, item, max_height);
 
       /* We may want to readjust the new y coordinate. */
       if (item->y + item->height + focus_width + icon_view->priv->row_spacing > *y)
        *y = item->y + item->height + focus_width + icon_view->priv->row_spacing;
-
-      if (rtl)
-       item->col = col - 1 - item->col;
     }
 
   g_free (max_height);