Merge lp:~nik90/ubuntu-clock-app/universal-clockmarker into lp:ubuntu-clock-app/saucy

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Juha Ristolainen
Approved revision: 20
Merged at revision: 18
Proposed branch: lp:~nik90/ubuntu-clock-app/universal-clockmarker
Merge into: lp:ubuntu-clock-app/saucy
Diff against target: 91 lines (+12/-30)
4 files modified
common/AnalogClockMarker.qml (+8/-5)
common/Constants.js (+1/-0)
stopwatch/AnalogStopwatchMarker.qml (+0/-24)
stopwatch/StopwatchPage.qml (+3/-1)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/universal-clockmarker
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Marco Biscaro (community) Needs Fixing
Ubuntu Clock Developers Pending
Review via email: mp+154199@code.launchpad.net

Commit message

Refactored AnalogClockMarker to be more universal

Description of the change

The AnalogClockMarker is something we need to use in Timer, Clock, Alarm and also Stopwatch. Hence made that more universal. Also refactored the Stopwatch clock marker to use the common one instead of it own marker implementation.

To post a comment you must log in.
Revision history for this message
Marco Biscaro (marcobiscaro2112) wrote :

12 + property real radDistance: 0.45
13 + property string radColor: Constants.normalGrey
14 + property real radSize: 1

Why all properties have the "rad" prefix? I've only used radAngle to make clear this value is in radians (not in degrees), but I think the other properties don't need this prefix.

Also, no need to declare a new color property. You can just do:

color: Constants.normalGrey

review: Needs Fixing
19. By Nekhelesh Ramananthan

Fixed small mistakes

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

> 12 + property real radDistance: 0.45
> 13 + property string radColor: Constants.normalGrey
> 14 + property real radSize: 1
>
> Why all properties have the "rad" prefix? I've only used radAngle to make
> clear this value is in radians (not in degrees), but I think the other
> properties don't need this prefix.

True...I was thinking along the lines of radial distance from center and so on...but fixed that.

>
> Also, no need to declare a new color property. You can just do:
>
> color: Constants.normalGrey

true..my bad..still getting used to QML.

20. By Nekhelesh Ramananthan

Merge with trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'common/AnalogClockMarker.qml'
2--- common/AnalogClockMarker.qml 2013-03-18 18:51:11 +0000
3+++ common/AnalogClockMarker.qml 2013-03-19 22:13:22 +0000
4@@ -1,23 +1,26 @@
5 import QtQuick 2.0
6 import Ubuntu.Components 0.1
7+import "Constants.js" as Constants
8
9 Rectangle {
10 property int number
11 property real radAngle: (number % 12 * 30) * Math.PI / 180
12+ property real distance: 0.45
13+ property real size: 1
14
15- width: units.gu(1)
16- height: units.gu(1)
17+ width: units.gu(size)
18+ height: units.gu(size)
19 z: 1
20
21- color: "#D3D3D3"
22+ color: Constants.normalGrey
23 radius: width / 2
24 antialiasing: true
25
26 anchors.centerIn: parent
27
28 transform: Translate {
29- x: parent.width * 0.45 * Math.sin(radAngle)
30- y: parent.height * 0.45 * Math.cos(radAngle)
31+ x: parent.width * distance * Math.sin(radAngle)
32+ y: parent.height * distance * Math.cos(radAngle)
33 }
34
35 }
36
37=== modified file 'common/Constants.js'
38--- common/Constants.js 2013-03-17 21:09:19 +0000
39+++ common/Constants.js 2013-03-19 22:13:22 +0000
40@@ -15,5 +15,6 @@
41 var lightAubergine = "#77216F"
42 var warmGrey = "#AEA79F"
43 var coolGrey = "#333333"
44+var normalGrey = "#D3D3D3"
45 var pitchBlack = "#000000"
46 var brightWhite = "#FFFFFF"
47
48=== removed file 'stopwatch/AnalogStopwatchMarker.qml'
49--- stopwatch/AnalogStopwatchMarker.qml 2013-03-17 21:09:19 +0000
50+++ stopwatch/AnalogStopwatchMarker.qml 1970-01-01 00:00:00 +0000
51@@ -1,24 +0,0 @@
52-import QtQuick 2.0
53-import Ubuntu.Components 0.1
54-import "../common/Constants.js" as Constants
55-
56-Rectangle {
57-
58- property int number
59- property real radAngle: (number % 12 * 30) * Math.PI / 180
60-
61- width: units.gu(0.5)
62- height: units.gu(0.5)
63- z: 1
64-
65- color: Constants.pitchBlack
66- radius: width / 2
67- antialiasing: true
68-
69- anchors.centerIn: parent
70-
71- transform: Translate {
72- x: parent.width * 0.45 * Math.sin(radAngle)
73- y: parent.height * 0.45 * Math.cos(radAngle)
74- }
75-}
76
77=== modified file 'stopwatch/StopwatchPage.qml'
78--- stopwatch/StopwatchPage.qml 2013-03-19 19:38:01 +0000
79+++ stopwatch/StopwatchPage.qml 2013-03-19 22:13:22 +0000
80@@ -56,8 +56,10 @@
81 Repeater {
82 model: ["1", "2", "4", "5", "7", "8", "10", "11"]
83
84- delegate: AnalogStopwatchMarker {
85+ delegate: AnalogClockMarker {
86 number: modelData
87+ size: 0.5
88+ color: Constants.pitchBlack
89 }
90 }
91 }

Subscribers

People subscribed via source and target branches