[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [gcompris] src/activities/clockgame: clockgame, set the time to find question in ful text
From:       Bruno Coudoin <bruno.coudoin () gcompris ! net>
Date:       2016-02-10 21:34:59
Message-ID: E1aTcPb-0004nl-Am () scm ! kde ! org
[Download RAW message or body]

Git commit 68402a3e767dde62e4150fb509b5589b1e0999a8 by Bruno Coudoin.
Committed on 10/02/2016 at 21:32.
Pushed by bcoudoin into branch 'master'.

clockgame, set the time to find question in ful text

The children had no way to understand the question.
We still miss a first intro that would let the children understand
what represent each needle.

M  +15   -4    src/activities/clockgame/Clockgame.qml

http://commits.kde.org/gcompris/68402a3e767dde62e4150fb509b5589b1e0999a8

diff --git a/src/activities/clockgame/Clockgame.qml b/src/activities/clockgame/Clockgame.qml
index 93d3998..1616eba 100644
--- a/src/activities/clockgame/Clockgame.qml
+++ b/src/activities/clockgame/Clockgame.qml
@@ -103,20 +103,31 @@ ActivityBase {
             GCText {
                 id: questionItem
                 text: qsTr("Set the watch to:") + " " +
-                      Activity.get2CharValue(
-                          items.targetH) + ":" + Activity.get2CharValue(
-                          items.targetM) + ":" + Activity.get2CharValue(
-                          items.targetS)
+                      //~ singular %n hour
+                      //~ plural %n hours
+                      addNbsp(qsTr("%n hour(s)", "", items.targetH)) + " " +
+                      //~ singular %n minute
+                      //~ plural %n minutes
+                      addNbsp(qsTr("%n&nbsp;minute(s)", "", items.targetM)) +
+                      //~ singular %n second
+                      //~ plural %n seconds
+                      (s.visible ? " " + addNbsp(qsTr("%n second(s)", "", items.targetS)) : "")
                 fontSize: 18
+                textFormat: Text.RichText
                 font.weight: Font.DemiBold
                 color: "white"
                 horizontalAlignment: Text.AlignHCenter
                 wrapMode: Text.WordWrap
+                width: clock.width
                 anchors {
                     horizontalCenter: parent.horizontalCenter
                     top: parent.top
                     margins: 10
                 }
+                // We don't want the wrapping to happen anywhere, set no break space
+                function addNbsp(str) {
+                    return str.replace(" ", "&nbsp;");
+                }
             }
         }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic