[recipes/list-new: 14/14] Add a 'new recipes' category on the landing page
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes/list-new: 14/14] Add a 'new recipes' category on the landing page
- Date: Sat, 25 Feb 2017 05:00:47 +0000 (UTC)
commit 0aa5ac538023426c87d6fdba2d13bae24a04a5f6
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 24 23:58:10 2017 -0500
Add a 'new recipes' category on the landing page
This is a pretty obvious addition. We can discuss what
exactly should show up on the list, and whether it should
be configurable how new the recipes should be.
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 4184c04..8dd1d46 100644
--- a/src/gr-recipes-page.c
+++ b/src/gr-recipes-page.c
@@ -211,6 +211,8 @@ category_clicked (GrCategoryTile *tile,
gr_window_show_myself (GR_WINDOW (window));
else if (strcmp (name, "all") == 0)
gr_window_show_all (GR_WINDOW (window));
+ else if (strcmp (name, "new") == 0)
+ gr_window_show_new (GR_WINDOW (window));
}
static void
@@ -244,12 +246,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 ("new", _("New 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 < 3)
+ if (i + 4 < 6)
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]