refactor(lockscreen): remove submit arrow for centered password input and enlarge session controls inside input card
This commit is contained in:
parent
aed2c0f11d
commit
b50ef1c8cb
@ -205,12 +205,12 @@ Item {
|
||||
|
||||
Item { Layout.preferredHeight: 4 }
|
||||
|
||||
// 3. Elegant Glass Input Card with Animated Typing Dots
|
||||
// 3. Elegant Glass Input Card with Animated Typing Dots & Session Controls
|
||||
Rectangle {
|
||||
id: cardContainer
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: cardLayout.implicitHeight + 36
|
||||
radius: 20
|
||||
radius: 24
|
||||
color: Theme.isDark ? Qt.rgba(30/255, 30/255, 46/255, 0.65) : Qt.rgba(240/255, 240/255, 245/255, 0.75)
|
||||
border.color: LockscreenService.authFailed ? Theme.red : (secretInput.activeFocus ? Theme.accent : Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, 0.18))
|
||||
border.width: LockscreenService.authFailed ? 2 : (secretInput.activeFocus ? 2 : 1)
|
||||
@ -223,26 +223,21 @@ Item {
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.margins: 18
|
||||
spacing: 14
|
||||
spacing: 16
|
||||
|
||||
// Password Row: Input Field + Submit Button
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 12
|
||||
|
||||
// Password Visual Placeholder / Input Area
|
||||
// Centered Password Input Field
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 44
|
||||
radius: 12
|
||||
color: Qt.rgba(0, 0, 0, 0.25)
|
||||
border.color: Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, 0.1)
|
||||
implicitHeight: 48
|
||||
radius: 14
|
||||
color: Qt.rgba(0, 0, 0, 0.28)
|
||||
border.color: secretInput.activeFocus ? Qt.rgba(Theme.accent.r, Theme.accent.g, Theme.accent.b, 0.4) : Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, 0.12)
|
||||
|
||||
// Empty State Placeholder Text
|
||||
Behavior on border.color { ColorAnimation { duration: 150 } }
|
||||
|
||||
// Empty State Placeholder Text (Centered)
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 16
|
||||
anchors.centerIn: parent
|
||||
visible: LockscreenService.typedCount === 0 && !LockscreenService.isAuthenticating
|
||||
text: "Type password to unlock..."
|
||||
color: Theme.comment
|
||||
@ -276,7 +271,7 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// ANIMATED TYPING DOTS (Ultra-smooth sliding dot array with add/remove/displaced transitions)
|
||||
// ANIMATED TYPING DOTS (Centered sliding dot array with add/remove/displaced transitions)
|
||||
Item {
|
||||
id: dotsContainer
|
||||
anchors.centerIn: parent
|
||||
@ -352,96 +347,70 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// Submit / Unlock Arrow Button
|
||||
Rectangle {
|
||||
width: 44
|
||||
height: 44
|
||||
radius: 12
|
||||
color: submitMouse.containsMouse ? Theme.accent : Qt.rgba(Theme.accent.r, Theme.accent.g, Theme.accent.b, 0.25)
|
||||
border.color: Theme.accent
|
||||
|
||||
Behavior on color { ColorAnimation { duration: 120 } }
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "➔"
|
||||
color: submitMouse.containsMouse ? "#ffffff" : Theme.accent
|
||||
font.pixelSize: 18
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: submitMouse
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: LockscreenService.submitPassword()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Dynamic Typing Status & Feedback Message
|
||||
// Dynamic Auth Error Feedback Message
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
visible: LockscreenService.authFailed
|
||||
|
||||
Item { Layout.fillWidth: true }
|
||||
|
||||
// Auth Error Message Display
|
||||
Text {
|
||||
text: LockscreenService.authErrorMsg
|
||||
color: Theme.red
|
||||
font.pixelSize: 12
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item { Layout.fillWidth: true }
|
||||
}
|
||||
|
||||
Item { Layout.preferredHeight: 14 }
|
||||
|
||||
// 4. Session Action Buttons (Power & Unlock)
|
||||
// Prominent, Large Session Action Buttons (Right underneath Password Input)
|
||||
RowLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
spacing: 16
|
||||
Layout.fillWidth: true
|
||||
spacing: 12
|
||||
|
||||
// Suspend Button
|
||||
// Suspend / Sleep Button
|
||||
Rectangle {
|
||||
implicitWidth: 110
|
||||
implicitHeight: 38
|
||||
radius: 10
|
||||
color: suspendMouse.containsMouse ? Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, 0.15) : Qt.rgba(0, 0, 0, 0.3)
|
||||
border.color: Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, 0.15)
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 48
|
||||
radius: 12
|
||||
color: suspendMouse.containsMouse ? Qt.rgba(Theme.accent.r, Theme.accent.g, Theme.accent.b, 0.25) : Qt.rgba(0, 0, 0, 0.3)
|
||||
border.color: suspendMouse.containsMouse ? Theme.accent : Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, 0.12)
|
||||
|
||||
Behavior on color { ColorAnimation { duration: 150 } }
|
||||
Behavior on border.color { ColorAnimation { duration: 150 } }
|
||||
|
||||
RowLayout {
|
||||
anchors.centerIn: parent
|
||||
spacing: 6
|
||||
Text { text: "🌙"; font.pixelSize: 13 }
|
||||
Text { text: "Sleep"; color: Theme.fg; font.pixelSize: 12; font.weight: Font.Medium }
|
||||
spacing: 8
|
||||
Text { text: "🌙"; font.pixelSize: 16 }
|
||||
Text { text: "Sleep"; color: Theme.fg; font.pixelSize: 14; font.weight: Font.SemiBold }
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: suspendMouse
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
Quickshell.execDetached(["systemctl", "suspend"])
|
||||
}
|
||||
onClicked: Quickshell.execDetached(["systemctl", "suspend"])
|
||||
}
|
||||
}
|
||||
|
||||
// Reboot Button
|
||||
// Reboot / Restart Button
|
||||
Rectangle {
|
||||
implicitWidth: 110
|
||||
implicitHeight: 38
|
||||
radius: 10
|
||||
color: rebootMouse.containsMouse ? Qt.rgba(Theme.orange.r, Theme.orange.g, Theme.orange.b, 0.25) : Qt.rgba(0, 0, 0, 0.3)
|
||||
border.color: Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, 0.15)
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 48
|
||||
radius: 12
|
||||
color: rebootMouse.containsMouse ? Qt.rgba(Theme.orange.r, Theme.orange.g, Theme.orange.b, 0.3) : Qt.rgba(0, 0, 0, 0.3)
|
||||
border.color: rebootMouse.containsMouse ? Theme.orange : Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, 0.12)
|
||||
|
||||
Behavior on color { ColorAnimation { duration: 150 } }
|
||||
Behavior on border.color { ColorAnimation { duration: 150 } }
|
||||
|
||||
RowLayout {
|
||||
anchors.centerIn: parent
|
||||
spacing: 6
|
||||
Text { text: "🔄"; font.pixelSize: 13 }
|
||||
Text { text: "Restart"; color: Theme.fg; font.pixelSize: 12; font.weight: Font.Medium }
|
||||
spacing: 8
|
||||
Text { text: "🔄"; font.pixelSize: 16 }
|
||||
Text { text: "Restart"; color: Theme.fg; font.pixelSize: 14; font.weight: Font.SemiBold }
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@ -452,19 +421,22 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// Shutdown Button
|
||||
// Shutdown / Power Off Button
|
||||
Rectangle {
|
||||
implicitWidth: 110
|
||||
implicitHeight: 38
|
||||
radius: 10
|
||||
color: powerMouse.containsMouse ? Qt.rgba(Theme.red.r, Theme.red.g, Theme.red.b, 0.25) : Qt.rgba(0, 0, 0, 0.3)
|
||||
border.color: Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, 0.15)
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: 48
|
||||
radius: 12
|
||||
color: powerMouse.containsMouse ? Qt.rgba(Theme.red.r, Theme.red.g, Theme.red.b, 0.3) : Qt.rgba(0, 0, 0, 0.3)
|
||||
border.color: powerMouse.containsMouse ? Theme.red : Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, 0.12)
|
||||
|
||||
Behavior on color { ColorAnimation { duration: 150 } }
|
||||
Behavior on border.color { ColorAnimation { duration: 150 } }
|
||||
|
||||
RowLayout {
|
||||
anchors.centerIn: parent
|
||||
spacing: 6
|
||||
Text { text: "⚡"; font.pixelSize: 13 }
|
||||
Text { text: "Power Off"; color: Theme.fg; font.pixelSize: 12; font.weight: Font.Medium }
|
||||
spacing: 8
|
||||
Text { text: "⏻"; font.pixelSize: 16; color: Theme.red }
|
||||
Text { text: "Power Off"; color: Theme.fg; font.pixelSize: 14; font.weight: Font.SemiBold }
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@ -477,3 +449,5 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user