[swell-foop] Moved play again from headerbar into game area (bgo#664978)
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [swell-foop] Moved play again from headerbar into game area (bgo#664978)
- Date: Mon, 29 Jan 2018 22:38:41 +0000 (UTC)
commit a0d4b8bd1bf3752957aae6aeeaa64d39d9b83ffd
Author: Robert Roth <robert roth off gmail com>
Date: Tue Jan 30 00:38:26 2018 +0200
Moved play again from headerbar into game area (bgo#664978)
src/game-view.vala | 23 ++++++++++++++++++++++-
src/swell-foop.vala | 7 -------
2 files changed, 22 insertions(+), 8 deletions(-)
---
diff --git a/src/game-view.vala b/src/game-view.vala
index 8035160..b14bf4a 100644
--- a/src/game-view.vala
+++ b/src/game-view.vala
@@ -316,6 +316,27 @@ public class GameView : Clutter.Group
game_actors.add_child (text);
text.add_constraint (new Clutter.AlignConstraint (this, Clutter.AlignAxis.BOTH, 0.5f));
text.animate_final_score (game.score);
+
+ var play_again_button = new Gtk.Button.with_mnemonic (_("_Play Again"));
+ play_again_button.width_request = 130;
+ play_again_button.height_request = 40;
+ play_again_button.action_name = "app.new-game";
+ play_again_button.show ();
+
+ var style = play_again_button.get_style_context ();
+ style.add_class ("suggested-action");
+
+ var button_actor = new GtkClutter.Actor.with_contents (play_again_button);
+ game_actors.add_child (button_actor);
+ button_actor.visible = true;
+ button_actor.add_constraint (new Clutter.AlignConstraint (this, Clutter.AlignAxis.X_AXIS, 0.5f));
+ button_actor.add_constraint (new Clutter.AlignConstraint (this, Clutter.AlignAxis.Y_AXIS, 0.88f));
+
+ button_actor.set_easing_mode (Clutter.AnimationMode.EASE_OUT_ELASTIC);
+ button_actor.set_easing_duration (2000);
+ button_actor.z_position = -50;
+ button_actor.set_opacity (255);
+
}
}
@@ -467,7 +488,7 @@ public class ScoreActor : Clutter.Group
public void animate_final_score (uint points)
{
- label.set_font_name ("Bitstrem Vera Sans 40");
+ label.set_font_name ("Bitstrem Vera Sans 30");
var points_label = ngettext (/* Label showing the number of points at the end of the game */
"%u point", "%u points", points).printf (points);
label.set_markup ("<b>%s</b>\n%s".printf (_("Game Over!"), points_label));
diff --git a/src/swell-foop.vala b/src/swell-foop.vala
index 8c5691c..b7d64fe 100644
--- a/src/swell-foop.vala
+++ b/src/swell-foop.vala
@@ -157,13 +157,6 @@ public class SwellFoop : Gtk.Application
headerbar.show_close_button = true;
window.set_titlebar (headerbar);
- var new_game_button = new Gtk.Button.from_icon_name ("view-refresh-symbolic",
Gtk.IconSize.SMALL_TOOLBAR);
- new_game_button.valign = Gtk.Align.CENTER;
- new_game_button.action_name = "app.new-game";
- new_game_button.tooltip_text = _("Start a new game");
- new_game_button.show ();
- headerbar.pack_start (new_game_button);
-
/* show the current score */
update_score_cb (0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]