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

Proposed by Cris Dywan
Status: Merged
Approved by: Zsombor Egri
Approved revision: 1269
Merged at revision: 1271
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/noReadOnlyClearance
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 33 lines (+4/-1)
2 files modified
modules/Ubuntu/Components/TextField.qml (+2/-1)
tests/unit_x11/tst_components/tst_textfield.qml (+2/-0)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/noReadOnlyClearance
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+236686@code.launchpad.net

Commit message

Read-only text fields mustn't have a clear button

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
1269. By Cris Dywan

Unit test that the clear button is hidden when the textField is readOnly

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

Nice'n'clear fix, thank you!

review: Approve
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/TextField.qml'
2--- modules/Ubuntu/Components/TextField.qml 2014-09-18 15:27:16 +0000
3+++ modules/Ubuntu/Components/TextField.qml 2014-10-01 15:11:07 +0000
4@@ -914,6 +914,7 @@
5 }
6 width: visible ? icon.width : 0
7 visible: control.hasClearButton &&
8+ !control.readOnly &&
9 (control.activeFocus && ((editor.text != "") || editor.inputMethodComposing))
10
11 Icon {
12@@ -922,7 +923,7 @@
13 width: units.gu(2.5)
14 height: width
15 // use icon from icon-theme
16- name: control.hasClearButton ? "clear-search" : ""
17+ name: control.hasClearButton && !control.readOnly ? "clear-search" : ""
18 }
19
20 onClicked: editor.text = ""
21
22=== modified file 'tests/unit_x11/tst_components/tst_textfield.qml'
23--- tests/unit_x11/tst_components/tst_textfield.qml 2014-08-31 19:24:19 +0000
24+++ tests/unit_x11/tst_components/tst_textfield.qml 2014-10-01 15:11:07 +0000
25@@ -260,6 +260,8 @@
26 compare(textField.readOnly, false, "readOnly is false by default")
27 textField.readOnly = true
28 compare(textField.readOnly, true, "set/get")
29+ var clearButton = findChild(textField, "clear_button")
30+ compare(clearButton.visible, false, "readOnly must not provide a clear button")
31 }
32
33 function test_0_secondaryItem() {

Subscribers

People subscribed via source and target branches