Redo to not delete a bunch of stuff
This commit is contained in:
122
Login.qml
122
Login.qml
@@ -85,20 +85,6 @@ SessionManagementScreen {
|
|||||||
focus: showUsernamePrompt && !lastUserName //if there's a username prompt it gets focus first, otherwise password does
|
focus: showUsernamePrompt && !lastUserName //if there's a username prompt it gets focus first, otherwise password does
|
||||||
placeholderText: i18nd("plasma-desktop-sddm-theme", "Username")
|
placeholderText: i18nd("plasma-desktop-sddm-theme", "Username")
|
||||||
|
|
||||||
// Add padding for yellow border
|
|
||||||
leftPadding: Kirigami.Units.smallSpacing * 2 // ~8px padding
|
|
||||||
rightPadding: Kirigami.Units.smallSpacing * 2
|
|
||||||
topPadding: Kirigami.Units.smallSpacing
|
|
||||||
bottomPadding: Kirigami.Units.smallSpacing
|
|
||||||
|
|
||||||
// Custom background with yellow border and no fill
|
|
||||||
background: Rectangle {
|
|
||||||
color: "transparent" // No background fill
|
|
||||||
border.color: "#FFE710" // Yellow border
|
|
||||||
border.width: 3 // Border thickness
|
|
||||||
radius: 4 // Optional: slight rounding for aesthetics
|
|
||||||
}
|
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
if (root.loginScreenUiVisible) {
|
if (root.loginScreenUiVisible) {
|
||||||
passwordBox.forceActiveFocus()
|
passwordBox.forceActiveFocus()
|
||||||
@@ -106,63 +92,77 @@ SessionManagementScreen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
RowLayout {
|
||||||
width: 2560
|
Layout.fillWidth: true
|
||||||
height: 1440
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
PlasmaExtras.PasswordField {
|
Rectangle {
|
||||||
id: passwordBox
|
PlasmaExtras.PasswordField {
|
||||||
x: -330
|
id: passwordBox
|
||||||
y: 243
|
x: -470
|
||||||
width: parent.width * 0.8
|
y: 248
|
||||||
|
width: 945
|
||||||
|
font.pointSize: fontSize + 20
|
||||||
|
Layout.fillWidth: false
|
||||||
|
|
||||||
font.pointSize: fontSize + 20
|
placeholderText: i18nd("plasma-desktop-sddm-theme", "Password")
|
||||||
|
focus: !showUsernamePrompt || lastUserName
|
||||||
|
|
||||||
placeholderText: i18nd("plasma-desktop-sddm-theme", "Password")
|
// Disable reveal password action because SDDM does not have the breeze icon set loaded
|
||||||
|
rightActions: []
|
||||||
|
|
||||||
focus: !showUsernamePrompt || lastUserName
|
// Theming
|
||||||
rightActions: []
|
background: Rectangle {
|
||||||
|
color: "transparent"
|
||||||
leftPadding: Kirigami.Units.smallSpacing * 2
|
|
||||||
rightPadding: Kirigami.Units.smallSpacing * 2
|
|
||||||
topPadding: Kirigami.Units.smallSpacing
|
|
||||||
bottomPadding: Kirigami.Units.smallSpacing
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
color: "transparent"
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: root.showUsernamePrompt || userList.currentItem.needsPassword
|
|
||||||
|
|
||||||
onAccepted: {
|
|
||||||
if (root.loginScreenUiVisible) {
|
|
||||||
startLogin();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onEscapePressed: {
|
onAccepted: {
|
||||||
mainStack.currentItem.forceActiveFocus();
|
if (root.loginScreenUiVisible) {
|
||||||
}
|
startLogin();
|
||||||
|
}
|
||||||
Keys.onPressed: event => {
|
|
||||||
if (event.key === Qt.Key_Left && !text) {
|
|
||||||
userList.decrementCurrentIndex();
|
|
||||||
event.accepted = true
|
|
||||||
}
|
}
|
||||||
if (event.key === Qt.Key_Right && !text) {
|
|
||||||
userList.incrementCurrentIndex();
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
visible: root.showUsernamePrompt || userList.currentItem.needsPassword
|
||||||
target: sddm
|
|
||||||
function onLoginFailed() {
|
Keys.onEscapePressed: {
|
||||||
passwordBox.selectAll()
|
mainStack.currentItem.forceActiveFocus();
|
||||||
passwordBox.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: event => {
|
||||||
|
if (event.key === Qt.Key_Left && !text) {
|
||||||
|
userList.decrementCurrentIndex();
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
if (event.key === Qt.Key_Right && !text) {
|
||||||
|
userList.incrementCurrentIndex();
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: sddm
|
||||||
|
function onLoginFailed() {
|
||||||
|
passwordBox.selectAll()
|
||||||
|
passwordBox.forceActiveFocus()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlasmaComponents3.Button {
|
||||||
|
id: loginButton
|
||||||
|
visible: false
|
||||||
|
Accessible.name: i18nd("plasma-desktop-sddm-theme", "Log In")
|
||||||
|
Layout.preferredHeight: passwordBox.implicitHeight
|
||||||
|
Layout.preferredWidth: text.length === 0 ? loginButton.Layout.preferredHeight : -1
|
||||||
|
|
||||||
|
icon.name: text.length === 0 ? (root.LayoutMirroring.enabled ? "go-previous" : "go-next") : ""
|
||||||
|
|
||||||
|
text: root.showUsernamePrompt || userList.currentItem.needsPassword ? "" : i18n("Log In")
|
||||||
|
onClicked: startLogin()
|
||||||
|
Keys.onEnterPressed: clicked()
|
||||||
|
Keys.onReturnPressed: clicked()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
51
Main.qml
51
Main.qml
@@ -133,6 +133,7 @@ Item {
|
|||||||
|
|
||||||
initialItem: Login {
|
initialItem: Login {
|
||||||
id: userListComponent
|
id: userListComponent
|
||||||
|
userList.opacity: 0
|
||||||
userListModel: userModel
|
userListModel: userModel
|
||||||
loginScreenUiVisible: loginScreenRoot.uiVisible
|
loginScreenUiVisible: loginScreenRoot.uiVisible
|
||||||
userListCurrentIndex: userModel.lastIndex >= 0 ? userModel.lastIndex : 0
|
userListCurrentIndex: userModel.lastIndex >= 0 ? userModel.lastIndex : 0
|
||||||
@@ -151,8 +152,6 @@ Item {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
userListComponent.userList.opacity = 0
|
|
||||||
|
|
||||||
return userListModel.count <= userListModel.disableAvatarsThreshold
|
return userListModel.count <= userListModel.disableAvatarsThreshold
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,48 +334,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DropShadow {
|
|
||||||
id: logoShadow
|
|
||||||
anchors.fill: logo
|
|
||||||
source: logo
|
|
||||||
visible: !softwareRendering && config.showlogo === "shown"
|
|
||||||
horizontalOffset: 1
|
|
||||||
verticalOffset: 1
|
|
||||||
radius: 6
|
|
||||||
samples: 14
|
|
||||||
spread: 0.3
|
|
||||||
color : "black" // shadows should always be black
|
|
||||||
opacity: loginScreenRoot.uiVisible ? 0 : 1
|
|
||||||
Behavior on opacity {
|
|
||||||
//OpacityAnimator when starting from 0 is buggy (it shows one frame with opacity 1)"
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Kirigami.Units.longDuration
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Image {
|
|
||||||
id: logo
|
|
||||||
visible: config.showlogo === "shown"
|
|
||||||
source: config.logo
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
anchors.bottom: footer.top
|
|
||||||
anchors.bottomMargin: Kirigami.Units.largeSpacing
|
|
||||||
asynchronous: true
|
|
||||||
sourceSize.height: height
|
|
||||||
opacity: loginScreenRoot.uiVisible ? 0 : 1
|
|
||||||
fillMode: Image.PreserveAspectFit
|
|
||||||
height: Math.round(Kirigami.Units.gridUnit * 3.5)
|
|
||||||
Behavior on opacity {
|
|
||||||
// OpacityAnimator when starting from 0 is buggy (it shows one frame with opacity 1)"
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Kirigami.Units.longDuration
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note: Containment masks stretch clickable area of their buttons to
|
// Note: Containment masks stretch clickable area of their buttons to
|
||||||
// the screen edges, essentially making them adhere to Fitts's law.
|
// the screen edges, essentially making them adhere to Fitts's law.
|
||||||
// Due to virtual keyboard button having an icon, buttons may have
|
// Due to virtual keyboard button having an icon, buttons may have
|
||||||
@@ -399,10 +356,10 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaComponents3.ToolButton {
|
/*PlasmaComponents3.ToolButton {
|
||||||
id: virtualKeyboardButton
|
id: virtualKeyboardButton
|
||||||
|
|
||||||
text: i18ndc("plasma-desktop-sddm-theme", "Button to show/hide virtual keyboard", "Virtual Keyboard")
|
text: i18ndc("plasma-desktop-sddm-theme", "Button to show/hide virtual keyboard")
|
||||||
icon.name: inputPanel.keyboardActive ? "input-keyboard-virtual-on" : "input-keyboard-virtual-off"
|
icon.name: inputPanel.keyboardActive ? "input-keyboard-virtual-on" : "input-keyboard-virtual-off"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
// Otherwise the password field loses focus and virtual keyboard
|
// Otherwise the password field loses focus and virtual keyboard
|
||||||
@@ -419,7 +376,7 @@ Item {
|
|||||||
anchors.leftMargin: -footer.anchors.margins
|
anchors.leftMargin: -footer.anchors.margins
|
||||||
anchors.bottomMargin: -footer.anchors.margins
|
anchors.bottomMargin: -footer.anchors.margins
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
KeyboardButton {
|
KeyboardButton {
|
||||||
id: keyboardButton
|
id: keyboardButton
|
||||||
|
|||||||
Reference in New Issue
Block a user