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

Proposed by Cris Dywan
Status: Merged
Approved by: Zsombor Egri
Approved revision: 1506
Merged at revision: 1509
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/noHandlerWhenEmpty
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 47 lines (+10/-0)
3 files modified
modules/Ubuntu/Components/1.2/TextCursor.qml (+1/-0)
modules/Ubuntu/Components/1.3/TextCursor.qml (+1/-0)
tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py (+8/-0)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/noHandlerWhenEmpty
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+259320@code.launchpad.net

Commit message

Only show handlers if text isn't empty

To post a comment you must log in.
Revision history for this message
Zsombor Egri (zsombi) wrote :

Hehe, pretty straight forward, thanks!

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) 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
=== modified file 'modules/Ubuntu/Components/1.2/TextCursor.qml'
--- modules/Ubuntu/Components/1.2/TextCursor.qml 2015-04-30 08:32:44 +0000
+++ modules/Ubuntu/Components/1.2/TextCursor.qml 2015-05-18 05:39:57 +0000
@@ -145,6 +145,7 @@
145 property: "visible"145 property: "visible"
146 value: QuickUtils.touchScreenAvailable146 value: QuickUtils.touchScreenAvailable
147 && (contextMenuVisible || !typing)147 && (contextMenuVisible || !typing)
148 && handler.main.text !== ""
148 }149 }
149 property bool typing: false150 property bool typing: false
150 property bool contextMenuVisible: false151 property bool contextMenuVisible: false
151152
=== modified file 'modules/Ubuntu/Components/1.3/TextCursor.qml'
--- modules/Ubuntu/Components/1.3/TextCursor.qml 2015-04-29 08:55:31 +0000
+++ modules/Ubuntu/Components/1.3/TextCursor.qml 2015-05-18 05:39:57 +0000
@@ -146,6 +146,7 @@
146 property: "visible"146 property: "visible"
147 value: QuickUtils.touchScreenAvailable147 value: QuickUtils.touchScreenAvailable
148 && (contextMenuVisible || !typing)148 && (contextMenuVisible || !typing)
149 && handler.main.text !== ""
149 }150 }
150 property bool typing: false151 property bool typing: false
151 property bool contextMenuVisible: false152 property bool contextMenuVisible: false
152153
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py'
--- tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py 2015-04-14 21:02:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_textinput.py 2015-05-18 05:39:57 +0000
@@ -70,11 +70,19 @@
70 return self.main_view.select_single(70 return self.main_view.select_single(
71 objectName=positionProperty + '_draggeditem')71 objectName=positionProperty + '_draggeditem')
7272
73 def test_caret_hidden_if_empty(self):
74 cursorName = 'text_cursor_style_caret_cursorPosition'
75 self._assert_not_visible(objectName=cursorName)
76 self.pointing_device.click_object(self.textfield)
77 self.assertTrue(self.textfield.focus)
78 self._assert_not_visible(objectName=cursorName)
79
73 def test_caret_visible_on_focus(self):80 def test_caret_visible_on_focus(self):
74 cursorName = 'text_cursor_style_caret_cursorPosition'81 cursorName = 'text_cursor_style_caret_cursorPosition'
75 self._assert_not_visible(objectName=cursorName)82 self._assert_not_visible(objectName=cursorName)
76 self.pointing_device.click_object(self.textfield)83 self.pointing_device.click_object(self.textfield)
77 self.assertTrue(self.textfield.focus)84 self.assertTrue(self.textfield.focus)
85 self.textfield.keyboard.type('Lorem ipsum')
78 self.main_view.select_single(objectName=cursorName)86 self.main_view.select_single(objectName=cursorName)
7987
80 def test_caret_hide_while_typing(self):88 def test_caret_hide_while_typing(self):

Subscribers

People subscribed via source and target branches