Changeset View
Standalone View
sddm-theme/Main.qml
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 72 | Timer { | |||
---|---|---|---|---|---|
76 | //it's been this way for all Plasma 5.x without a huge problem | 76 | //it's been this way for all Plasma 5.x without a huge problem | ||
77 | running: true | 77 | running: true | ||
78 | repeat: false | 78 | repeat: false | ||
79 | interval: 200 | 79 | interval: 200 | ||
80 | onTriggered: mainStack.forceActiveFocus() | 80 | onTriggered: mainStack.forceActiveFocus() | ||
81 | } | 81 | } | ||
82 | 82 | | |||
83 | initialItem: Login { | 83 | initialItem: Login { | ||
84 | id: userListComponent | ||||
84 | userListModel: userModel | 85 | userListModel: userModel | ||
85 | userListCurrentIndex: userModel.lastIndex >= 0 ? userModel.lastIndex : 0 | 86 | userListCurrentIndex: userModel.lastIndex >= 0 ? userModel.lastIndex : 0 | ||
87 | showUserList: (userListModel.count && userListModel.disableAvatarsThreshold) ? userListModel.count <= userListModel.disableAvatarsThreshold : true | ||||
broulik: This property does not exist in Login breaking the login screen! | |||||
It does? components/SessionManagementScreen which is a superclass of Login. davidedmundson: It does? components/SessionManagementScreen which is a superclass of Login. | |||||
86 | 88 | | |||
87 | notificationMessage: root.notificationMessage | 89 | notificationMessage: root.notificationMessage | ||
88 | 90 | | |||
89 | actionItems: [ | 91 | actionItems: [ | ||
90 | ActionButton { | 92 | ActionButton { | ||
91 | iconSource: "system-suspend" | 93 | iconSource: "system-suspend" | ||
92 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Suspend") | 94 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Suspend") | ||
93 | onClicked: sddm.suspend() | 95 | onClicked: sddm.suspend() | ||
Show All 9 Lines | 104 | ActionButton { | |||
103 | iconSource: "system-shutdown" | 105 | iconSource: "system-shutdown" | ||
104 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Shutdown") | 106 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Shutdown") | ||
105 | onClicked: sddm.powerOff() | 107 | onClicked: sddm.powerOff() | ||
106 | enabled: sddm.canPowerOff | 108 | enabled: sddm.canPowerOff | ||
107 | }, | 109 | }, | ||
108 | ActionButton { | 110 | ActionButton { | ||
109 | iconSource: "system-search" | 111 | iconSource: "system-search" | ||
110 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Different User") | 112 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Different User") | ||
111 | onClicked: mainStack.push(userPrompt) | 113 | onClicked: mainStack.push(userPromptComponent) | ||
112 | enabled: true | 114 | enabled: true | ||
115 | visible: !userListComponent.showUsernamePrompt | ||||
Why? If we're not showing the username prompt we won't be loading this component in the main view anyway. davidedmundson: Why? If we're not showing the username prompt we won't be loading this component in the main… | |||||
Note that before I started working on all this I saw two ways to do this commit: Option 1) Use the userPromptComponent (the "Login as different user" view), add buttons to suspend/reboot/shutdown, remove the "back" button which returns to the initial view , change the top put this view at the top of the stack, and cross my fingers so that if the userlist has visible: true but is not at the top of the stack, the avatars are not actually loaded. Option 2) Use the userListComponent (the default view), making the showUsernamePrompt true, removing the "Login as different user" option (since it's basically the same). And that last part is what the line above does. Option 1 means duplicating much code (the whole actionItems section) and I guess there's a way to extract that somewhere and reuse the actionItems section in both userPromptComponent and a new fullFeaturedUserPromptComponent, but I don't know that much QML to do that, so I choosed option 2. If you can spend some time explaining how to do it that way, I don't mind changing that. antlarr: Note that before I started working on all this I saw two ways to do this commit:
Option 1) Use… | |||||
113 | } | 116 | } | ||
114 | ] | 117 | ] | ||
115 | 118 | | |||
116 | onLoginRequest: { | 119 | onLoginRequest: { | ||
117 | root.notificationMessage = "" | 120 | root.notificationMessage = "" | ||
118 | sddm.login(username, password, sessionButton.currentIndex) | 121 | sddm.login(username, password, sessionButton.currentIndex) | ||
119 | } | 122 | } | ||
120 | } | 123 | } | ||
121 | 124 | | |||
122 | Behavior on opacity { | 125 | Behavior on opacity { | ||
123 | OpacityAnimator { | 126 | OpacityAnimator { | ||
124 | duration: units.longDuration | 127 | duration: units.longDuration | ||
125 | } | 128 | } | ||
126 | } | 129 | } | ||
127 | 130 | | |||
128 | } | 131 | } | ||
129 | 132 | | |||
130 | Component { | 133 | Component { | ||
131 | id: userPrompt | 134 | id: userPromptComponent | ||
132 | Login { | 135 | Login { | ||
133 | showUsernamePrompt: true | 136 | showUsernamePrompt: true | ||
134 | notificationMessage: root.notificationMessage | 137 | notificationMessage: root.notificationMessage | ||
135 | 138 | | |||
136 | userListModel: QtObject { | 139 | userListModel: QtObject { | ||
137 | property string name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Login as different user") | 140 | property string name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Login as different user") | ||
138 | property string iconSource: "" | 141 | property string iconSource: "" | ||
139 | } | 142 | } | ||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |
This property does not exist in Login breaking the login screen!