Commit 360de72b authored by Matthias Clasen's avatar Matthias Clasen
Browse files

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).
parent c45b0378
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment