[recipes] Tweak keynav on in cooking mode



commit 15216a2455c30b5d192bfbadf2e0c7b2b42dbc19
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Feb 23 15:20:54 2017 -0500

    Tweak keynav on in cooking mode
    
    With the new setup, left/right arrow keys and buttons just
    switch between steps. Other keys will 'do the right thing'
    and start timers where appropriate.

 src/gr-cooking-page.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/gr-cooking-page.c b/src/gr-cooking-page.c
index 74e7175..e6c36f3 100644
--- a/src/gr-cooking-page.c
+++ b/src/gr-cooking-page.c
@@ -244,6 +244,12 @@ next_step (GrCookingPage *page)
         update_steppers (page);
 }
 
+static void
+forward (GrCookingPage *page)
+{
+        gr_cooking_view_forward (GR_COOKING_VIEW (page->cooking_view));
+        update_steppers (page);
+}
 
 static gboolean
 doubletap_timeout (gpointer data)
@@ -252,11 +258,11 @@ doubletap_timeout (gpointer data)
 
         if (page->keyval_seen) {
                 page->keyval_seen = 0;
-                next_step (page);
+                forward (page);
         }
         else if (page->button_seen) {
                 page->button_seen = 0;
-                next_step (page);
+                forward (page);
         }
 
         return G_SOURCE_REMOVE;
@@ -358,7 +364,7 @@ gr_cooking_page_handle_event (GrCookingPage *page,
                         return GDK_EVENT_STOP;
                 }
                 else if (e->keyval == GDK_KEY_space) {
-                        next_step (page);
+                        forward (page);
 
                         return GDK_EVENT_STOP;
                 }


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