[gnome-games] gnomine: Remove the status bar and two horizontal separators
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] gnomine: Remove the status bar and two horizontal separators
- Date: Mon, 19 Dec 2011 03:21:15 +0000 (UTC)
commit 45fc6b6f54350ebcf1dbaf31d1a1531dd5d7334f
Author: Sophia Yu <sophia receiving gmail com>
Date: Sat Dec 17 21:35:55 2011 -0600
gnomine: Remove the status bar and two horizontal separators
gnomine/src/gnomine.vala | 52 +++++++++++++++++++++------------------------
1 files changed, 24 insertions(+), 28 deletions(-)
---
diff --git a/gnomine/src/gnomine.vala b/gnomine/src/gnomine.vala
index 6a1fa2f..b535eae 100644
--- a/gnomine/src/gnomine.vala
+++ b/gnomine/src/gnomine.vala
@@ -77,8 +77,20 @@ public class GnoMine
menubar.show ();
main_vbox.pack_start (menubar, false, false, 0);
+ /* status_box holds mine flag, game button and clock. This replaces the need of a status bar. */
+ var status_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
+ status_box.homogeneous = true;
+ main_vbox.pack_start (status_box, false, false, 0);
+ status_box.show ();
+
+ /* show the numbers of total and remaining mines */
+ flag_label = new Gtk.Label ("");
+ status_box.pack_start (flag_label, false, false, 0);
+ flag_label.show ();
+
+ /* the new game button is always center-aligned */
var new_game_button_alignment = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 0.0f);
- main_vbox.pack_start (new_game_button_alignment, false, false, 0);
+ status_box.pack_start (new_game_button_alignment, false, false, 0);
new_game_button_alignment.show ();
new_game_button = new Gtk.Button ();
@@ -102,33 +114,7 @@ public class GnoMine
face_box.pack_start (cool_face_image, false, false, 0);
face_box.pack_start (worried_face_image, false, false, 0);
- var separator = new Gtk.HSeparator ();
- main_vbox.pack_start (separator, false, false, 0);
- separator.show ();
-
- minefield_view = new MinefieldView ();
- minefield_view.set_use_question_marks (settings.get_boolean (KEY_USE_QUESTION_MARKS));
- minefield_view.set_use_overmine_warning (settings.get_boolean (KEY_USE_OVERMINE_WARNING));
- minefield_view.set_use_autoflag (settings.get_boolean (KEY_USE_AUTOFLAG));
- minefield_view.button_press_event.connect (view_button_press_event);
- minefield_view.look.connect (look_cb);
- minefield_view.unlook.connect (unlook_cb);
- main_vbox.pack_start (minefield_view, true, true, 0);
- minefield_view.show ();
-
- separator = new Gtk.HSeparator ();
- main_vbox.pack_start (separator, false, false, 0);
- separator.show ();
-
- var status_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
- status_box.homogeneous = true;
- main_vbox.pack_start (status_box, false, false, 0);
- status_box.show ();
-
- flag_label = new Gtk.Label ("");
- status_box.pack_start (flag_label, false, false, 0);
- flag_label.show ();
-
+ /* game clock */
var box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
status_box.pack_start (box, false, false, 0);
box.show ();
@@ -140,6 +126,16 @@ public class GnoMine
box.pack_start (clock, false, false, 0);
clock.show ();
+ minefield_view = new MinefieldView ();
+ minefield_view.set_use_question_marks (settings.get_boolean (KEY_USE_QUESTION_MARKS));
+ minefield_view.set_use_overmine_warning (settings.get_boolean (KEY_USE_OVERMINE_WARNING));
+ minefield_view.set_use_autoflag (settings.get_boolean (KEY_USE_AUTOFLAG));
+ minefield_view.button_press_event.connect (view_button_press_event);
+ minefield_view.look.connect (look_cb);
+ minefield_view.unlook.connect (unlook_cb);
+ main_vbox.pack_start (minefield_view, true, true, 0);
+ minefield_view.show ();
+
new_game ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]