~rick-rickspencer3/+junk/DCBusit

« back to all changes in this revision

Viewing changes to components/NextBusLabel.qml

  • Committer: Rick Spencer
  • Date: 2013-12-09 14:43:46 UTC
  • Revision ID: rick.spencer@canonical.com-20131209144346-k5c38w22wtrbm64f
made bus labels shorter and added wrapping to deal with not being able to see times for next buses when they go outide tthe bounds of the screen due to long direction names

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
Label
5
5
 {
6
6
     id: nextBusItem
7
 
     anchors.horizontalCenter: parent.horizontalCenter
 
7
     width: parent.width
 
8
     horizontalAlignment: Text.AlignHCenter
8
9
     property var prediction: null
9
10
     text: i18n.tr("Looking for next bus")
 
11
     wrapMode: Text.Wrap
 
12
 
10
13
     onPredictionChanged:
11
14
     {
12
15
         if(!prediction)
16
19
         else
17
20
         {
18
21
 
19
 
             var string1 = "<b>%1 minute</b>  until bus %2 to %3"
20
 
             var string2 = "<b>%1 minutes</b>  until bus %2 to %3"
 
22
             var string1 = "<b>%1 minute</b>: %2 to %3"
 
23
             var string2 = "<b>%1 minutes</b>: %2 to %3"
21
24
             text = i18n.tr(string1,string2,prediction["Minutes"]).arg(parseInt(prediction["Minutes"])).arg(prediction["RouteID"]).arg(prediction["DirectionText"])
22
25
         }
23
26
     }