Handle vertical arrangement of icons in PanelIconGrid more accurately.
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Fri, 15 Aug 2014 20:57:06 +0000 (23:57 +0300)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 16 Aug 2014 16:23:40 +0000 (19:23 +0300)
Icons should not be resized if not required and it's better to center them.

src/icon-grid.c

index d3b8ef5..54557b8 100644 (file)
@@ -120,7 +120,9 @@ static void panel_icon_grid_size_allocate(GtkWidget *widget,
             child_allocation.x = x;
             child_allocation.y = y;
             child_allocation.width = child_width;
-            child_allocation.height = child_height;
+            child_allocation.height = MIN(req.height, child_height);
+            if (req.height < child_height - 1)
+                child_allocation.y += (child_height - req.height) / 2;
             if (!gtk_widget_get_has_window (widget))
             {
                 child_allocation.x += allocation->x;
@@ -180,8 +182,8 @@ static void panel_icon_grid_size_request(GtkWidget *widget,
         if (ig->rows == 0)
             ig->rows = 1;
         ig->columns = (visible_children + (ig->rows - 1)) / ig->rows;
-        if ((ig->columns == 1) && (ig->rows > visible_children))
-            ig->rows = visible_children;
+        /* if ((ig->columns == 1) && (ig->rows > visible_children))
+            ig->rows = visible_children; */
     }
     else
     {