[gnome-tetravex/gnome-3-10] On new game make sure the pause button is set correctly



commit c4f8a6a9cbe01c448b83442bdf25796998d0fea1
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date:   Mon Oct 14 23:05:29 2013 +0200

    On new game make sure the pause button is set correctly
    
    If starting a new game while the previous game was in the paused
    state then the paused button would have the wrong image set.

 src/gnome-tetravex.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-tetravex.vala b/src/gnome-tetravex.vala
index 96cd78d..173baae 100644
--- a/src/gnome-tetravex.vala
+++ b/src/gnome-tetravex.vala
@@ -221,6 +221,8 @@ public class Tetravex : Gtk.Application
 
         var pause = lookup_action ("pause") as SimpleAction;
         pause.change_state (false);
+
+        update_button_states ();
     }
 
     private void tick_cb ()
@@ -361,6 +363,11 @@ public class Tetravex : Gtk.Application
     private void pause_cb (SimpleAction action, Variant? parameter)
     {
         puzzle.paused = !puzzle.paused;
+        update_button_states ();
+    }
+
+    private void update_button_states ()
+    {
         var solve = lookup_action ("solve") as SimpleAction;
         solve.set_enabled (!puzzle.paused);
         if (puzzle.paused)


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