2 * Copyright 2016 Eric Hameleers, Eindhoven, NL <alien@slackware.com>
5 * Permission to use, copy, modify, and distribute this software for
6 * any purpose with or without fee is hereby granted, provided that
7 * the above copyright notice and this permission notice appear in all
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 * IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 import SddmComponents 2.0
32 property int sessionIndex: session.index
34 TextConstants { id: textConstants }
42 txtMessage.text = textConstants.loginFailed
43 listView.currentItem.password.text = ""
50 x: geometry.x; y: geometry.y; width: geometry.width; height:geometry.height
51 source: config.background
52 fillMode: Image.PreserveAspectCrop
54 if (status == Image.Error && source != config.defaultBackground) {
55 source = config.defaultBackground
62 property variant geometry: screenModel.geometry(screenModel.primary)
63 x: geometry.x; y: geometry.y; width: geometry.width; height: geometry.height
70 anchors.verticalCenter: parent.verticalCenter
71 name: (model.realName === "") ? model.name : model.realName
74 focus: (listView.currentIndex === index) ? true : false
75 state: (listView.currentIndex === index) ? "active" : ""
77 onLogin: sddm.login(model.name, password, sessionIndex);
82 onEntered: listView.currentIndex = index
83 onClicked: listView.focus = true
93 anchors.top: usersContainer.bottom;
95 anchors.horizontalCenter: parent.horizontalCenter
97 text: textConstants.promptSelectUser
104 width: parent.width; height: 300
105 anchors.verticalCenter: parent.verticalCenter
109 anchors.left: parent.left
110 anchors.verticalCenter: parent.verticalCenter
112 source: "angle-left.png"
113 onClicked: listView.decrementCurrentIndex()
115 KeyNavigation.backtab: btnShutdown; KeyNavigation.tab: listView
122 height: parent.height
123 anchors.left: prevUser.right; anchors.right: nextUser.left
124 anchors.verticalCenter: parent.verticalCenter
133 delegate: userDelegate
134 orientation: ListView.Horizontal
135 currentIndex: userModel.lastIndex
137 KeyNavigation.backtab: prevUser; KeyNavigation.tab: nextUser
142 anchors.right: parent.right
143 anchors.verticalCenter: parent.verticalCenter
145 source: "angle-right.png"
146 onClicked: listView.incrementCurrentIndex()
147 KeyNavigation.backtab: listView; KeyNavigation.tab: session
156 anchors.top: parent.top;
157 anchors.horizontalCenter: parent.horizontalCenter
158 width: parent.width; height: 64
162 anchors.left: parent.left
164 height: parent.height
168 height: parent.height
169 anchors.verticalCenter: parent.verticalCenter
170 text: textConstants.session
173 verticalAlignment: Text.AlignVCenter
179 anchors.verticalCenter: parent.verticalCenter
180 arrowIcon: "angle-down.png"
182 index: sessionModel.lastIndex
185 KeyNavigation.backtab: nextUser; KeyNavigation.tab: layoutBox
189 height: parent.height
190 anchors.verticalCenter: parent.verticalCenter
191 text: textConstants.layout
194 verticalAlignment: Text.AlignVCenter
200 anchors.verticalCenter: parent.verticalCenter
202 arrowIcon: "angle-down.png"
203 KeyNavigation.backtab: session; KeyNavigation.tab: btnShutdown
208 height: parent.height
209 anchors.right: parent.right
215 height: parent.height
217 visible: sddm.canReboot
218 onClicked: sddm.reboot()
219 KeyNavigation.backtab: layoutBox; KeyNavigation.tab: btnShutdown
224 height: parent.height
225 source: "shutdown.png"
226 visible: sddm.canPowerOff
227 onClicked: sddm.powerOff()
228 KeyNavigation.backtab: btnReboot; KeyNavigation.tab: prevUser
233 anchors.top: parent.top; anchors.right: parent.right
235 timeFont.family: "sans"
237 timeFont.pixelSize: 28
238 dateFont.pixelSize: 12