Merge lp:~michael-sheldon/ubuntu-keyboard/fix-1428584 into lp:ubuntu-keyboard

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
Approved revision: 335
Merged at revision: 336
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/fix-1428584
Merge into: lp:ubuntu-keyboard
Diff against target: 33 lines (+11/-1)
2 files modified
qml/keys/CharKey.qml (+5/-0)
tests/autopilot/ubuntu_keyboard/emulators/keypad.py (+6/-1)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/fix-1428584
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+252436@code.launchpad.net

Commit message

Account for keys at the side of the keyboard being extended in size when calculating autopilot key positions

Description of the change

Account for keys at the side of the keyboard being extended in size when calculating autopilot key positions

To post a comment you must log in.
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/ubuntu-keyboard) on device or emulator?

 * Yes

If you changed the UI, was the change specified/approved by design?

 * No change

If you changed UI labels, did you update the pot file?

 * No change

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?

 * No change

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/keys/CharKey.qml'
2--- qml/keys/CharKey.qml 2015-02-13 20:14:07 +0000
3+++ qml/keys/CharKey.qml 2015-03-10 13:59:05 +0000
4@@ -49,6 +49,11 @@
5 property bool leftSide: false
6 property bool rightSide: false
7
8+ // These properties are used by autopilot to determine the visible
9+ // portion of the key to press
10+ readonly property double leftOffset: buttonImage.anchors.leftMargin
11+ readonly property double rightOffset: buttonImage.anchors.rightMargin
12+
13 /* design */
14 property string imgNormal: UI.imageCharKey
15 property string imgPressed: UI.imageCharKeyPressed
16
17=== modified file 'tests/autopilot/ubuntu_keyboard/emulators/keypad.py'
18--- tests/autopilot/ubuntu_keyboard/emulators/keypad.py 2015-02-09 17:22:29 +0000
19+++ tests/autopilot/ubuntu_keyboard/emulators/keypad.py 2015-03-10 13:59:05 +0000
20@@ -43,7 +43,12 @@
21 def _iter_keys(key_type, label_fn):
22 for key in self.select_many(key_type):
23 with key.no_automatic_refreshing():
24- key_pos = Key.Pos(*key.globalRect)
25+ rect = key.globalRect
26+ if key.leftSide:
27+ rect = (key.globalRect[0] + key.leftOffset, key.globalRect[1], key.globalRect[2] - key.leftOffset, key.globalRect[3])
28+ elif key.rightSide:
29+ rect = (key.globalRect[0], key.globalRect[1], key.globalRect[2] - key.rightOffset, key.globalRect[3])
30+ key_pos = Key.Pos(*rect)
31 label = label_fn(key)
32 if label != '':
33 contained_keys[label] = KeyPadState.NORMAL

Subscribers

People subscribed via source and target branches