[gnome-nibbles/arnaudb/modernize-code: 31/58] Create Scoreboard in UI file.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles/arnaudb/modernize-code: 31/58] Create Scoreboard in UI file.
- Date: Wed, 10 Jun 2020 17:15:32 +0000 (UTC)
commit aa285b92ee7f817a670e725d91bd6cc82e6adb82
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Wed May 27 18:36:02 2020 +0200
Create Scoreboard in UI file.
data/nibbles.ui | 8 ++++++++
src/nibbles-window.vala | 5 +----
2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/data/nibbles.ui b/data/nibbles.ui
index 38cf6b4..033ec48 100644
--- a/data/nibbles.ui
+++ b/data/nibbles.ui
@@ -467,6 +467,14 @@
<property name="name">countdown</property>
</packing>
</child>
+ <child>
+ <object class="Scoreboard" id="scoreboard">
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="name">scoreboard</property>
+ </packing>
+ </child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
diff --git a/src/nibbles-window.vala b/src/nibbles-window.vala
index 86a4cdc..620c6a3 100644
--- a/src/nibbles-window.vala
+++ b/src/nibbles-window.vala
@@ -64,7 +64,7 @@ private class NibblesWindow : ApplicationWindow
/* Statusbar widgets */
[GtkChild] private Stack statusbar_stack;
[GtkChild] private Label countdown;
- private Scoreboard scoreboard;
+ [GtkChild] private Scoreboard scoreboard;
private Gdk.Pixbuf scoreboard_life;
/* Preferences dialog */
@@ -178,10 +178,7 @@ private class NibblesWindow : ApplicationWindow
game_box.pack_start (frame);
/* Create scoreboard */
- scoreboard = new Scoreboard ();
scoreboard_life = view.load_pixmap_file ("scoreboard-life.svg", 2 * game.tile_size, 2 *
game.tile_size);
- scoreboard.show ();
- statusbar_stack.add_named (scoreboard, "scoreboard");
frame.add (view);
frame.show ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]