Merge lp:~dalius-sandbox/ubuntu-calculator-app/adaptive-keyboard-size into lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk

Proposed by Dalius on 2013-04-07
Status: Merged
Approved by: Dalius on 2013-04-07
Approved revision: 46
Merged at revision: 46
Proposed branch: lp:~dalius-sandbox/ubuntu-calculator-app/adaptive-keyboard-size
Merge into: lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk
Diff against target: 219 lines (+38/-39)
3 files modified
Simple/CalcKeyboard.qml (+34/-31)
Simple/KeyboardButton.qml (+4/-4)
ubuntu-calculator-app.qml (+0/-4)
To merge this branch: bzr merge lp:~dalius-sandbox/ubuntu-calculator-app/adaptive-keyboard-size
Reviewer Review Type Date Requested Status
Riccardo Ferrazzo (community) 2013-04-07 Approve on 2013-04-07
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2013-04-07
Review via email: mp+157540@code.launchpad.net

Commit message

Adjusting calculator keyboard to device's width.

Description of the change

Adjusting calculator keyboard to device's width.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Simple/CalcKeyboard.qml'
2--- Simple/CalcKeyboard.qml 2013-04-06 08:47:15 +0000
3+++ Simple/CalcKeyboard.qml 2013-04-07 11:22:22 +0000
4@@ -5,6 +5,9 @@
5 width: parent.width
6 height: grid.height+units.gu(4)
7
8+ property int calcGridUnit: width / 50
9+
10+
11 Text {
12 visible: formulaView.__wasAtYBegining && formulaView.__displaceDist > units.gu(2)
13 font.pixelSize: units.gu(2)
14@@ -16,8 +19,8 @@
15
16 Item {
17 id: grid
18- width: units.gu(9)*4 + units.gu(2)*3
19- height: units.gu(6)*5 + units.gu(2)*4
20+ width: (calcGridUnit*9)*4 + (calcGridUnit*2)*3
21+ height: (calcGridUnit*6)*5 + (calcGridUnit*2)*4
22
23 anchors{
24 top: parent.top
25@@ -35,7 +38,7 @@
26 }
27
28 KeyboardButton {
29- x: units.gu(11)
30+ x: (calcGridUnit*11)
31 y: 0
32 text: "±"
33 onClicked: {
34@@ -44,14 +47,14 @@
35 }
36
37 KeyboardButton {
38- x: units.gu(11)*2
39+ x: (calcGridUnit*11)*2
40 y: 0
41 text: "÷"
42 onClicked: formulaPush(text)
43 }
44
45 KeyboardButton {
46- x: units.gu(11)*3
47+ x: (calcGridUnit*11)*3
48 y: 0
49 text: "×"
50 onClicked: formulaPush(text)
51@@ -59,85 +62,85 @@
52
53 KeyboardButton {
54 x: 0
55- y: units.gu(8)
56+ y: (calcGridUnit*8)
57 text: "7"
58 onClicked: formulaPush(text)
59 }
60
61 KeyboardButton {
62- x: units.gu(11)
63- y: units.gu(8)
64+ x: (calcGridUnit*11)
65+ y: (calcGridUnit*8)
66 text: "8"
67 onClicked: formulaPush(text)
68 }
69
70 KeyboardButton {
71- x: units.gu(11)*2
72- y: units.gu(8)
73+ x: (calcGridUnit*11)*2
74+ y: (calcGridUnit*8)
75 text: "9"
76 onClicked: formulaPush(text)
77 }
78
79 KeyboardButton {
80- x: units.gu(11)*3
81- y: units.gu(8)
82+ x: (calcGridUnit*11)*3
83+ y: (calcGridUnit*8)
84 text: "−"
85 onClicked: formulaPush(text)
86 }
87
88 KeyboardButton {
89 x: 0
90- y: units.gu(8)*2
91+ y: (calcGridUnit*8)*2
92 text: "4"
93 onClicked: formulaPush(text)
94 }
95
96 KeyboardButton {
97- x: units.gu(11)
98- y: units.gu(8)*2
99+ x: (calcGridUnit*11)
100+ y: (calcGridUnit*8)*2
101 text: "5"
102 onClicked: formulaPush(text)
103 }
104
105 KeyboardButton {
106- x: units.gu(11)*2
107- y: units.gu(8)*2
108+ x: (calcGridUnit*11)*2
109+ y: (calcGridUnit*8)*2
110 text: "6"
111 onClicked: formulaPush(text)
112 }
113
114 KeyboardButton {
115- x: units.gu(11)*3
116- y: units.gu(8)*2
117+ x: (calcGridUnit*11)*3
118+ y: (calcGridUnit*8)*2
119 text: "+"
120 onClicked: formulaPush(text)
121 }
122
123 KeyboardButton {
124 x: 0
125- y: units.gu(8)*3
126+ y: (calcGridUnit*8)*3
127 text: "1"
128 onClicked: formulaPush(text)
129 }
130
131 KeyboardButton {
132- x: units.gu(11)
133- y: units.gu(8)*3
134+ x: (calcGridUnit*11)
135+ y: (calcGridUnit*8)*3
136 text: "2"
137 onClicked: formulaPush(text)
138 }
139
140 KeyboardButton {
141- x: units.gu(11)*2
142- y: units.gu(8)*3
143+ x: (calcGridUnit*11)*2
144+ y: (calcGridUnit*8)*3
145 text: "3"
146 onClicked: formulaPush(text)
147 }
148
149 KeyboardButton {
150- x: units.gu(11)*3
151- y: units.gu(8)*3
152- height: units.gu(14)
153+ x: (calcGridUnit*11)*3
154+ y: (calcGridUnit*8)*3
155+ height: (calcGridUnit*14)
156 text: "="
157 onClicked: {
158 calculate();
159@@ -146,15 +149,15 @@
160
161 KeyboardButton {
162 x: 0
163- y: units.gu(8)*4
164- width: units.gu(20)
165+ y: (calcGridUnit*8)*4
166+ width: (calcGridUnit*20)
167 text: "0"
168 onClicked: formulaPush(text)
169 }
170
171 KeyboardButton {
172- x: units.gu(11)*2
173- y: units.gu(8)*4
174+ x: (calcGridUnit*11)*2
175+ y: (calcGridUnit*8)*4
176 text: "."
177 onClicked: formulaPush(text)
178 }
179
180=== modified file 'Simple/KeyboardButton.qml'
181--- Simple/KeyboardButton.qml 2013-03-14 09:38:40 +0000
182+++ Simple/KeyboardButton.qml 2013-04-07 11:22:22 +0000
183@@ -3,9 +3,9 @@
184
185 Rectangle {
186 id: buttonRect
187- width: units.gu(9)
188- height: units.gu(6)
189- radius: units.gu(1)
190+ width: (calcGridUnit*9)
191+ height: (calcGridUnit*6)
192+ radius: (calcGridUnit*1)
193 color: buttonMA.pressed ? "#c0c0c0" : "white"
194
195 property alias text: buttonText.text
196@@ -17,7 +17,7 @@
197 id: buttonText
198 anchors.centerIn: parent
199 color: "#dd4814"
200- font.pixelSize: units.gu(3)
201+ font.pixelSize: (calcGridUnit*3)
202 font.family: "Ubuntu"
203 }
204
205
206=== modified file 'ubuntu-calculator-app.qml'
207--- ubuntu-calculator-app.qml 2013-03-22 17:12:16 +0000
208+++ ubuntu-calculator-app.qml 2013-04-07 11:22:22 +0000
209@@ -18,10 +18,6 @@
210 width: units.gu(50)
211 height: units.gu(75)
212
213- Component.onCompleted: {
214- units.gridUnit = width / 50
215- }
216-
217 Storage{
218 id: storage
219 }

Subscribers

People subscribed via source and target branches