/usr/share/sddm/themes/breeze/Main.qml is in sddm-theme-breeze 4:5.5.5.2-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | /*
* Copyright 2014 David Edmundson <davidedmundson@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.1 as Controls
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import SddmComponents 2.0
import "./components"
Image {
id: root
width: 1000
height: 1000
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true
Repeater {
model: screenModel
Background {
x: geometry.x; y: geometry.y; width: geometry.width; height:geometry.height
source: config.background
fillMode: Image.PreserveAspectCrop
onStatusChanged: {
if (status == Image.Error && source != config.defaultBackground) {
source = config.defaultBackground
}
}
}
}
property bool debug: false
Rectangle {
id: debug3
color: "green"
visible: debug
width: 3
height: parent.height
anchors.horizontalCenter: root.horizontalCenter
}
Controls.StackView {
id: stackView
//Display the loginpromt only in the primary screen
readonly property rect geometry: screenModel.geometry(screenModel.primary)
width: geometry.width
x: geometry.x
height: units.largeSpacing*14
//Display the BreezeBlock in the middle of each screen
y: geometry.y + (geometry.height / 2) - (height / 2)
initialItem: BreezeBlock {
id: loginPrompt
//Enable clipping whilst animating, otherwise the items would be shifted to other screens in multiscreen setups
//As there are only 2 items (loginPrompt and logoutScreenComponent), it's sufficient to do it only in this component
//Remember to enable clipping whilst animating when creating additional items for the StackView!
Controls.Stack.onStatusChanged: {
if(Controls.Stack.status === Controls.Stack.Activating || Controls.Stack.status === Controls.Stack.Deactivating){
stackView.clip = true;
}else if(Controls.Stack.status === Controls.Stack.Active || Controls.Stack.status === Controls.Stack.Inactive){
stackView.clip = false;
}
}
main: UserSelect {
model: userModel
selectedIndex: userModel.lastIndex
//Resets the "Login Failed" notification after 3 seconds
Timer {
id: notificationResetTimer
interval: 3000
onTriggered: notification = ""
}
Connections {
target: sddm
onLoginFailed: {
notificationResetTimer.restart()
notification = i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Login Failed")
}
}
}
controls: Item {
height: childrenRect.height
property alias password: passwordInput.text
property alias sessionIndex: sessionCombo.currentIndex
property alias buttonEnabled: loginButton.enabled
property alias pwFieldEnabled: passwordInput.enabled
ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 0
RowLayout {
//NOTE password is deliberately the first child so it gets focus
//be careful when re-ordering
anchors.horizontalCenter: parent.horizontalCenter
PlasmaComponents.TextField {
id: passwordInput
placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Password")
echoMode: TextInput.Password
onAccepted: loginPrompt.startLogin()
focus: true
//focus works in qmlscene
//but this seems to be needed when loaded from SDDM
//I don't understand why, but we have seen this before in the old lock screen
Timer {
interval: 200
running: true
onTriggered: passwordInput.forceActiveFocus()
}
//end hack
Keys.onEscapePressed: {
//nextItemInFocusChain(false) is previous Item
nextItemInFocusChain(false).forceActiveFocus();
}
//if empty and left or right is pressed change selection in user switch
//this cannot be in keys.onLeftPressed as then it doesn't reach the password box
Keys.onPressed: {
if (event.key == Qt.Key_Left && !text) {
loginPrompt.mainItem.decrementCurrentIndex();
event.accepted = true
}
if (event.key == Qt.Key_Right && !text) {
loginPrompt.mainItem.incrementCurrentIndex();
event.accepted = true
}
}
}
PlasmaComponents.Button {
id: loginButton
//this keeps the buttons the same width and thus line up evenly around the centre
Layout.minimumWidth: passwordInput.width
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Login")
onClicked: loginPrompt.startLogin();
}
}
BreezeLabel {
id: capsLockWarning
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Caps Lock is on")
visible: keystateSource.data["Caps Lock"]["Locked"]
anchors.horizontalCenter: parent.horizontalCenter
font.weight: Font.Bold
PlasmaCore.DataSource {
id: keystateSource
engine: "keystate"
connectedSources: "Caps Lock"
}
}
}
PlasmaComponents.ComboBox {
id: sessionCombo
model: sessionModel
currentIndex: sessionModel.lastIndex
width: 200
textRole: "name"
anchors.left: parent.left
}
LogoutOptions {
mode: ""
canShutdown: true
canReboot: true
canLogout: false
exclusive: false
anchors {
right: parent.right
}
onModeChanged: {
if (mode) {
stackView.push(logoutScreenComponent, {"mode": mode})
}
}
onVisibleChanged: if(visible) {
mode = ""
}
}
Connections {
target: sddm
onLoginFailed: {
//Re-enable button and textfield
passwordInput.enabled = true
passwordInput.selectAll()
passwordInput.forceActiveFocus()
loginButton.enabled = true;
}
}
}
function startLogin () {
//Disable button and textfield while password check is running
controlsItem.pwFieldEnabled = false;
controlsItem.buttonEnabled = false;
//Clear notification in case the notificationResetTimer hasn't expired yet
mainItem.notification = ""
sddm.login(mainItem.selectedUser, controlsItem.password, controlsItem.sessionIndex)
}
Component {
id: logoutScreenComponent
LogoutScreen {
onCancel: {
stackView.pop()
}
onShutdownRequested: {
sddm.powerOff()
}
onRebootRequested: {
sddm.reboot()
}
}
}
}
}
}
|