[gnome-software] category page: Use a different tile for fonts



commit e1684d0b975c11c9f0ac4bfcafd15575508ed7ab
Author: Kalev Lember <klember redhat com>
Date:   Thu Feb 22 13:59:44 2018 +0100

    category page: Use a different tile for fonts
    
    ... as per the design guidance in
    https://raw.githubusercontent.com/gnome-design-team/gnome-mockups-software/master/wireframes/app-tiles.png

 src/gs-category-page.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-category-page.c b/src/gs-category-page.c
index aba3da3b..c976f4ea 100644
--- a/src/gs-category-page.c
+++ b/src/gs-category-page.c
@@ -123,6 +123,15 @@ sort_button_clicked (GtkButton *button, gpointer data)
                gs_category_page_sort_by_type (self, SUBCATEGORY_SORT_TYPE_NAME);
 }
 
+static GtkWidget *
+make_addon_tile_for_category (GsApp *app, GsCategory *category)
+{
+       if (g_strcmp0 (gs_category_get_id (category), "fonts") == 0)
+               return gs_popular_tile_new (app);
+
+       return gs_summary_tile_new (app);
+}
+
 static void
 gs_category_page_get_apps_cb (GObject *source_object,
                               GAsyncResult *res,
@@ -151,7 +160,7 @@ gs_category_page_get_apps_cb (GObject *source_object,
        for (i = 0; i < gs_app_list_length (list); i++) {
                app = gs_app_list_index (list, i);
                if (g_strcmp0 (gs_category_get_id (self->category), "addons") == 0) {
-                       tile = gs_summary_tile_new (app);
+                       tile = make_addon_tile_for_category (app, self->subcategory);
                } else {
                        tile = gs_popular_tile_new (app);
                        if (!gs_app_has_quirk (app, AS_APP_QUIRK_PROVENANCE) ||
@@ -366,7 +375,7 @@ gs_category_page_reload (GsPage *page)
        count = MIN(30, gs_category_get_size (self->subcategory));
        for (i = 0; i < count; i++) {
                if (g_strcmp0 (gs_category_get_id (self->category), "addons") == 0)
-                       tile = gs_summary_tile_new (NULL);
+                       tile = make_addon_tile_for_category (NULL, self->subcategory);
                else
                        tile = gs_popular_tile_new (NULL);
                gtk_container_add (GTK_CONTAINER (self->category_detail_box), tile);


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