Anpassungen
This commit is contained in:
14
usr/share/sddm/themes/catppuccin-mocha/Components/Clock.qml
Normal file
14
usr/share/sddm/themes/catppuccin-mocha/Components/Clock.qml
Normal file
@@ -0,0 +1,14 @@
|
||||
import QtQuick 2.15
|
||||
import SddmComponents 2.0
|
||||
|
||||
Clock {
|
||||
id: time
|
||||
color: config.text
|
||||
timeFont.family: config.Font
|
||||
dateFont.family: config.Font
|
||||
anchors {
|
||||
margins: 10
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
}
|
||||
}
|
||||
147
usr/share/sddm/themes/catppuccin-mocha/Components/LoginPanel.qml
Normal file
147
usr/share/sddm/themes/catppuccin-mocha/Components/LoginPanel.qml
Normal file
@@ -0,0 +1,147 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
Item {
|
||||
property var user: userField.text
|
||||
property var password: passwordField.text
|
||||
property var session: sessionPanel.session
|
||||
property var inputHeight: Screen.height * 0.032
|
||||
property var inputWidth: Screen.width * 0.16
|
||||
Rectangle {
|
||||
id: loginBackground
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
height: inputHeight * 5.3
|
||||
width: inputWidth * 1.2
|
||||
radius: 5
|
||||
visible: config.LoginBackground == "true" ? true : false
|
||||
color: config.mantle
|
||||
}
|
||||
Column {
|
||||
spacing: 8
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
}
|
||||
PowerButton {
|
||||
id: powerButton
|
||||
}
|
||||
RebootButton {
|
||||
id: rebootButton
|
||||
}
|
||||
SleepButton {
|
||||
id: sleepButton
|
||||
}
|
||||
z: 5
|
||||
}
|
||||
Column {
|
||||
spacing: 8
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
right: parent.right
|
||||
}
|
||||
SessionPanel {
|
||||
id: sessionPanel
|
||||
}
|
||||
z: 5
|
||||
}
|
||||
Column {
|
||||
spacing: 8
|
||||
z: 5
|
||||
width: inputWidth
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
UserField {
|
||||
id: userField
|
||||
height: inputHeight
|
||||
width: parent.width
|
||||
}
|
||||
PasswordField {
|
||||
id: passwordField
|
||||
height: inputHeight
|
||||
width: parent.width
|
||||
onAccepted: loginButton.clicked()
|
||||
}
|
||||
Button {
|
||||
id: loginButton
|
||||
height: inputHeight
|
||||
width: parent.width
|
||||
enabled: user != "" && password != "" ? true : false
|
||||
hoverEnabled: true
|
||||
contentItem: Text {
|
||||
id: buttonText
|
||||
renderType: Text.NativeRendering
|
||||
font {
|
||||
family: config.Font
|
||||
pointSize: config.FontSize
|
||||
bold: true
|
||||
}
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: config.crust
|
||||
text: "Login"
|
||||
}
|
||||
background: Rectangle {
|
||||
id: buttonBackground
|
||||
color: config.sapphire
|
||||
radius: 3
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "pressed"
|
||||
when: loginButton.down
|
||||
PropertyChanges {
|
||||
target: buttonBackground
|
||||
color: config.teal
|
||||
}
|
||||
PropertyChanges {
|
||||
target: buttonText
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hovered"
|
||||
when: loginButton.hovered
|
||||
PropertyChanges {
|
||||
target: buttonBackground
|
||||
color: config.teal
|
||||
}
|
||||
PropertyChanges {
|
||||
target: buttonText
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "enabled"
|
||||
when: loginButton.enabled
|
||||
PropertyChanges {
|
||||
target: buttonBackground
|
||||
}
|
||||
PropertyChanges {
|
||||
target: buttonText
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: Transition {
|
||||
PropertyAnimation {
|
||||
properties: "color"
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
sddm.login(user, password, session)
|
||||
}
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: sddm
|
||||
|
||||
function onLoginFailed() {
|
||||
passwordField.text = ""
|
||||
passwordField.focus = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
TextField {
|
||||
id: passwordField
|
||||
focus: true
|
||||
selectByMouse: true
|
||||
placeholderText: "Password"
|
||||
echoMode: TextInput.Password
|
||||
passwordCharacter: "•"
|
||||
passwordMaskDelay: config.PasswordShowLastLetter
|
||||
selectionColor: config.overlay0
|
||||
renderType: Text.NativeRendering
|
||||
font.family: config.Font
|
||||
font.pointSize: config.FontSize
|
||||
font.bold: true
|
||||
color: config.text
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
background: Rectangle {
|
||||
id: passFieldBackground
|
||||
radius: 3
|
||||
color: config.surface0
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "focused"
|
||||
when: passwordField.activeFocus
|
||||
PropertyChanges {
|
||||
target: passFieldBackground
|
||||
color: config.surface1
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hovered"
|
||||
when: passwordField.hovered
|
||||
PropertyChanges {
|
||||
target: passFieldBackground
|
||||
color: config.surface1
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: Transition {
|
||||
PropertyAnimation {
|
||||
properties: "color"
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
Item {
|
||||
implicitHeight: powerButton.height
|
||||
implicitWidth: powerButton.width
|
||||
Button {
|
||||
id: powerButton
|
||||
height: inputHeight
|
||||
width: inputHeight
|
||||
hoverEnabled: true
|
||||
icon {
|
||||
source: Qt.resolvedUrl("../icons/power.svg")
|
||||
height: height
|
||||
width: width
|
||||
color: config.crust
|
||||
}
|
||||
background: Rectangle {
|
||||
id: powerButtonBackground
|
||||
radius: 3
|
||||
color: config.red
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "hovered"
|
||||
when: powerButton.hovered
|
||||
PropertyChanges {
|
||||
target: powerButtonBackground
|
||||
color: config.rosewater
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: Transition {
|
||||
PropertyAnimation {
|
||||
properties: "color"
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
onClicked: sddm.powerOff()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
Item {
|
||||
implicitHeight: rebootButton.height
|
||||
implicitWidth: rebootButton.width
|
||||
Button {
|
||||
id: rebootButton
|
||||
height: inputHeight
|
||||
width: inputHeight
|
||||
hoverEnabled: true
|
||||
icon {
|
||||
source: Qt.resolvedUrl("../icons/reboot.svg")
|
||||
height: height
|
||||
width: width
|
||||
color: config.crust
|
||||
}
|
||||
background: Rectangle {
|
||||
id: rebootButtonBackground
|
||||
radius: 3
|
||||
color: config.red
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "hovered"
|
||||
when: rebootButton.hovered
|
||||
PropertyChanges {
|
||||
target: rebootButtonBackground
|
||||
color: config.rosewater
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: Transition {
|
||||
PropertyAnimation {
|
||||
properties: "color"
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
onClicked: sddm.reboot()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQml.Models 2.15
|
||||
|
||||
Item {
|
||||
property var session: sessionList.currentIndex
|
||||
implicitHeight: sessionButton.height
|
||||
implicitWidth: sessionButton.width
|
||||
DelegateModel {
|
||||
id: sessionWrapper
|
||||
model: sessionModel
|
||||
delegate: ItemDelegate {
|
||||
id: sessionEntry
|
||||
height: inputHeight
|
||||
width: parent.width
|
||||
highlighted: sessionList.currentIndex == index
|
||||
contentItem: Text {
|
||||
renderType: Text.NativeRendering
|
||||
font.family: config.Font
|
||||
font.pointSize: config.FontSize
|
||||
font.bold: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: config.text
|
||||
text: name
|
||||
}
|
||||
background: Rectangle {
|
||||
id: sessionEntryBackground
|
||||
color: config.surface1
|
||||
radius: 3
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "hovered"
|
||||
when: sessionEntry.hovered
|
||||
PropertyChanges {
|
||||
target: sessionEntryBackground
|
||||
color: config.surface2
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: Transition {
|
||||
PropertyAnimation {
|
||||
property: "color"
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
sessionList.currentIndex = index
|
||||
sessionPopup.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Button {
|
||||
id: sessionButton
|
||||
height: inputHeight
|
||||
width: inputHeight
|
||||
hoverEnabled: true
|
||||
icon {
|
||||
source: Qt.resolvedUrl("../icons/settings.svg")
|
||||
height: height
|
||||
width: width
|
||||
color: config.text
|
||||
}
|
||||
background: Rectangle {
|
||||
id: sessionButtonBackground
|
||||
color: config.surface0
|
||||
radius: 3
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "pressed"
|
||||
when: sessionButton.down
|
||||
PropertyChanges {
|
||||
target: sessionButtonBackground
|
||||
color: config.surface1
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hovered"
|
||||
when: sessionButton.hovered
|
||||
PropertyChanges {
|
||||
target: sessionButtonBackground
|
||||
color: config.surface2
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "selection"
|
||||
when: sessionPopup.visible
|
||||
PropertyChanges {
|
||||
target: sessionButtonBackground
|
||||
color: config.surface2
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: Transition {
|
||||
PropertyAnimation {
|
||||
properties: "color"
|
||||
duration: 150
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
sessionPopup.visible ? sessionPopup.close() : sessionPopup.open()
|
||||
sessionButton.state = "pressed"
|
||||
}
|
||||
}
|
||||
Popup {
|
||||
id: sessionPopup
|
||||
width: inputWidth + padding * 2
|
||||
x: (sessionButton.width + sessionList.spacing) * -7.6
|
||||
y: -(contentHeight + padding * 2) + sessionButton.height
|
||||
padding: inputHeight / 10
|
||||
background: Rectangle {
|
||||
radius: 5.4
|
||||
color: config.surface0
|
||||
}
|
||||
contentItem: ListView {
|
||||
id: sessionList
|
||||
implicitHeight: contentHeight
|
||||
spacing: 8
|
||||
model: sessionWrapper
|
||||
currentIndex: sessionModel.lastIndex
|
||||
clip: true
|
||||
}
|
||||
enter: Transition {
|
||||
ParallelAnimation {
|
||||
NumberAnimation {
|
||||
property: "opacity"
|
||||
from: 0
|
||||
to: 1
|
||||
duration: 400
|
||||
easing.type: Easing.OutExpo
|
||||
}
|
||||
NumberAnimation {
|
||||
property: "x"
|
||||
from: sessionPopup.x + (inputWidth * 0.1)
|
||||
to: sessionPopup.x
|
||||
duration: 500
|
||||
easing.type: Easing.OutExpo
|
||||
}
|
||||
}
|
||||
}
|
||||
exit: Transition {
|
||||
NumberAnimation {
|
||||
property: "opacity"
|
||||
from: 1
|
||||
to: 0
|
||||
duration: 300
|
||||
easing.type: Easing.OutExpo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
Item {
|
||||
implicitHeight: sleepButton.height
|
||||
implicitWidth: sleepButton.width
|
||||
Button {
|
||||
id: sleepButton
|
||||
height: inputHeight
|
||||
width: inputHeight
|
||||
hoverEnabled: true
|
||||
icon {
|
||||
source: Qt.resolvedUrl("../icons/sleep.svg")
|
||||
height: height
|
||||
width: width
|
||||
color: config.crust
|
||||
}
|
||||
background: Rectangle {
|
||||
id: sleepButtonBg
|
||||
color: config.red
|
||||
radius: 3
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "hovered"
|
||||
when: sleepButton.hovered
|
||||
PropertyChanges {
|
||||
target: sleepButtonBg
|
||||
color: config.rosewater
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: Transition {
|
||||
PropertyAnimation {
|
||||
properties: "color"
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
onClicked: sddm.suspend()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
TextField {
|
||||
id: userField
|
||||
height: inputHeight
|
||||
width: inputWidth
|
||||
selectByMouse: true
|
||||
echoMode: TextInput.Normal
|
||||
selectionColor: config.overlay0
|
||||
renderType: Text.NativeRendering
|
||||
font {
|
||||
family: config.Font
|
||||
pointSize: config.FontSize
|
||||
bold: true
|
||||
}
|
||||
color: config.text
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
placeholderText: "Username"
|
||||
text: userModel.lastUser
|
||||
background: Rectangle {
|
||||
id: userFieldBackground
|
||||
color: config.surface0
|
||||
radius: 3
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "focused"
|
||||
when: userField.activeFocus
|
||||
PropertyChanges {
|
||||
target: userFieldBackground
|
||||
color: config.surface1
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hovered"
|
||||
when: userField.hovered
|
||||
PropertyChanges {
|
||||
target: userFieldBackground
|
||||
color: config.surface1
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: Transition {
|
||||
PropertyAnimation {
|
||||
properties: "color"
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user