[gnome-sudoku] Draw overlay over the board when game is paused
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sudoku] Draw overlay over the board when game is paused
- Date: Mon, 15 Sep 2014 21:40:17 +0000 (UTC)
commit 77f23dda2fe74fab05cc578a75028b6da2fe72c7
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Aug 31 11:22:47 2014 -0500
Draw overlay over the board when game is paused
https://bugzilla.gnome.org/show_bug.cgi?id=732779
src/sudoku-view.vala | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/sudoku-view.vala b/src/sudoku-view.vala
index da7bc1e..4fb6248 100644
--- a/src/sudoku-view.vala
+++ b/src/sudoku-view.vala
@@ -529,6 +529,23 @@ public class SudokuView : Gtk.AspectFrame
}
c.stroke ();
+ if (game.paused)
+ {
+ c.set_source_rgba (0, 0, 0, 0.75);
+ c.paint ();
+
+ c.select_font_face ("Sans", Cairo.FontSlant.NORMAL, Cairo.FontWeight.BOLD);
+ c.set_font_size (get_allocated_width () * 0.125);
+
+ /* Text on overlay when game is paused */
+ var text = _("Paused");
+ Cairo.TextExtents extents;
+ c.text_extents (text, out extents);
+ c.move_to (board_length/2.0 - extents.width/2.0, board_length/2.0 + extents.height/2.0);
+ c.set_source_rgb (1, 1, 1);
+ c.show_text (text);
+ }
+
return false;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]