[recipes/list-new: 5/14] Add an 'All recipes' tile on the landing page



commit 1fa73d1fd9242ff17f387601462b1c28812cc50d
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Feb 20 21:28:42 2017 -0500

    Add an 'All recipes' tile on the landing page
    
    This has been requested, and I don't see a reason
    not to have this list.

 src/gr-recipes-page.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-recipes-page.c b/src/gr-recipes-page.c
index 6c6bf03..4184c04 100644
--- a/src/gr-recipes-page.c
+++ b/src/gr-recipes-page.c
@@ -209,6 +209,8 @@ category_clicked (GrCategoryTile *tile,
                 gr_window_show_favorites (GR_WINDOW (window));
         else if (strcmp (name, "mine") == 0)
                 gr_window_show_myself (GR_WINDOW (window));
+        else if (strcmp (name, "all") == 0)
+                gr_window_show_all (GR_WINDOW (window));
 }
 
 static void
@@ -237,12 +239,17 @@ populate_categories_from_store (GrRecipesPage *self)
         gtk_container_add (GTK_CONTAINER (self->diet_box), tile);
         g_signal_connect (tile, "clicked", G_CALLBACK (category_clicked), self);
 
+        tile = gr_category_tile_new_with_label ("all", _("All Recipes"));
+        gtk_widget_show (tile);
+        gtk_container_add (GTK_CONTAINER (self->diet_box), tile);
+        g_signal_connect (tile, "clicked", G_CALLBACK (category_clicked), self);
+
         for (i = 0; i < G_N_ELEMENTS (diets); i++) {
                 tile = gr_category_tile_new (diets[i]);
                 gtk_widget_show (tile);
                 g_signal_connect (tile, "clicked", G_CALLBACK (category_clicked), self);
 
-                if (i < 4)
+                if (i < 3)
                         gtk_container_add (GTK_CONTAINER (self->diet_box), tile);
                 else
                         gtk_container_add (GTK_CONTAINER (self->diet_box2), tile);


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