~mefrio-g/ubuntu-clock-app/fix-1272470

« back to all changes in this revision

Viewing changes to alarm/AlarmFace.qml

  • Committer: Tarmac
  • Author(s): Nekhelesh Ramananthan
  • Date: 2014-01-13 12:23:30 UTC
  • mfrom: (287.1.10 settings-page)
  • Revision ID: tarmac-20140113122330-8hlcpf8ow5p3yb5t
- Add settings page to expose the setting to switch between 12/24 hour format
- Used u1db to store these settings
- Clock and Alarms Page respect these settings. Fixes: https://bugs.launchpad.net/bugs/1268158.

Approved by Ubuntu Phone Apps Jenkins Bot, Riccardo Padovani.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    id: alarmFace
26
26
 
27
27
    property alias showSetupMessage: setupMessage.visible
 
28
    property bool isMilitaryFormat: appSetting.contents.timeFormat === "12-hour" ? false : true
28
29
 
29
30
    showSecondHand: false
30
31
 
31
 
    onMinutesChanged: innerLabel.text = Utils.zeroleft(Utils.hourstoCirclePosition(hours), 2) + ":" + Utils.zeroleft(minutes, 2)
32
 
    onHoursChanged: innerLabel.text = Utils.zeroleft(Utils.hourstoCirclePosition(hours), 2) + ":" + Utils.zeroleft(minutes, 2)
 
32
    onMinutesChanged: innerLabel.text = Utils.convertTime(Utils.hourstoCirclePosition(hours), minutes, 0, appSetting.contents.timeFormat)
 
33
    onHoursChanged: innerLabel.text = Utils.convertTime(Utils.hourstoCirclePosition(hours), minutes, 0, appSetting.contents.timeFormat)
 
34
    onIsMilitaryFormatChanged: innerLabel.text = Utils.convertTime(Utils.hourstoCirclePosition(hours), minutes, 0, appSetting.contents.timeFormat)
33
35
 
34
36
    innerLabel.visible: !setupMessage.visible
35
 
    innerLabel.text: Utils.zeroleft(Utils.hourstoCirclePosition(hours), 2) + ":" + Utils.zeroleft(minutes, 2)
 
37
    innerLabel.font.pixelSize: !isMilitaryFormat ? units.dp(31): units.dp(41)
 
38
    innerLabel.text: Utils.convertTime(Utils.hourstoCirclePosition(hours), minutes, 0, appSetting.contents.timeFormat)
36
39
 
37
40
    Label {
38
41
        id: setupMessage