Update dotfiles (2026-01-19 19:48:47)
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Based on https://github.com/MarianArlt/sddm-sugar-dark
|
||||
// Distributed under the GPLv3+ License https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
Column {
|
||||
id: clock
|
||||
|
||||
width: parent.width / 2
|
||||
spacing: 0
|
||||
|
||||
Label {
|
||||
id:headerTextLabel
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
font.pointSize: root.font.pointSize * 4
|
||||
color: config.HeaderTextColor
|
||||
renderType: Text.NativeRendering
|
||||
text: config.HeaderText
|
||||
}
|
||||
|
||||
Label {
|
||||
id: timeLabel
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
font.pointSize: root.font.pointSize * 9
|
||||
font.bold: true
|
||||
color: config.TimeTextColor
|
||||
renderType: Text.QtRendering
|
||||
|
||||
function updateTime() {
|
||||
text = new Date().toLocaleTimeString(Qt.locale(config.Locale), config.HourFormat == "long" ? Locale.LongFormat : config.HourFormat !== "" ? config.HourFormat : Locale.ShortFormat)
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
id: dateLabel
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
color: config.DateTextColor
|
||||
font.pointSize: root.font.pointSize * 3
|
||||
font.bold: true
|
||||
renderType: Text.QtRendering
|
||||
|
||||
function updateTime() {
|
||||
text = new Date().toLocaleDateString(Qt.locale(config.Locale), config.DateFormat == "short" ? Locale.ShortFormat : config.DateFormat !== "" ? config.DateFormat : Locale.LongFormat)
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 1000
|
||||
repeat: true
|
||||
running: true
|
||||
onTriggered: {
|
||||
dateLabel.updateTime()
|
||||
timeLabel.updateTime()
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
dateLabel.updateTime()
|
||||
timeLabel.updateTime()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,526 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Based on https://github.com/MarianArlt/sddm-sugar-dark
|
||||
// Distributed under the GPLv3+ License https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
Column {
|
||||
id: inputContainer
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
property ComboBox exposeSession: sessionSelect.exposeSession
|
||||
property bool failed
|
||||
|
||||
Item {
|
||||
id: errorMessageField
|
||||
|
||||
// change also in selectSession
|
||||
height: root.font.pointSize * 2
|
||||
width: parent.width / 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Label {
|
||||
id: errorMessage
|
||||
|
||||
width: parent.width
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
text: failed ? config.TranslateLoginFailedWarning || textConstants.loginFailed + "!" : keyboard.capsLock ? config.TranslateCapslockWarning || textConstants.capslockWarning : null
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
font.italic: true
|
||||
color: config.WarningColor
|
||||
opacity: 0
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "fail"
|
||||
when: failed
|
||||
PropertyChanges {
|
||||
target: errorMessage
|
||||
opacity: 1
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "capslock"
|
||||
when: keyboard.capsLock
|
||||
PropertyChanges {
|
||||
target: errorMessage
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
PropertyAnimation {
|
||||
properties: "opacity"
|
||||
duration: 100
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: usernameField
|
||||
|
||||
height: root.font.pointSize * 4.5
|
||||
width: parent.width / 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
ComboBox {
|
||||
id: selectUser
|
||||
|
||||
width: parent.height
|
||||
height: parent.height
|
||||
anchors.left: parent.left
|
||||
z: 2
|
||||
|
||||
model: userModel
|
||||
currentIndex: model.lastIndex
|
||||
textRole: "name"
|
||||
hoverEnabled: true
|
||||
onActivated: {
|
||||
username.text = currentText
|
||||
}
|
||||
|
||||
property var popkey: config.RightToLeftLayout == "true" ? Qt.Key_Right : Qt.Key_Left
|
||||
Keys.onPressed: function(event) {
|
||||
if (event.key == Qt.Key_Down && !popup.opened)
|
||||
username.forceActiveFocus();
|
||||
if ((event.key == Qt.Key_Up || event.key == popkey) && !popup.opened)
|
||||
popup.open();
|
||||
}
|
||||
KeyNavigation.down: username
|
||||
KeyNavigation.right: username
|
||||
|
||||
delegate: ItemDelegate {
|
||||
// minus padding
|
||||
width: popupHandler.width - 20
|
||||
anchors.horizontalCenter: popupHandler.horizontalCenter
|
||||
|
||||
contentItem: Text {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
text: model.name
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
font.capitalization: Font.AllLowercase
|
||||
font.family: root.font.family
|
||||
color: config.DropdownTextColor
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: selectUser.highlightedIndex === index ? config.DropdownSelectedBackgroundColor : "transparent"
|
||||
}
|
||||
}
|
||||
|
||||
indicator: Button {
|
||||
id: usernameIcon
|
||||
|
||||
width: selectUser.height * 1
|
||||
height: parent.height
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.leftMargin: selectUser.height * 0
|
||||
|
||||
icon.height: parent.height * 0.25
|
||||
icon.width: parent.height * 0.25
|
||||
enabled: false
|
||||
icon.color: config.UserIconColor
|
||||
icon.source: Qt.resolvedUrl("../Assets/User.svg")
|
||||
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: "transparent"
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: "transparent"
|
||||
}
|
||||
|
||||
popup: Popup {
|
||||
id: popupHandler
|
||||
|
||||
implicitHeight: contentItem.implicitHeight
|
||||
width: usernameField.width
|
||||
y: parent.height - username.height / 3
|
||||
x: config.RightToLeftLayout == "true" ? -loginButton.width + selectUser.width : 0
|
||||
rightMargin: config.RightToLeftLayout == "true" ? root.padding + usernameField.width / 2 : undefined
|
||||
padding: 10
|
||||
|
||||
contentItem: ListView {
|
||||
implicitHeight: contentHeight + 20
|
||||
|
||||
clip: true
|
||||
model: selectUser.popup.visible ? selectUser.delegateModel : null
|
||||
currentIndex: selectUser.highlightedIndex
|
||||
ScrollIndicator.vertical: ScrollIndicator { }
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
radius: config.RoundCorners / 2
|
||||
color: config.DropdownBackgroundColor
|
||||
layer.enabled: true
|
||||
}
|
||||
|
||||
enter: Transition {
|
||||
NumberAnimation { property: "opacity"; from: 0; to: 1 }
|
||||
}
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "pressed"
|
||||
when: selectUser.down
|
||||
PropertyChanges {
|
||||
target: usernameIcon
|
||||
icon.color: Qt.lighter(config.HoverUserIconColor, 1.1)
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hovered"
|
||||
when: selectUser.hovered
|
||||
PropertyChanges {
|
||||
target: usernameIcon
|
||||
icon.color: Qt.lighter(config.HoverUserIconColor, 1.2)
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "focused"
|
||||
when: selectUser.activeFocus
|
||||
PropertyChanges {
|
||||
target: usernameIcon
|
||||
icon.color: config.HoverUserIconColor
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
PropertyAnimation {
|
||||
properties: "color, border.color, icon.color"
|
||||
duration: 150
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: username
|
||||
|
||||
anchors.centerIn: parent
|
||||
height: root.font.pointSize * 3
|
||||
width: parent.width
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
z: 1
|
||||
|
||||
text: config.ForceLastUser == "true" ? selectUser.currentText : null
|
||||
color: config.LoginFieldTextColor
|
||||
font.bold: true
|
||||
font.capitalization: config.AllowUppercaseLettersInUsernames == "false" ? Font.AllLowercase : Font.MixedCase
|
||||
placeholderText: config.TranslatePlaceholderUsername || textConstants.userName
|
||||
placeholderTextColor: config.PlaceholderTextColor
|
||||
selectByMouse: true
|
||||
renderType: Text.QtRendering
|
||||
|
||||
onFocusChanged:{
|
||||
if(focus)
|
||||
selectAll()
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: config.LoginFieldBackgroundColor
|
||||
opacity: 0.6
|
||||
border.color: "transparent"
|
||||
border.width: parent.activeFocus ? 2 : 1
|
||||
radius: config.RoundCorners || 0
|
||||
}
|
||||
|
||||
onAccepted: config.AllowUppercaseLettersInUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession)
|
||||
KeyNavigation.down: passwordIcon
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "focused"
|
||||
when: username.activeFocus
|
||||
PropertyChanges {
|
||||
target: username.background
|
||||
border.color: config.HighlightBorderColor
|
||||
}
|
||||
PropertyChanges {
|
||||
target: username
|
||||
color: Qt.lighter(config.LoginFieldTextColor, 1.15)
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: passwordField
|
||||
|
||||
height: root.font.pointSize * 4.5
|
||||
width: parent.width / 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Button {
|
||||
id: passwordIcon
|
||||
|
||||
height: parent.height
|
||||
width: selectUser.height * 1
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: selectUser.height * 0
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
z: 2
|
||||
|
||||
icon.height: parent.height * 0.25
|
||||
icon.width: parent.height * 0.25
|
||||
icon.color: config.PasswordIconColor
|
||||
icon.source: Qt.resolvedUrl("../Assets/Password2.svg")
|
||||
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: "transparent"
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "visiblePasswordFocused"
|
||||
when: passwordIcon.checked && passwordIcon.activeFocus
|
||||
PropertyChanges {
|
||||
target: passwordIcon
|
||||
icon.source: Qt.resolvedUrl("../Assets/Password.svg")
|
||||
icon.color: config.HoverPasswordIconColor
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "visiblePasswordHovered"
|
||||
when: passwordIcon.checked && passwordIcon.hovered
|
||||
PropertyChanges {
|
||||
target: passwordIcon
|
||||
icon.source: Qt.resolvedUrl("../Assets/Password.svg")
|
||||
icon.color: config.HoverPasswordIconColor
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "visiblePassword"
|
||||
when: passwordIcon.checked
|
||||
PropertyChanges {
|
||||
target: passwordIcon
|
||||
icon.source: Qt.resolvedUrl("../Assets/Password.svg")
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hiddenPasswordFocused"
|
||||
when: passwordIcon.enabled && passwordIcon.activeFocus
|
||||
PropertyChanges {
|
||||
target: passwordIcon
|
||||
icon.source: Qt.resolvedUrl("../Assets/Password2.svg")
|
||||
icon.color: config.HoverPasswordIconColor
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hiddenPasswordHovered"
|
||||
when: passwordIcon.hovered
|
||||
PropertyChanges {
|
||||
target: passwordIcon
|
||||
icon.source: Qt.resolvedUrl("../Assets/Password2.svg")
|
||||
icon.color: config.HoverPasswordIconColor
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
onClicked: toggle()
|
||||
Keys.onReturnPressed: toggle()
|
||||
Keys.onEnterPressed: toggle()
|
||||
KeyNavigation.down: password
|
||||
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: password
|
||||
|
||||
height: root.font.pointSize * 3
|
||||
width: parent.width
|
||||
anchors.centerIn: parent
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
|
||||
font.bold: true
|
||||
color: config.PasswordFieldTextColor
|
||||
focus: config.PasswordFocus == "true" ? true : false
|
||||
echoMode: passwordIcon.checked ? TextInput.Normal : TextInput.Password
|
||||
placeholderText: config.TranslatePlaceholderPassword || textConstants.password
|
||||
placeholderTextColor: config.PlaceholderTextColor
|
||||
passwordCharacter: "•"
|
||||
passwordMaskDelay: config.HideCompletePassword == "true" ? undefined : 1000
|
||||
renderType: Text.QtRendering
|
||||
selectByMouse: true
|
||||
|
||||
background: Rectangle {
|
||||
color: config.PasswordFieldBackgroundColor
|
||||
opacity: 0.6
|
||||
border.color: "transparent"
|
||||
border.width: parent.activeFocus ? 2 : 1
|
||||
radius: config.RoundCorners || 0
|
||||
}
|
||||
onAccepted: config.AllowUppercaseLettersInUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession)
|
||||
KeyNavigation.down: loginButton
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "focused"
|
||||
when: password.activeFocus
|
||||
PropertyChanges {
|
||||
target: password.background
|
||||
border.color: config.HighlightBorderColor
|
||||
}
|
||||
PropertyChanges {
|
||||
target: password
|
||||
color: Qt.lighter(config.LoginFieldTextColor, 1.15)
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
PropertyAnimation {
|
||||
properties: "color, border.color"
|
||||
duration: 150
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Item {
|
||||
id: login
|
||||
|
||||
// important
|
||||
// try 4 or 9 ...
|
||||
height: root.font.pointSize * 9
|
||||
width: parent.width / 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
visible: config.HideLoginButton == "true" ? false : true
|
||||
|
||||
Button {
|
||||
id: loginButton
|
||||
|
||||
height: root.font.pointSize * 3
|
||||
implicitWidth: parent.width
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
text: config.TranslateLogin || textConstants.login
|
||||
enabled: config.AllowEmptyPassword == "true" || username.text != "" && password.text != "" ? true : false
|
||||
hoverEnabled: true
|
||||
|
||||
contentItem: Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
font.bold: true
|
||||
font.pointSize: root.font.pointSize
|
||||
font.family: root.font.family
|
||||
color: config.LoginButtonTextColor
|
||||
text: parent.text
|
||||
opacity: 0.0
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
id: buttonBackground
|
||||
|
||||
color: config.LoginButtonBackgroundColor
|
||||
opacity: 0.0
|
||||
radius: config.RoundCorners || 0
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "pressed"
|
||||
when: loginButton.down
|
||||
PropertyChanges {
|
||||
target: buttonBackground
|
||||
color: Qt.darker(config.LoginButtonBackgroundColor, 1.1)
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: loginButton.contentItem
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hovered"
|
||||
when: loginButton.hovered
|
||||
PropertyChanges {
|
||||
target: buttonBackground
|
||||
color: Qt.lighter(config.LoginButtonBackgroundColor, 1.15)
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: loginButton.contentItem
|
||||
opacity: 0.0
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "focused"
|
||||
when: loginButton.activeFocus
|
||||
PropertyChanges {
|
||||
target: buttonBackground
|
||||
color: Qt.lighter(config.LoginButtonBackgroundColor, 1.2)
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: loginButton.contentItem
|
||||
opacity: 0.0
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "enabled"
|
||||
when: loginButton.enabled
|
||||
PropertyChanges {
|
||||
target: buttonBackground;
|
||||
color: config.LoginButtonBackgroundColor;
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: loginButton.contentItem;
|
||||
opacity: 0.0
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
PropertyAnimation {
|
||||
properties: "opacity, color";
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
onClicked: config.AllowUppercaseLettersInUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession)
|
||||
Keys.onReturnPressed: clicked()
|
||||
Keys.onEnterPressed: clicked()
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: sddm
|
||||
function onLoginSucceeded() {}
|
||||
function onLoginFailed() {
|
||||
failed = true
|
||||
resetError.running ? resetError.stop() && resetError.start() : resetError.start()
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: resetError
|
||||
interval: 2000
|
||||
onTriggered: failed = false
|
||||
running: false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Based on https://github.com/MarianArlt/sddm-sugar-dark
|
||||
// Distributed under the GPLv3+ License https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import SddmComponents 2.0 as SDDM
|
||||
|
||||
ColumnLayout {
|
||||
id: formContainer
|
||||
SDDM.TextConstants { id: textConstants }
|
||||
|
||||
property int p: config.ScreenPadding == "" ? 0 : config.ScreenPadding
|
||||
property string a: config.FormPosition
|
||||
|
||||
Clock {
|
||||
id: clock
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
||||
// important
|
||||
Layout.preferredHeight: root.height / 2
|
||||
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
|
||||
}
|
||||
|
||||
Input {
|
||||
id: input
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.preferredHeight: root.height / 20
|
||||
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
|
||||
Layout.topMargin: 0
|
||||
}
|
||||
|
||||
SystemButtons {
|
||||
id: systemButtons
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
||||
Layout.preferredHeight: root.height / 5
|
||||
Layout.maximumHeight: root.height / 5
|
||||
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
|
||||
|
||||
exposedSession: input.exposeSession
|
||||
}
|
||||
|
||||
SessionButton {
|
||||
id: sessionSelect
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
||||
Layout.preferredHeight: root.height / 54
|
||||
Layout.maximumHeight: root.height / 54
|
||||
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Based on https://github.com/MarianArlt/sddm-sugar-dark
|
||||
// Distributed under the GPLv3+ License https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
Item {
|
||||
id: sessionButton
|
||||
|
||||
height: root.font.pointSize
|
||||
width: parent.width / 2
|
||||
|
||||
property var selectedSession: selectSession.currentIndex
|
||||
property string textConstantSession
|
||||
property int loginButtonWidth
|
||||
property ComboBox exposeSession: selectSession
|
||||
|
||||
ComboBox {
|
||||
id: selectSession
|
||||
|
||||
// important
|
||||
// change also in errorMessage
|
||||
height: root.font.pointSize * 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
hoverEnabled: true
|
||||
model: sessionModel
|
||||
currentIndex: model.lastIndex
|
||||
textRole: "name"
|
||||
|
||||
Keys.onPressed: function(event) {
|
||||
if ((event.key == Qt.Key_Left || event.key == Qt.Key_Right) && !popup.opened) {
|
||||
popup.open();
|
||||
}
|
||||
}
|
||||
|
||||
delegate: ItemDelegate {
|
||||
// minus padding
|
||||
width: popupHandler.width - 20
|
||||
anchors.horizontalCenter: popupHandler.horizontalCenter
|
||||
|
||||
contentItem: Text {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
text: model.name
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
font.family: root.font.family
|
||||
color: config.DropdownTextColor
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: selectSession.highlightedIndex === index ? config.DropdownSelectedBackgroundColor : "transparent"
|
||||
}
|
||||
}
|
||||
|
||||
indicator {
|
||||
visible: false
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
id: displayedItem
|
||||
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
text: (config.TranslateSessionSelection || "Session") + " (" + selectSession.currentText + ")"
|
||||
color: config.SessionButtonTextColor
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
font.family: root.font.family
|
||||
|
||||
Keys.onReleased: parent.popup.open()
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
height: parent.visualFocus ? 2 : 0
|
||||
width: displayedItem.implicitWidth
|
||||
|
||||
color: "transparent"
|
||||
}
|
||||
|
||||
popup: Popup {
|
||||
id: popupHandler
|
||||
|
||||
implicitHeight: contentItem.implicitHeight
|
||||
width: sessionButton.width
|
||||
y: parent.height - 1
|
||||
x: -popupHandler.width/2 + displayedItem.width/2
|
||||
padding: 10
|
||||
|
||||
contentItem: ListView {
|
||||
implicitHeight: contentHeight + 20
|
||||
|
||||
clip: true
|
||||
model: selectSession.popup.visible ? selectSession.delegateModel : null
|
||||
currentIndex: selectSession.highlightedIndex
|
||||
ScrollIndicator.vertical: ScrollIndicator { }
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
radius: config.RoundCorners / 2
|
||||
color: config.DropdownBackgroundColor
|
||||
layer.enabled: true
|
||||
}
|
||||
|
||||
enter: Transition {
|
||||
NumberAnimation { property: "opacity"; from: 0; to: 1 }
|
||||
}
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "pressed"
|
||||
when: selectSession.down
|
||||
PropertyChanges {
|
||||
target: displayedItem
|
||||
color: Qt.darker(config.HoverSessionButtonTextColor, 1.1)
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hovered"
|
||||
when: selectSession.hovered
|
||||
PropertyChanges {
|
||||
target: displayedItem
|
||||
color: Qt.lighter(config.HoverSessionButtonTextColor, 1.1)
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "focused"
|
||||
when: selectSession.visualFocus
|
||||
PropertyChanges {
|
||||
target: displayedItem
|
||||
color: config.HoverSessionButtonTextColor
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
PropertyAnimation {
|
||||
properties: "color"
|
||||
duration: 150
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Based on https://github.com/MarianArlt/sddm-sugar-dark
|
||||
// Distributed under the GPLv3+ License https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
RowLayout {
|
||||
|
||||
spacing: root.font.pointSize
|
||||
|
||||
property var shutdown: ["Shutdown", config.TranslateShutdown || textConstants.shutdown, sddm.canPowerOff]
|
||||
property var reboot: ["Reboot", config.TranslateReboot || textConstants.reboot, sddm.canReboot]
|
||||
property var suspend: ["Suspend", config.TranslateSuspend || textConstants.suspend, sddm.canSuspend]
|
||||
property var hibernate: ["Hibernate", config.TranslateHibernate || textConstants.hibernate, sddm.canHibernate]
|
||||
|
||||
property ComboBox exposedSession
|
||||
|
||||
Repeater {
|
||||
id: systemButtons
|
||||
|
||||
model: [shutdown, reboot, suspend, hibernate]
|
||||
|
||||
RoundButton {
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
Layout.topMargin: root.font.pointSize * 6.5
|
||||
|
||||
text: modelData[1]
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
icon.source: modelData ? Qt.resolvedUrl("../Assets/" + modelData[0] + ".svg") : ""
|
||||
icon.height: 2 * Math.round((root.font.pointSize * 3) / 2)
|
||||
icon.width: 2 * Math.round((root.font.pointSize * 3) / 2)
|
||||
icon.color: config.SystemButtonsIconsColor
|
||||
palette.buttonText: config.SystemButtonsIconsColor
|
||||
display: AbstractButton.TextUnderIcon
|
||||
visible: config.HideSystemButtons != "true" && (config.BypassSystemButtonsChecks == "true" ? 1 : modelData[2])
|
||||
hoverEnabled: true
|
||||
|
||||
background: Rectangle {
|
||||
height: 2
|
||||
width: parent.width
|
||||
|
||||
color: "transparent"
|
||||
}
|
||||
|
||||
Keys.onReturnPressed: clicked()
|
||||
onClicked: {
|
||||
parent.forceActiveFocus()
|
||||
index == 0 ? sddm.powerOff() : index == 1 ? sddm.reboot() : index == 2 ? sddm.suspend() : sddm.hibernate()
|
||||
}
|
||||
KeyNavigation.left: index > 0 ? parent.children[index-1] : null
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "pressed"
|
||||
when: parent.children[index].down
|
||||
PropertyChanges {
|
||||
target: parent.children[index]
|
||||
icon.color: root.palette.buttonText
|
||||
palette.buttonText: Qt.darker(root.palette.buttonText, 1.1)
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hovered"
|
||||
when: parent.children[index].hovered
|
||||
PropertyChanges {
|
||||
target: parent.children[index]
|
||||
icon.color: root.palette.buttonText
|
||||
palette.buttonText: Qt.lighter(root.palette.buttonText, 1.1)
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "focused"
|
||||
when: parent.children[index].activeFocus
|
||||
PropertyChanges {
|
||||
target: parent.children[index]
|
||||
icon.color: root.palette.buttonText
|
||||
palette.buttonText: root.palette.buttonText
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
PropertyAnimation {
|
||||
properties: "palette.buttonText, border.color"
|
||||
duration: 150
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user