[recipes] Add more content warning icons in the detail page
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Add more content warning icons in the detail page
- Date: Sun, 1 Jan 2017 16:07:07 +0000 (UTC)
commit 46f50dc0fd70f5e5f3215f700f479c88b9a13d55
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jan 1 09:42:21 2017 -0500
Add more content warning icons in the detail page
We show icons for gluten and dairy now. I haven't used the egg
warning icon yet, since we don't have a dietary restriction flag
for it yet.
src/gr-details-page.c | 14 ++++++++++++++
src/gr-details-page.ui | 14 ++++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/src/gr-details-page.c b/src/gr-details-page.c
index 0b53ef6..29c9e8b 100644
--- a/src/gr-details-page.c
+++ b/src/gr-details-page.c
@@ -126,6 +126,8 @@ struct _GrDetailsPage
GtkWidget *warning_box;
GtkWidget *spicy_warning;
GtkWidget *garlic_warning;
+ GtkWidget *gluten_warning;
+ GtkWidget *dairy_warning;
GtkWidget *ingredients_box;
GtkWidget *instructions_label;
GtkWidget *cooking_revealer;
@@ -628,6 +630,8 @@ gr_details_page_class_init (GrDetailsPageClass *klass)
gtk_widget_class_bind_template_child (widget_class, GrDetailsPage, warning_box);
gtk_widget_class_bind_template_child (widget_class, GrDetailsPage, spicy_warning);
gtk_widget_class_bind_template_child (widget_class, GrDetailsPage, garlic_warning);
+ gtk_widget_class_bind_template_child (widget_class, GrDetailsPage, dairy_warning);
+ gtk_widget_class_bind_template_child (widget_class, GrDetailsPage, gluten_warning);
gtk_widget_class_bind_template_child (widget_class, GrDetailsPage, ingredients_box);
gtk_widget_class_bind_template_child (widget_class, GrDetailsPage, instructions_label);
gtk_widget_class_bind_template_child (widget_class, GrDetailsPage, cooking_revealer);
@@ -741,12 +745,22 @@ populate_ingredients (GrDetailsPage *page,
gtk_widget_hide (page->warning_box);
gtk_widget_hide (page->garlic_warning);
+ gtk_widget_hide (page->dairy_warning);
+ gtk_widget_hide (page->gluten_warning);
gtk_widget_hide (page->spicy_warning);
if (gr_recipe_contains_garlic (page->recipe)) {
gtk_widget_show (page->warning_box);
gtk_widget_show (page->garlic_warning);
}
+ if (gr_recipe_contains_dairy (page->recipe)) {
+ gtk_widget_show (page->warning_box);
+ gtk_widget_show (page->dairy_warning);
+ }
+ if (gr_recipe_contains_gluten (page->recipe)) {
+ gtk_widget_show (page->warning_box);
+ gtk_widget_show (page->gluten_warning);
+ }
if (gr_recipe_get_spiciness (page->recipe) > 50) {
gtk_widget_show (page->warning_box);
diff --git a/src/gr-details-page.ui b/src/gr-details-page.ui
index 2ca4d91..e8cc7b8 100644
--- a/src/gr-details-page.ui
+++ b/src/gr-details-page.ui
@@ -138,6 +138,20 @@ followed</property>
</object>
</child>
<child>
+ <object class="GtkImage" id="dairy_warning">
+ <property name="icon-name">dairy-content-symbolic</property>
+ <property name="tooltip-text" translatable="yes">Contains dairy
products</property>
+ <property name="icon-size">1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkImage" id="gluten_warning">
+ <property name="icon-name">wheat-content-symbolic</property>
+ <property name="tooltip-text" translatable="yes">Contains Gluten</property>
+ <property name="icon-size">1</property>
+ </object>
+ </child>
+ <child>
<object class="GtkImage" id="spicy_warning">
<property name="icon-name">spicy-content-symbolic</property>
<property name="tooltip-text" translatable="yes">Spicy</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]