[iagno/wip/redesign] Hide the new game button when a game is in progress
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [iagno/wip/redesign] Hide the new game button when a game is in progress
- Date: Tue, 5 Nov 2013 04:31:26 +0000 (UTC)
commit 5bd723ad28d827f95aaa7d3f4520731f118ad84c
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Mon Nov 4 21:52:04 2013 -0600
Hide the new game button when a game is in progress
src/iagno.vala | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/iagno.vala b/src/iagno.vala
index 416a308..74c65f8 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -153,14 +153,12 @@ public class Iagno : Gtk.Application
scores_grid.attach (light_score_label, 2, 1, 1, 1);
new_game_button = new Gtk.Button ();
- new_game_button.show ();
var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 2);
box.show ();
var image = new Gtk.Image.from_icon_name ("view-refresh-symbolic", Gtk.IconSize.DIALOG);
image.show ();
box.pack_start (image);
- new_game_label = new Gtk.Label.with_mnemonic (_("_Start Over"));
- new_game_label.show ();
+ new_game_label = new Gtk.Label.with_mnemonic (_("Play _Again"));
box.pack_start (new_game_label);
new_game_button.add (box);
new_game_button.valign = Gtk.Align.END;
@@ -227,7 +225,8 @@ public class Iagno : Gtk.Application
game.complete.connect (game_complete_cb);
view.game = game;
- new_game_label.label = _("_Start Over");
+ new_game_button.hide ();
+ new_game_label.hide ();
var dark_level = settings.get_int ("black-level");
if (dark_level > 0)
@@ -280,6 +279,10 @@ public class Iagno : Gtk.Application
while (!game.can_move (game.current_color))
game.undo (2);
+ /* For undo after the end of the game */
+ new_game_button.hide ();
+ new_game_label.hide ();
+
game_move_cb (game);
}
@@ -374,7 +377,8 @@ public class Iagno : Gtk.Application
{
update_ui ();
play_sound ("gameover");
- new_game_label.label = _("Play _Again");
+ new_game_button.show ();
+ new_game_label.show ();
dark_active_image.visible = false;
light_active_image.visible = false;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]