← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

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

 

Niklas Wenzel has proposed merging lp:~nikwen/ubuntu-calculator-app/reboot-keyboard-buttons-haptic-feedback into lp:ubuntu-calculator-app.

Commit message:
Added haptic feedback to keyboard buttons by removing unnecessary MouseArea

Requested reviews:
  Ubuntu Calculator Developers (ubuntu-calculator-dev)

For more details, see:
https://code.launchpad.net/~nikwen/ubuntu-calculator-app/reboot-keyboard-buttons-haptic-feedback/+merge/255884

Added haptic feedback to keyboard buttons by removing unnecessary MouseArea
-- 
Your team Ubuntu Calculator Developers is requested to review the proposed merge of lp:~nikwen/ubuntu-calculator-app/reboot-keyboard-buttons-haptic-feedback into lp:ubuntu-calculator-app.
=== modified file 'app/tests/autopilot/ubuntu_calculator_app/__init__.py'
--- app/tests/autopilot/ubuntu_calculator_app/__init__.py	2015-03-12 21:44:31 +0000
+++ app/tests/autopilot/ubuntu_calculator_app/__init__.py	2015-04-10 19:41:27 +0000
@@ -99,12 +99,9 @@
         button = self.wait_select_single('KeyboardButton',
                                          objectName=MainView.BUTTONS[button])
 
-        button_area = button.wait_select_single('QQuickMouseArea',
-                                                objectName='buttonMA')
-
         self.pointing_device.move_to_object(button)
         self.pointing_device.press()
-        button_area.pressed.wait_for(True)
+        button.pressed.wait_for(True)
         sleep(3)
         self.pointing_device.release()
 
@@ -112,9 +109,6 @@
         button = self.wait_select_single('KeyboardButton',
                                          objectName=MainView.BUTTONS[button])
 
-        button_area = button.wait_select_single('QQuickMouseArea',
-                                                objectName='buttonMA')
-
         self.pointing_device.move_to_object(button)
         # we use press and release so we can check the qml property
         # and ensure the button is pressed long enough to be recieved
@@ -125,9 +119,9 @@
         # balloons 2015-01-29
         self.pointing_device.press()
         # this sleeps represents our minimum press time,
-        # should button_area.pressed be true without any wait
+        # should button.pressed be true without any wait
         sleep(0.1)
-        button_area.pressed.wait_for(True)
+        button.pressed.wait_for(True)
         self.pointing_device.release()
 
     def get_history(self):

=== modified file 'app/ui/KeyboardButton.qml'
--- app/ui/KeyboardButton.qml	2015-03-26 11:35:40 +0000
+++ app/ui/KeyboardButton.qml	2015-04-10 19:41:27 +0000
@@ -32,7 +32,6 @@
 
     readonly property bool kbdPressed: JSON.parse(model.kbdKeys).indexOf(pressedKey) > -1 || (pressedKeyText == text)
 
-
     onKbdPressedChanged: {
         if (!kbdPressed) {
             buttonRect.clicked();
@@ -44,7 +43,7 @@
         anchors.fill: parent
         border.color: "#d0d0d0"
         border.width: units.dp(2)
-        color: buttonMA.pressed || buttonRect.kbdPressed ? pressedColor : buttonColor
+        color: buttonRect.pressed || buttonRect.kbdPressed ? pressedColor : buttonColor
 
         Behavior on color {
             ColorAnimation {
@@ -60,14 +59,6 @@
         font.pixelSize: 0.5 * parent.height
         font.bold: true
 
-         styleColor: "gray"
-    }
-
-    MouseArea {
-        id: buttonMA
-        objectName: "buttonMA"
-        anchors.fill: parent
-        onClicked: buttonRect.clicked();
-        onPressAndHold: buttonRect.pressAndHold();
+        styleColor: "gray"
     }
 }


References