[gnome-software: 12/15] gs-category-page: Use GsSummaryTile instead of GsPopularTile




commit d5d1b61f63d6fee3d74f827df84d52b734212d80
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue Apr 20 16:03:36 2021 +0100

    gs-category-page: Use GsSummaryTile instead of GsPopularTile
    
    This is in accordance with the new design: 
https://gitlab.gnome.org/Teams/Design/software-mockups/-/blob/master/adaptive/category-page-mvp.png
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1111

 src/gs-category-page.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)
---
diff --git a/src/gs-category-page.c b/src/gs-category-page.c
index e3daf8b2b..1b5f632c7 100644
--- a/src/gs-category-page.c
+++ b/src/gs-category-page.c
@@ -16,7 +16,6 @@
 #include "gs-app-list-private.h"
 #include "gs-common.h"
 #include "gs-summary-tile.h"
-#include "gs-popular-tile.h"
 #include "gs-category-page.h"
 #include "gs-utils.h"
 
@@ -102,15 +101,6 @@ 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,
@@ -138,11 +128,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 = make_addon_tile_for_category (app, self->subcategory);
-               } else {
-                       tile = gs_popular_tile_new (app);
-               }
+               tile = gs_summary_tile_new (app);
 
                g_signal_connect (tile, "clicked",
                                  G_CALLBACK (app_tile_clicked), self);
@@ -318,10 +304,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 = make_addon_tile_for_category (NULL, self->subcategory);
-               else
-                       tile = gs_popular_tile_new (NULL);
+               tile = gs_summary_tile_new (NULL);
                gtk_container_add (GTK_CONTAINER (self->category_detail_box), tile);
                gtk_widget_set_can_focus (gtk_widget_get_parent (tile), FALSE);
        }


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