Commit 0bf33c25 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Show favorites on the landing page

Put them next to the chefs. Bit crowded.
parent e1f6fb09
......@@ -85,6 +85,7 @@ gr_recipes_page_class_init (GrRecipesPageClass *klass)
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (klass), GrRecipesPage, pick_box);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (klass), GrRecipesPage, diet_box);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (klass), GrRecipesPage, chefs_box);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (klass), GrRecipesPage, favorites_box);
}
GtkWidget *
......@@ -128,6 +129,7 @@ populate_recipes_from_store (GrRecipesPage *self)
container_remove_all (GTK_CONTAINER (self->today_box));
container_remove_all (GTK_CONTAINER (self->pick_box));
container_remove_all (GTK_CONTAINER (self->favorites_box));
store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
......@@ -149,6 +151,12 @@ populate_recipes_from_store (GrRecipesPage *self)
gtk_container_add (GTK_CONTAINER (self->pick_box), tile);
}
if (gr_recipe_store_is_favorite (store, recipe)) {
g_print ("favorite added\n");
tile = gr_recipe_tile_new (recipe);
gtk_widget_show (tile);
gtk_container_add (GTK_CONTAINER (self->favorites_box), tile);
}
}
}
......
......@@ -5,76 +5,135 @@
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Today</property>
<property name="xalign">0</property>
<style><class name="heading"/></style>
</object>
</child>
<child>
<object class="GsHidingBox" id="today_box">
<property name="visible">True</property>
<property name="spacing">20</property>
<property name="halign">start</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">GNOME's Pick</property>
<property name="xalign">0</property>
<style><class name="heading"/></style>
</object>
</child>
<child>
<object class="GsHidingBox" id="pick_box">
<property name="visible">True</property>
<property name="spacing">20</property>
<property name="halign">start</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Special Diets</property>
<property name="xalign">0</property>
<style><class name="heading"/></style>
</object>
</child>
<child>
<object class="GtkFlowBox" id="diet_box">
<property name="visible">True</property>
<property name="selection-mode">none</property>
<property name="row-spacing">20</property>
<property name="column-spacing">20</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="min-children-per-line">4</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Featured GNOME Chefs</property>
<property name="xalign">0</property>
<style><class name="heading"/></style>
</object>
</child>
<child>
<object class="GsHidingBox" id="chefs_box">
<property name="visible">True</property>
<property name="spacing">20</property>
<property name="halign">start</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
<property name="margin-bottom">20</property>
<object class="GtkScrolledWindow">
<property name="visible">1</property>
<property name="expand">1</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">Today</property>
<property name="xalign">0</property>
<style>
<class name="heading"/>
</style>
</object>
</child>
<child>
<object class="GsHidingBox" id="today_box">
<property name="visible">True</property>
<property name="spacing">20</property>
<property name="halign">start</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">GNOME&apos;s Pick</property>
<property name="xalign">0</property>
<style>
<class name="heading"/>
</style>
</object>
</child>
<child>
<object class="GsHidingBox" id="pick_box">
<property name="visible">True</property>
<property name="spacing">20</property>
<property name="halign">start</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">Special Diets</property>
<property name="xalign">0</property>
<style>
<class name="heading"/>
</style>
</object>
</child>
<child>
<object class="GtkFlowBox" id="diet_box">
<property name="visible">1</property>
<property name="selection-mode">none</property>
<property name="row-spacing">20</property>
<property name="column-spacing">20</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="min-children-per-line">4</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
</object>
</child>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="homogeneous">1</property>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">Featured GNOME Chefs</property>
<property name="xalign">0</property>
<style>
<class name="heading"/>
</style>
</object>
</child>
<child>
<object class="GtkFlowBox" id="chefs_box">
<property name="visible">1</property>
<property name="row-spacing">20</property>
<property name="column-spacing">20</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
<property name="margin-bottom">20</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">1</property>
<property name="label" translatable="yes">Favorite Recipes</property>
<property name="xalign">0</property>
<style>
<class name="heading"/>
</style>
</object>
</child>
<child>
<object class="GtkFlowBox" id="favorites_box">
<property name="visible">1</property>
<property name="row-spacing">20</property>
<property name="column-spacing">20</property>
<property name="margin-start">20</property>
<property name="margin-end">20</property>
<property name="margin-bottom">20</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
......
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