Merge lp:~nikwen/ubuntu-calculator-app/reboot-keyboard-buttons-haptic-feedback into lp:ubuntu-calculator-app

Proposed by Niklas Wenzel
Status: Merged
Merged at revision: 157
Proposed branch: lp:~nikwen/ubuntu-calculator-app/reboot-keyboard-buttons-haptic-feedback
Merge into: lp:ubuntu-calculator-app
Diff against target: 76 lines (+5/-20)
2 files modified
app/tests/autopilot/ubuntu_calculator_app/__init__.py (+3/-9)
app/ui/KeyboardButton.qml (+2/-11)
To merge this branch: bzr merge lp:~nikwen/ubuntu-calculator-app/reboot-keyboard-buttons-haptic-feedback
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Bartosz Kosiorek Approve
Review via email: mp+255884@code.launchpad.net

Commit message

Added haptic feedback to keyboard buttons by removing unnecessary MouseArea

Description of the change

Added haptic feedback to keyboard buttons by removing unnecessary MouseArea

To post a comment you must log in.
Revision history for this message
Niklas Wenzel (nikwen) wrote :

Sorry for creating multiple merge proposals. I messed up some branches.

Revision history for this message
Bartosz Kosiorek (gang65) wrote :

Very nice improvement. I didn't notice that issue previously.

Thanks Niklas.

review: Approve
Revision history for this message
Niklas Wenzel (nikwen) wrote :

Wow, thanks for the fast approval. Let's see what the automatic test results say. ;)

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
Niklas Wenzel (nikwen) wrote :

Great. Someone who wants to do a top-level approve?

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
Niklas Wenzel (nikwen) wrote :

Thanks for merging. :)

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Niklas Wenzel (nikwen) wrote :

Why did it try to merge that twice? Jenkins Bot issues?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/tests/autopilot/ubuntu_calculator_app/__init__.py'
2--- app/tests/autopilot/ubuntu_calculator_app/__init__.py 2015-03-12 21:44:31 +0000
3+++ app/tests/autopilot/ubuntu_calculator_app/__init__.py 2015-04-10 19:41:27 +0000
4@@ -99,12 +99,9 @@
5 button = self.wait_select_single('KeyboardButton',
6 objectName=MainView.BUTTONS[button])
7
8- button_area = button.wait_select_single('QQuickMouseArea',
9- objectName='buttonMA')
10-
11 self.pointing_device.move_to_object(button)
12 self.pointing_device.press()
13- button_area.pressed.wait_for(True)
14+ button.pressed.wait_for(True)
15 sleep(3)
16 self.pointing_device.release()
17
18@@ -112,9 +109,6 @@
19 button = self.wait_select_single('KeyboardButton',
20 objectName=MainView.BUTTONS[button])
21
22- button_area = button.wait_select_single('QQuickMouseArea',
23- objectName='buttonMA')
24-
25 self.pointing_device.move_to_object(button)
26 # we use press and release so we can check the qml property
27 # and ensure the button is pressed long enough to be recieved
28@@ -125,9 +119,9 @@
29 # balloons 2015-01-29
30 self.pointing_device.press()
31 # this sleeps represents our minimum press time,
32- # should button_area.pressed be true without any wait
33+ # should button.pressed be true without any wait
34 sleep(0.1)
35- button_area.pressed.wait_for(True)
36+ button.pressed.wait_for(True)
37 self.pointing_device.release()
38
39 def get_history(self):
40
41=== modified file 'app/ui/KeyboardButton.qml'
42--- app/ui/KeyboardButton.qml 2015-03-26 11:35:40 +0000
43+++ app/ui/KeyboardButton.qml 2015-04-10 19:41:27 +0000
44@@ -32,7 +32,6 @@
45
46 readonly property bool kbdPressed: JSON.parse(model.kbdKeys).indexOf(pressedKey) > -1 || (pressedKeyText == text)
47
48-
49 onKbdPressedChanged: {
50 if (!kbdPressed) {
51 buttonRect.clicked();
52@@ -44,7 +43,7 @@
53 anchors.fill: parent
54 border.color: "#d0d0d0"
55 border.width: units.dp(2)
56- color: buttonMA.pressed || buttonRect.kbdPressed ? pressedColor : buttonColor
57+ color: buttonRect.pressed || buttonRect.kbdPressed ? pressedColor : buttonColor
58
59 Behavior on color {
60 ColorAnimation {
61@@ -60,14 +59,6 @@
62 font.pixelSize: 0.5 * parent.height
63 font.bold: true
64
65- styleColor: "gray"
66- }
67-
68- MouseArea {
69- id: buttonMA
70- objectName: "buttonMA"
71- anchors.fill: parent
72- onClicked: buttonRect.clicked();
73- onPressAndHold: buttonRect.pressAndHold();
74+ styleColor: "gray"
75 }
76 }

Subscribers

People subscribed via source and target branches