[SF#798] Fix PanelIconGrid allocation in rigth-to-left languages.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 23 Oct 2016 19:57:36 +0000 (22:57 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sun, 23 Oct 2016 19:57:36 +0000 (22:57 +0300)
x coordinate for icon in RTL was calculated wrong so first icon was placed out of grid.

ChangeLog
src/icon-grid.c

index d289ffd..a52d713 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -52,6 +52,8 @@
 * Fixed crash on action on task window which was deleted while task menu
     is still opened.
 * Fixed "dynamic" panel width allocation.
+* Fixed PanelIconGrid allocation in rigth-to-left languages, it was wrong
+    so some icons might be invisible or placed under other plugins.
 
 0.8.2
 -------------------------------------------------------------------------
index 290a8d8..d26245a 100644 (file)
@@ -201,6 +201,7 @@ static void panel_icon_grid_size_allocate(GtkWidget *widget,
             else
             {
                 // FIXME: if fill_width then use aspect to check delta
+                x = next_coord;
                 if (direction == GTK_TEXT_DIR_RTL)
                 {
                     next_coord = x - child_allocation.width;
@@ -213,7 +214,6 @@ static void panel_icon_grid_size_allocate(GtkWidget *widget,
                             y += child_height + ig->spacing;
                         }
                     }
-                    x = next_coord;
                 }
                 else
                 {
@@ -226,7 +226,10 @@ static void panel_icon_grid_size_allocate(GtkWidget *widget,
                     next_coord = x + child_allocation.width + ig->spacing;
                 }
             }
-            child_allocation.x = x;
+            if (direction == GTK_TEXT_DIR_RTL)
+                child_allocation.x = x - child_allocation.width;
+            else
+                child_allocation.x = x;
             if (req.height < child_height - 1)
                 y += (child_height - req.height) / 2;
             child_allocation.y = y;