Changeset View
Changeset View
Standalone View
Standalone View
sddm-theme/Login.qml
Show All 38 Lines | 34 | function startLogin() { | |||
---|---|---|---|---|---|
39 | //but more importantly it works round a Qt bug that can trigger if the app is closed with a TextField focused | 39 | //but more importantly it works round a Qt bug that can trigger if the app is closed with a TextField focused | ||
40 | //DAVE REPORT THE FRICKING THING AND PUT A LINK | 40 | //DAVE REPORT THE FRICKING THING AND PUT A LINK | ||
41 | loginButton.forceActiveFocus(); | 41 | loginButton.forceActiveFocus(); | ||
42 | loginRequest(username, password); | 42 | loginRequest(username, password); | ||
43 | } | 43 | } | ||
44 | 44 | | |||
45 | PlasmaComponents.TextField { | 45 | PlasmaComponents.TextField { | ||
46 | id: userNameInput | 46 | id: userNameInput | ||
47 | font.pointSize: 11 | 47 | font.pointSize: theme.defaultFont.pointSize + 1 | ||
48 | Layout.fillWidth: true | 48 | Layout.fillWidth: true | ||
49 | 49 | | |||
50 | text: lastUserName | 50 | text: lastUserName | ||
51 | visible: showUsernamePrompt | 51 | visible: showUsernamePrompt | ||
52 | focus: showUsernamePrompt && !lastUserName //if there's a username prompt it gets focus first, otherwise password does | 52 | focus: showUsernamePrompt && !lastUserName //if there's a username prompt it gets focus first, otherwise password does | ||
53 | placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Username") | 53 | placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Username") | ||
54 | 54 | | |||
55 | onAccepted: | 55 | onAccepted: | ||
56 | if (root.loginScreenUiVisible) { | 56 | if (root.loginScreenUiVisible) { | ||
57 | passwordBox.forceActiveFocus() | 57 | passwordBox.forceActiveFocus() | ||
58 | } | 58 | } | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | PlasmaComponents.TextField { | 61 | PlasmaComponents.TextField { | ||
62 | id: passwordBox | 62 | id: passwordBox | ||
63 | font.pointSize: 11 | 63 | font.pointSize: theme.defaultFont.pointSize + 1 | ||
64 | Layout.fillWidth: true | 64 | Layout.fillWidth: true | ||
65 | 65 | | |||
66 | placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password") | 66 | placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password") | ||
67 | focus: !showUsernamePrompt || lastUserName | 67 | focus: !showUsernamePrompt || lastUserName | ||
68 | echoMode: TextInput.Password | 68 | echoMode: TextInput.Password | ||
69 | revealPasswordButtonShown: true | 69 | revealPasswordButtonShown: true | ||
70 | 70 | | |||
71 | onAccepted: { | 71 | onAccepted: { | ||
Show All 24 Lines | 94 | Connections { | |||
96 | onLoginFailed: { | 96 | onLoginFailed: { | ||
97 | passwordBox.selectAll() | 97 | passwordBox.selectAll() | ||
98 | passwordBox.forceActiveFocus() | 98 | passwordBox.forceActiveFocus() | ||
99 | } | 99 | } | ||
100 | } | 100 | } | ||
101 | } | 101 | } | ||
102 | PlasmaComponents.Button { | 102 | PlasmaComponents.Button { | ||
103 | id: loginButton | 103 | id: loginButton | ||
104 | font.pointSize: 11 | 104 | font.pointSize: theme.defaultFont.pointSize + 1 | ||
105 | Layout.fillWidth: true | 105 | Layout.fillWidth: true | ||
106 | 106 | | |||
107 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log In") | 107 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log In") | ||
108 | onClicked: startLogin(); | 108 | onClicked: startLogin(); | ||
109 | } | 109 | } | ||
110 | 110 | | |||
111 | } | 111 | } |