[recipes] Support links for switching the image in the instructions.



commit 3915362fd16ec0463d50b5f7572e2191699849bd
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 3 16:28:52 2017 -0500

    Support links for switching the image in the instructions.

 src/gr-details-page.c  |    9 ++++++++-
 src/gr-details-page.ui |    1 +
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-details-page.c b/src/gr-details-page.c
index aae5f0d..e27b922 100644
--- a/src/gr-details-page.c
+++ b/src/gr-details-page.c
@@ -605,7 +605,13 @@ activate_uri_at_idle (gpointer data)
         uri = page->uri;
         page->uri = NULL;
 
-        if (g_str_has_prefix (uri, "recipe:")) {
+        if (g_str_has_prefix (uri, "image:")) {
+                int idx;
+
+                idx = (int)g_ascii_strtoll (uri + strlen ("image:"), NULL, 10);
+                gr_image_viewer_show_image (GR_IMAGE_VIEWER (page->recipe_image), idx);
+        }
+        else if (g_str_has_prefix (uri, "recipe:")) {
                 GrRecipeStore *store;
                 const char *id;
                 g_autoptr(GrRecipe) recipe = NULL;
@@ -900,6 +906,7 @@ gr_details_page_set_recipe (GrDetailsPage *page,
         else
                 gtk_label_set_label (GTK_LABEL (page->cook_time_label), _(cook_time));
         gtk_label_set_label (GTK_LABEL (page->instructions_label), instructions);
+        gtk_label_set_track_visited_links (GTK_LABEL (page->instructions_label), FALSE);
 
         gtk_spin_button_set_value (GTK_SPIN_BUTTON (page->serves_spin), serves);
         gtk_widget_set_sensitive (page->serves_spin, ing != NULL);
diff --git a/src/gr-details-page.ui b/src/gr-details-page.ui
index d3f702e..83630f4 100644
--- a/src/gr-details-page.ui
+++ b/src/gr-details-page.ui
@@ -359,6 +359,7 @@ followed</property>
                             <property name="visible">1</property>
                             <property name="xalign">0</property>
                             <property name="use-markup">1</property>
+                            <property name="track-visited-links">0</property>
                             <property name="wrap">1</property>
                             <property name="max-width-chars">45</property>
                             <property name="margin-bottom">30</property>


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