[gnome-sudoku] Disable the board when the game is paused
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sudoku] Disable the board when the game is paused
- Date: Mon, 15 Sep 2014 21:40:12 +0000 (UTC)
commit 930d94aabeb96aefe60262b050588558dad8ad9f
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Aug 31 11:22:34 2014 -0500
Disable the board when the game is paused
https://bugzilla.gnome.org/show_bug.cgi?id=732779
src/sudoku-view.vala | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/sudoku-view.vala b/src/sudoku-view.vala
index 831b95f..da7bc1e 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -142,7 +142,7 @@ private class SudokuCellView : Gtk.DrawingArea
if (!is_focus)
grab_focus ();
- if (is_fixed)
+ if (is_fixed || game.paused)
return false;
if (popover.visible || earmark_popover.visible)
@@ -218,7 +218,7 @@ private class SudokuCellView : Gtk.DrawingArea
public override bool key_press_event (Gdk.EventKey event)
{
- if (is_fixed)
+ if (is_fixed || game.paused)
return false;
string k_name = Gdk.keyval_name (event.keyval);
int k_no = int.parse (k_name);
@@ -276,6 +276,9 @@ private class SudokuCellView : Gtk.DrawingArea
else
c.set_source_rgb (0.0, 0.0, 0.0);
+ if (game.paused)
+ return false;
+
if (value != 0)
{
int width, height;
@@ -424,6 +427,9 @@ public class SudokuView : Gtk.AspectFrame
cell.background_color = cell.is_fixed ? fixed_cell_color : free_cell_color;
cell.focus_in_event.connect (() => {
+ if (game.paused)
+ return false;
+
this.set_selected (cell_row, cell_col);
for (var col_tmp = 0; col_tmp < game.board.cols; col_tmp++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]