Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/orientationGoneWrong into lp:ubuntu-ui-toolkit/staging

Proposed by Cris Dywan
Status: Merged
Approved by: Tim Peeters
Approved revision: 1393
Merged at revision: 1408
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/orientationGoneWrong
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 118 lines (+63/-7)
3 files modified
modules/Ubuntu/Components/OrientationHelper.qml (+1/-1)
tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.header.qml (+33/-0)
tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py (+29/-6)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/orientationGoneWrong
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Tim Peeters Approve
Review via email: mp+247969@code.launchpad.net

Commit message

Take OrientationHelper y coordinate from real parent height

To post a comment you must log in.
Revision history for this message
Tim Peeters (tpeeters) wrote :

makes sense

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/OrientationHelper.qml'
2--- modules/Ubuntu/Components/OrientationHelper.qml 2015-01-09 14:35:43 +0000
3+++ modules/Ubuntu/Components/OrientationHelper.qml 2015-02-11 10:28:28 +0000
4@@ -98,7 +98,7 @@
5 property bool anchorToKeyboard: false
6
7 x: parent ? (parent.width - width) / 2 : 0
8- y: parent ? (d.availableParentHeight - height) / 2 : 0
9+ y: parent ? (parent.height - height) / 2 : 0
10 width: parent ? (d.flipDimensions ? d.availableParentHeight : parent.width) : 0
11 height: parent ? (d.flipDimensions ? parent.width : d.availableParentHeight) : 0
12
13
14=== added file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.header.qml'
15--- tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.header.qml 1970-01-01 00:00:00 +0000
16+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.header.qml 2015-02-11 10:28:28 +0000
17@@ -0,0 +1,33 @@
18+/*
19+ * Copyright 2015 Canonical Ltd.
20+ *
21+ * This program is free software; you can redistribute it and/or modify
22+ * it under the terms of the GNU Lesser General Public License as published by
23+ * the Free Software Foundation; version 3.
24+ *
25+ * This program is distributed in the hope that it will be useful,
26+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28+ * GNU Lesser General Public License for more details.
29+ *
30+ * You should have received a copy of the GNU Lesser General Public License
31+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
32+ */
33+
34+import QtQuick 2.0
35+import Ubuntu.Components 1.1
36+
37+MainView {
38+ width: units.gu(48)
39+ height: units.gu(60)
40+ useDeprecatedToolbar: false
41+
42+ Page {
43+ title: "Header"
44+ head.contents: TextField {
45+ objectName: "textfield"
46+ placeholderText: "Header"
47+ width: parent ? parent.width : 0
48+ }
49+ }
50+}
51
52=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py'
53--- tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py 2015-02-02 16:48:37 +0000
54+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py 2015-02-11 10:28:28 +0000
55@@ -103,17 +103,27 @@
56 dir_path, 'test_textinput.textarea.qml')
57 customfield_qml_file_path = os.path.join(
58 dir_path, 'test_textinput.textfield_custom.qml')
59+ header_qml_file_path = os.path.join(
60+ dir_path, 'test_textinput.header.qml')
61
62 scenarios = [
63 ('textfield',
64- dict(test_qml_file_path=textfield_qml_file_path,
65- objectName='textfield')),
66+ dict(test_qml_file_path=textfield_qml_file_path,
67+ objectName='textfield')),
68 ('textarea',
69- dict(test_qml_file_path=textarea_qml_file_path,
70- objectName='textarea')),
71+ dict(test_qml_file_path=textarea_qml_file_path,
72+ objectName='textarea')),
73 ('customfield',
74- dict(test_qml_file_path=customfield_qml_file_path,
75- objectName='textfield')),
76+ dict(test_qml_file_path=customfield_qml_file_path,
77+ objectName='textfield')),
78+ ('header',
79+ dict(test_qml_file_path=header_qml_file_path,
80+ objectName='textfield')),
81+ ]
82+ scenarios = [
83+ ('header',
84+ dict(test_qml_file_path=header_qml_file_path,
85+ objectName='textfield')),
86 ]
87
88 def get_command_line(self, command_line):
89@@ -142,9 +152,21 @@
90
91 self._assert_not_visible(objectName='text_input_contextmenu')
92
93+ def test_popover_not_obscured(self):
94+ self.pointing_device.click_object(self.textfield)
95+ cursor = self.main_view.select_single(
96+ objectName='text_cursor_style_cursorPosition')
97+ sleep(1)
98+ self.pointing_device.click_object(cursor)
99+ popover = self.main_view.get_text_input_context_menu(
100+ 'text_input_contextmenu')
101+ self.assertTrue(popover.globalRect.y > 0,
102+ '%s <= 0' % popover.globalRect.y)
103+
104 def test_popover_visible_after_tapping_caret(self):
105 # Insert Mode
106 self.pointing_device.click_object(self.textfield)
107+ sleep(1)
108 cursor = self.main_view.select_single(
109 objectName='text_cursor_style_cursorPosition')
110 if (self.textfield.text):
111@@ -158,6 +180,7 @@
112 # Insert Mode
113 self.pointing_device.click_object(self.textfield)
114 self.textfield.keyboard.type('Lorem ipsum')
115+ sleep(1)
116 cursor = self.main_view.select_single(
117 objectName='text_cursor_style_cursorPosition')
118 x, y = get_center_point(cursor)

Subscribers

People subscribed via source and target branches