[libgames-support] Display times better on the scores dialog
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgames-support] Display times better on the scores dialog
- Date: Sun, 14 Feb 2016 23:41:23 +0000 (UTC)
commit 5f0c006fb0feaad360f6e9539f0393c73d96f337
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sun Feb 14 17:40:56 2016 -0600
Display times better on the scores dialog
games/scores/dialog.vala | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/games/scores/dialog.vala b/games/scores/dialog.vala
index 5066ed6..6b61d23 100644
--- a/games/scores/dialog.vala
+++ b/games/scores/dialog.vala
@@ -266,7 +266,20 @@ private class Dialog : Gtk.Dialog
rank.set_text (row_count.to_string ());
var score = (Gtk.Label) grid.get_child_at (1, row_count);
- score.set_text (x.score.to_string ());
+ if (scores_style == Style.POINTS_GREATER_IS_BETTER || scores_style == Style.POINTS_LESS_IS_BETTER)
+ {
+ score.set_text (x.score.to_string ());
+ }
+ else
+ {
+ var minutes = x.score / 60;
+ var seconds = x.score % 60;
+ score.set_text ("%s %s".printf (
+ /* Time which may be displayed on a scores dialog. */
+ ngettext ("%d minute", "%d minutes", minutes).printf (minutes),
+ /* Time which may be displayed on a scores dialog. */
+ ngettext ("%d second", "%d seconds", seconds).printf (seconds)));
+ }
if (new_high_score != null && Score.equals (x, new_high_score))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]