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

Proposed by Dalius
Status: Merged
Approved by: Dalius
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) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
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.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Riccardo Ferrazzo (f-riccardo87) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Simple/CalcKeyboard.qml'
--- Simple/CalcKeyboard.qml 2013-04-06 08:47:15 +0000
+++ Simple/CalcKeyboard.qml 2013-04-07 11:22:22 +0000
@@ -5,6 +5,9 @@
5 width: parent.width5 width: parent.width
6 height: grid.height+units.gu(4)6 height: grid.height+units.gu(4)
77
8 property int calcGridUnit: width / 50
9
10
8 Text {11 Text {
9 visible: formulaView.__wasAtYBegining && formulaView.__displaceDist > units.gu(2)12 visible: formulaView.__wasAtYBegining && formulaView.__displaceDist > units.gu(2)
10 font.pixelSize: units.gu(2)13 font.pixelSize: units.gu(2)
@@ -16,8 +19,8 @@
1619
17 Item {20 Item {
18 id: grid21 id: grid
19 width: units.gu(9)*4 + units.gu(2)*322 width: (calcGridUnit*9)*4 + (calcGridUnit*2)*3
20 height: units.gu(6)*5 + units.gu(2)*423 height: (calcGridUnit*6)*5 + (calcGridUnit*2)*4
2124
22 anchors{25 anchors{
23 top: parent.top26 top: parent.top
@@ -35,7 +38,7 @@
35 }38 }
3639
37 KeyboardButton {40 KeyboardButton {
38 x: units.gu(11)41 x: (calcGridUnit*11)
39 y: 042 y: 0
40 text: "±"43 text: "±"
41 onClicked: {44 onClicked: {
@@ -44,14 +47,14 @@
44 }47 }
4548
46 KeyboardButton {49 KeyboardButton {
47 x: units.gu(11)*250 x: (calcGridUnit*11)*2
48 y: 051 y: 0
49 text: "÷"52 text: "÷"
50 onClicked: formulaPush(text)53 onClicked: formulaPush(text)
51 }54 }
5255
53 KeyboardButton {56 KeyboardButton {
54 x: units.gu(11)*357 x: (calcGridUnit*11)*3
55 y: 058 y: 0
56 text: "×"59 text: "×"
57 onClicked: formulaPush(text)60 onClicked: formulaPush(text)
@@ -59,85 +62,85 @@
5962
60 KeyboardButton {63 KeyboardButton {
61 x: 064 x: 0
62 y: units.gu(8)65 y: (calcGridUnit*8)
63 text: "7"66 text: "7"
64 onClicked: formulaPush(text)67 onClicked: formulaPush(text)
65 }68 }
6669
67 KeyboardButton {70 KeyboardButton {
68 x: units.gu(11)71 x: (calcGridUnit*11)
69 y: units.gu(8)72 y: (calcGridUnit*8)
70 text: "8"73 text: "8"
71 onClicked: formulaPush(text)74 onClicked: formulaPush(text)
72 }75 }
7376
74 KeyboardButton {77 KeyboardButton {
75 x: units.gu(11)*278 x: (calcGridUnit*11)*2
76 y: units.gu(8)79 y: (calcGridUnit*8)
77 text: "9"80 text: "9"
78 onClicked: formulaPush(text)81 onClicked: formulaPush(text)
79 }82 }
8083
81 KeyboardButton {84 KeyboardButton {
82 x: units.gu(11)*385 x: (calcGridUnit*11)*3
83 y: units.gu(8)86 y: (calcGridUnit*8)
84 text: "−"87 text: "−"
85 onClicked: formulaPush(text)88 onClicked: formulaPush(text)
86 }89 }
8790
88 KeyboardButton {91 KeyboardButton {
89 x: 092 x: 0
90 y: units.gu(8)*293 y: (calcGridUnit*8)*2
91 text: "4"94 text: "4"
92 onClicked: formulaPush(text)95 onClicked: formulaPush(text)
93 }96 }
9497
95 KeyboardButton {98 KeyboardButton {
96 x: units.gu(11)99 x: (calcGridUnit*11)
97 y: units.gu(8)*2100 y: (calcGridUnit*8)*2
98 text: "5"101 text: "5"
99 onClicked: formulaPush(text)102 onClicked: formulaPush(text)
100 }103 }
101104
102 KeyboardButton {105 KeyboardButton {
103 x: units.gu(11)*2106 x: (calcGridUnit*11)*2
104 y: units.gu(8)*2107 y: (calcGridUnit*8)*2
105 text: "6"108 text: "6"
106 onClicked: formulaPush(text)109 onClicked: formulaPush(text)
107 }110 }
108111
109 KeyboardButton {112 KeyboardButton {
110 x: units.gu(11)*3113 x: (calcGridUnit*11)*3
111 y: units.gu(8)*2114 y: (calcGridUnit*8)*2
112 text: "+"115 text: "+"
113 onClicked: formulaPush(text)116 onClicked: formulaPush(text)
114 }117 }
115118
116 KeyboardButton {119 KeyboardButton {
117 x: 0120 x: 0
118 y: units.gu(8)*3121 y: (calcGridUnit*8)*3
119 text: "1"122 text: "1"
120 onClicked: formulaPush(text)123 onClicked: formulaPush(text)
121 }124 }
122125
123 KeyboardButton {126 KeyboardButton {
124 x: units.gu(11)127 x: (calcGridUnit*11)
125 y: units.gu(8)*3128 y: (calcGridUnit*8)*3
126 text: "2"129 text: "2"
127 onClicked: formulaPush(text)130 onClicked: formulaPush(text)
128 }131 }
129132
130 KeyboardButton {133 KeyboardButton {
131 x: units.gu(11)*2134 x: (calcGridUnit*11)*2
132 y: units.gu(8)*3135 y: (calcGridUnit*8)*3
133 text: "3"136 text: "3"
134 onClicked: formulaPush(text)137 onClicked: formulaPush(text)
135 }138 }
136139
137 KeyboardButton {140 KeyboardButton {
138 x: units.gu(11)*3141 x: (calcGridUnit*11)*3
139 y: units.gu(8)*3142 y: (calcGridUnit*8)*3
140 height: units.gu(14)143 height: (calcGridUnit*14)
141 text: "="144 text: "="
142 onClicked: {145 onClicked: {
143 calculate();146 calculate();
@@ -146,15 +149,15 @@
146149
147 KeyboardButton {150 KeyboardButton {
148 x: 0151 x: 0
149 y: units.gu(8)*4152 y: (calcGridUnit*8)*4
150 width: units.gu(20)153 width: (calcGridUnit*20)
151 text: "0"154 text: "0"
152 onClicked: formulaPush(text)155 onClicked: formulaPush(text)
153 }156 }
154157
155 KeyboardButton {158 KeyboardButton {
156 x: units.gu(11)*2159 x: (calcGridUnit*11)*2
157 y: units.gu(8)*4160 y: (calcGridUnit*8)*4
158 text: "."161 text: "."
159 onClicked: formulaPush(text)162 onClicked: formulaPush(text)
160 }163 }
161164
=== modified file 'Simple/KeyboardButton.qml'
--- Simple/KeyboardButton.qml 2013-03-14 09:38:40 +0000
+++ Simple/KeyboardButton.qml 2013-04-07 11:22:22 +0000
@@ -3,9 +3,9 @@
33
4Rectangle {4Rectangle {
5 id: buttonRect5 id: buttonRect
6 width: units.gu(9)6 width: (calcGridUnit*9)
7 height: units.gu(6)7 height: (calcGridUnit*6)
8 radius: units.gu(1)8 radius: (calcGridUnit*1)
9 color: buttonMA.pressed ? "#c0c0c0" : "white"9 color: buttonMA.pressed ? "#c0c0c0" : "white"
1010
11 property alias text: buttonText.text11 property alias text: buttonText.text
@@ -17,7 +17,7 @@
17 id: buttonText17 id: buttonText
18 anchors.centerIn: parent18 anchors.centerIn: parent
19 color: "#dd4814"19 color: "#dd4814"
20 font.pixelSize: units.gu(3)20 font.pixelSize: (calcGridUnit*3)
21 font.family: "Ubuntu"21 font.family: "Ubuntu"
22 }22 }
2323
2424
=== modified file 'ubuntu-calculator-app.qml'
--- ubuntu-calculator-app.qml 2013-03-22 17:12:16 +0000
+++ ubuntu-calculator-app.qml 2013-04-07 11:22:22 +0000
@@ -18,10 +18,6 @@
18 width: units.gu(50)18 width: units.gu(50)
19 height: units.gu(75)19 height: units.gu(75)
2020
21 Component.onCompleted: {
22 units.gridUnit = width / 50
23 }
24
25 Storage{21 Storage{
26 id: storage22 id: storage
27 }23 }

Subscribers

People subscribed via source and target branches