[four-in-a-row] Fix a bug.



commit 9fe2b0caf5cdb099f4e966dee45587182c0c4873
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sun May 3 21:43:37 2020 +0200

    Fix a bug.

 src/four-in-a-row.vala |  2 ++
 src/game-window.vala   | 11 +++++++++++
 2 files changed, 13 insertions(+)
---
diff --git a/src/four-in-a-row.vala b/src/four-in-a-row.vala
index 20a1ea9..c352f75 100644
--- a/src/four-in-a-row.vala
+++ b/src/four-in-a-row.vala
@@ -1302,6 +1302,8 @@ private class FourInARow : Gtk.Application
 
     private inline void toggle_game_menu ()
     {
+        if (window.new_game_screen_visible ())
+            return;
         window.close_hamburger ();
         if (window.is_extra_thin)
             history_button_2.active = !history_button_2.active;
diff --git a/src/game-window.vala b/src/game-window.vala
index 0c47767..ce6b01a 100644
--- a/src/game-window.vala
+++ b/src/game-window.vala
@@ -378,6 +378,17 @@ private class GameWindow : AdaptativeWindow, AdaptativeWidget
         back ();
     }
 
+    internal bool new_game_screen_visible ()
+    {
+        string? stack_child = stack.get_visible_child_name ();
+        if (stack_child == null)
+            assert_not_reached ();
+        if ((!) stack_child == "game-box")
+            return false;
+        else
+            return true;
+    }
+
     /*\
     * * Game menu actions
     \*/


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