[gnome-software] GsShellCategory: fix a formatting issue



commit 360de72bc3d76637bae2a87ed6feffaafacf5486
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Sep 2 09:56:18 2013 -0400

    GsShellCategory: fix a formatting issue
    
    We don't want the subcategory list to grow super-wide while there
    are no apps, temporarily. The solution is a little hacky, but
    works: just put placeholders there, then the homogeneity of the
    grid will do the rest (empty columns defeat it).

 src/gs-shell-category.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-shell-category.c b/src/gs-shell-category.c
index 8ddbc5a..5620021 100644
--- a/src/gs-shell-category.c
+++ b/src/gs-shell-category.c
@@ -139,15 +139,18 @@ gs_shell_category_get_apps_cb (GObject *source_object,
         gtk_grid_remove_column (GTK_GRID (grid), 2);
         gtk_grid_remove_column (GTK_GRID (grid), 1);
 
-        for (l = list; l != NULL; l = l->next) {
+        for (l = list, i = 0; l != NULL; l = l->next, i++) {
                 app = GS_APP (l->data);
                 tile = create_app_tile (shell, app);
                 if (gs_category_get_parent (priv->category) != NULL)
                         gtk_grid_attach (GTK_GRID (grid), tile, 1 + (i % 2), i / 2, 1, 1);
                 else
                         gtk_grid_attach (GTK_GRID (grid), tile, i % 3, i / 3, 1, 1);
-                i++;
         }
+
+        if (i == 1)
+                gtk_grid_attach (GTK_GRID (grid), priv->col2_placeholder, 2, 0, 1, 1);
+
 out:
        g_list_free (list);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]