Changeset View
Changeset View
Standalone View
Standalone View
sddm-theme/Login.qml
Show All 13 Lines | 9 | SessionManagementScreen { | |||
---|---|---|---|---|---|
14 | 14 | | |||
15 | property string lastUserName | 15 | property string lastUserName | ||
16 | property bool loginScreenUiVisible: false | 16 | property bool loginScreenUiVisible: false | ||
17 | 17 | | |||
18 | //the y position that should be ensured visible when the on screen keyboard is visible | 18 | //the y position that should be ensured visible when the on screen keyboard is visible | ||
19 | property int visibleBoundary: mapFromItem(loginButton, 0, 0).y | 19 | property int visibleBoundary: mapFromItem(loginButton, 0, 0).y | ||
20 | onHeightChanged: visibleBoundary = mapFromItem(loginButton, 0, 0).y + loginButton.height + units.smallSpacing | 20 | onHeightChanged: visibleBoundary = mapFromItem(loginButton, 0, 0).y + loginButton.height + units.smallSpacing | ||
21 | 21 | | |||
22 | property int fontSize: config.fontSize | ||||
23 | | ||||
22 | signal loginRequest(string username, string password) | 24 | signal loginRequest(string username, string password) | ||
23 | 25 | | |||
24 | onShowUsernamePromptChanged: { | 26 | onShowUsernamePromptChanged: { | ||
25 | if (!showUsernamePrompt) { | 27 | if (!showUsernamePrompt) { | ||
26 | lastUserName = "" | 28 | lastUserName = "" | ||
27 | } | 29 | } | ||
28 | } | 30 | } | ||
29 | 31 | | |||
Show All 9 Lines | 36 | function startLogin() { | |||
39 | //but more importantly it works round a Qt bug that can trigger if the app is closed with a TextField focused | 41 | //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 | 42 | //DAVE REPORT THE FRICKING THING AND PUT A LINK | ||
41 | loginButton.forceActiveFocus(); | 43 | loginButton.forceActiveFocus(); | ||
42 | loginRequest(username, password); | 44 | loginRequest(username, password); | ||
43 | } | 45 | } | ||
44 | 46 | | |||
45 | PlasmaComponents.TextField { | 47 | PlasmaComponents.TextField { | ||
46 | id: userNameInput | 48 | id: userNameInput | ||
47 | font.pointSize: theme.defaultFont.pointSize + 1 | 49 | font.pointSize: fontSize + 1 | ||
48 | Layout.fillWidth: true | 50 | Layout.fillWidth: true | ||
49 | 51 | | |||
50 | text: lastUserName | 52 | text: lastUserName | ||
51 | visible: showUsernamePrompt | 53 | visible: showUsernamePrompt | ||
52 | focus: showUsernamePrompt && !lastUserName //if there's a username prompt it gets focus first, otherwise password does | 54 | 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") | 55 | placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Username") | ||
54 | 56 | | |||
55 | onAccepted: | 57 | onAccepted: | ||
56 | if (root.loginScreenUiVisible) { | 58 | if (root.loginScreenUiVisible) { | ||
57 | passwordBox.forceActiveFocus() | 59 | passwordBox.forceActiveFocus() | ||
58 | } | 60 | } | ||
59 | } | 61 | } | ||
60 | 62 | | |||
61 | RowLayout { | 63 | RowLayout { | ||
62 | Layout.fillWidth: true | 64 | Layout.fillWidth: true | ||
63 | 65 | | |||
64 | PlasmaComponents.TextField { | 66 | PlasmaComponents.TextField { | ||
65 | id: passwordBox | 67 | id: passwordBox | ||
66 | font.pointSize: theme.defaultFont.pointSize + 1 | 68 | font.pointSize: fontSize + 1 | ||
67 | Layout.fillWidth: true | 69 | Layout.fillWidth: true | ||
68 | 70 | | |||
69 | placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password") | 71 | placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Password") | ||
70 | focus: !showUsernamePrompt || lastUserName | 72 | focus: !showUsernamePrompt || lastUserName | ||
71 | echoMode: TextInput.Password | 73 | echoMode: TextInput.Password | ||
72 | revealPasswordButtonShown: true | 74 | revealPasswordButtonShown: true | ||
73 | 75 | | |||
74 | onAccepted: { | 76 | onAccepted: { | ||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |