[five-or-more] Move the score to the subtitle
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [five-or-more] Move the score to the subtitle
- Date: Wed, 17 Oct 2018 19:28:18 +0000 (UTC)
commit 0751141b02d406a1daf6d756b8e6a935d39f78ac
Author: Robert Roth <robert roth off gmail com>
Date: Wed Oct 17 22:28:04 2018 +0300
Move the score to the subtitle
data/five-or-more.ui | 25 +------------------------
src/window.vala | 9 +++------
2 files changed, 4 insertions(+), 30 deletions(-)
---
diff --git a/data/five-or-more.ui b/data/five-or-more.ui
index 70e5783..5f68fd5 100644
--- a/data/five-or-more.ui
+++ b/data/five-or-more.ui
@@ -79,30 +79,6 @@
<property name="pack_type">end</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="scorelabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_end">2</property>
- <property name="label">0</property>
- </object>
- <packing>
- <property name="pack_type">end</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelScore">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Score:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="pack_type">end</property>
- </packing>
- </child>
</object>
</child>
<child>
@@ -137,3 +113,4 @@
</child>
</template>
</interface>
+
diff --git a/src/window.vala b/src/window.vala
index d34712d..7ce1f10 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -36,9 +36,6 @@ public class GameWindow : Gtk.ApplicationWindow
[GtkChild]
private Games.GridFrame grid_frame;
- [GtkChild]
- private Gtk.Label scorelabel;
-
private Settings? settings = null;
private bool window_tiled;
public bool window_maximized { get; private set; }
@@ -53,7 +50,7 @@ public class GameWindow : Gtk.ApplicationWindow
_("Match five objects of the same type in a row to score!"),
_("You can’t move there!"),
_("Game Over!"),
- null
+ _("Score: %d")
};
public GameWindow (Gtk.Application app, Settings settings)
@@ -75,8 +72,8 @@ public class GameWindow : Gtk.ApplicationWindow
grid_frame.set (game.n_cols, game.n_rows);
game.board.board_changed.connect (() => { grid_frame.set (game.n_cols, game.n_rows); });
- game.notify["score"].connect ((s, p) => { scorelabel.set_text (game.score.to_string ()); });
- game.notify["status-message"].connect ((s, p) => { set_status_message (status[game.status_message]);
});
+ game.notify["score"].connect ((s, p) => { set_status_message
(status[StatusMessage.NONE].printf(game.score)); });
+ game.notify["status-message"].connect ((s, p) => { set_status_message
(status[game.status_message].printf(game.score)); });
set_status_message (status[game.status_message]);
hbox.pack_start (grid_frame);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]