[gnome-2048] Clean subtitle when undoing.



commit 5b57a2ffdb4ffa1b3ee1903f2365712a3450eaea
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Jan 31 16:22:23 2019 +0100

    Clean subtitle when undoing.
    
    Undo is allowed even for a finished game,
    so needs to clean the headerbar subtitle.

 src/application.vala | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/application.vala b/src/application.vala
index c73d9c3..83408d0 100644
--- a/src/application.vala
+++ b/src/application.vala
@@ -312,8 +312,13 @@ private class Application : Gtk.Application
 
     private void undo_cb (/* SimpleAction action, Variant? variant */)
     {
-        if (_settings.get_boolean ("allow-undo"))   // for the keyboard shortcut
-            _game.undo ();
+        if (!_settings.get_boolean ("allow-undo"))   // for the keyboard shortcut
+            return;
+
+        _header_bar.set_subtitle (null);
+        _header_bar.set_has_subtitle (false);
+
+        _game.undo ();
     }
 
     private void new_game_cb (/* SimpleAction action, Variant? variant */)


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