Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/lockscreen/MainBlock.qml
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 44 | function startLogin() { | |||
---|---|---|---|---|---|
46 | 46 | | |||
47 | //this is partly because it looks nicer | 47 | //this is partly because it looks nicer | ||
48 | //but more importantly it works round a Qt bug that can trigger if the app is closed with a TextField focused | 48 | //but more importantly it works round a Qt bug that can trigger if the app is closed with a TextField focused | ||
49 | //See https://bugreports.qt.io/browse/QTBUG-55460 | 49 | //See https://bugreports.qt.io/browse/QTBUG-55460 | ||
50 | loginButton.forceActiveFocus(); | 50 | loginButton.forceActiveFocus(); | ||
51 | loginRequest(password); | 51 | loginRequest(password); | ||
52 | } | 52 | } | ||
53 | 53 | | |||
54 | RowLayout { | ||||
55 | Layout.fillWidth: true | ||||
56 | | ||||
54 | PlasmaComponents.TextField { | 57 | PlasmaComponents.TextField { | ||
55 | id: passwordBox | 58 | id: passwordBox | ||
56 | Layout.fillWidth: true | 59 | Layout.fillWidth: true | ||
57 | 60 | | |||
58 | placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password") | 61 | placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password") | ||
59 | focus: true | 62 | focus: true | ||
60 | echoMode: TextInput.Password | 63 | echoMode: TextInput.Password | ||
61 | inputMethodHints: Qt.ImhHiddenText | Qt.ImhSensitiveData | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText | 64 | inputMethodHints: Qt.ImhHiddenText | Qt.ImhSensitiveData | Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText | ||
Show All 25 Lines | 89 | onClearPassword: { | |||
87 | passwordBox.forceActiveFocus() | 90 | passwordBox.forceActiveFocus() | ||
88 | passwordBox.selectAll() | 91 | passwordBox.selectAll() | ||
89 | } | 92 | } | ||
90 | } | 93 | } | ||
91 | } | 94 | } | ||
92 | 95 | | |||
93 | PlasmaComponents.Button { | 96 | PlasmaComponents.Button { | ||
94 | id: loginButton | 97 | id: loginButton | ||
95 | Layout.fillWidth: true | 98 | implicitHeight: passwordBox.height - units.smallSpacing * 0.5 // otherwise it comes out taller than the password field | ||
davidedmundson: Please add
Accessible.name: "Unlock"
which helps screen readers | |||||
rooty: Is that how you do it? I just assumed it was the same as "text" | |||||
davidedmundson: Perfect. | |||||
96 | 99 | | |||
97 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Unlock") | 100 | PlasmaCore.IconItem { // no iconSource because if take away half a unit (implicitHeight), "go-next" gets cut off | ||
101 | anchors.fill: parent | ||||
102 | anchors.margins: units.smallSpacing | ||||
103 | source: "go-next" | ||||
104 | } | ||||
98 | onClicked: startLogin() | 105 | onClicked: startLogin() | ||
99 | } | 106 | } | ||
You don't need to add a separate iconItem; just give the button iconSource: "configure" ngraham: You don't need to add a separate `iconItem`; just give the button `iconSource: "configure"` | |||||
100 | } | 107 | } | ||
108 | } |
Please add
Accessible.name: "Unlock"
which helps screen readers