mirror of
https://github.com/Keyitdev/sddm-astronaut-theme.git
synced 2026-09-24 02:22:09 +00:00
Compare commits
6
Commits
292c87b770
..
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac297db891 | ||
|
|
07b64f0781 | ||
|
|
ad3390b420 | ||
|
|
57f0ae7221 | ||
|
|
60a73a22ef | ||
|
|
61e74ac096 |
@@ -1,10 +1,10 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Copyright (C) 2022-2026 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
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Column {
|
||||
id: clock
|
||||
@@ -13,11 +13,11 @@ Column {
|
||||
spacing: 0
|
||||
|
||||
Label {
|
||||
id:headerTextLabel
|
||||
id: headerTextLabel
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
font.pointSize: root.font.pointSize * 3
|
||||
font.pixelSize: rootFontSize * 4
|
||||
color: config.HeaderTextColor
|
||||
renderType: Text.QtRendering
|
||||
text: config.HeaderText
|
||||
@@ -28,7 +28,7 @@ Column {
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
font.pointSize: root.font.pointSize * 9
|
||||
font.pixelSize: rootFontSize * 12
|
||||
font.bold: true
|
||||
color: config.TimeTextColor
|
||||
renderType: Text.QtRendering
|
||||
@@ -44,7 +44,7 @@ Column {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
color: config.DateTextColor
|
||||
font.pointSize: root.font.pointSize * 2
|
||||
font.pixelSize: rootFontSize * 2.66
|
||||
font.bold: true
|
||||
renderType: Text.QtRendering
|
||||
|
||||
|
||||
+89
-61
@@ -1,41 +1,48 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Copyright (C) 2022-2026 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
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
|
||||
Column {
|
||||
id: inputContainer
|
||||
|
||||
Layout.fillWidth: true
|
||||
spacing: 0
|
||||
|
||||
property ComboBox exposeSession: sessionSelect.exposeSession
|
||||
property bool failed
|
||||
|
||||
readonly property real passwordFieldTopMargin: (Number(config.PasswordFieldTopMargin) || 0) * rootHeightUnit
|
||||
readonly property real loginButtonTopMargin: (Number(config.LoginButtonTopMargin) || 0) * rootHeightUnit
|
||||
|
||||
function findRegisteredUser(typedUser, matchRealName) {
|
||||
for (var i = 0; i < userRegistry.list.length; i++) {
|
||||
var candidate = userRegistry.list[i]
|
||||
if (typedUser === candidate.name || (matchRealName && typedUser === candidate.realName)) {
|
||||
return candidate
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
property url currentUserIcon: {
|
||||
var typedUser = username.text
|
||||
if (typedUser === "") {
|
||||
var highlighted = userRegistry.list[selectUser.currentIndex]
|
||||
return highlighted ? (highlighted.icon || "") : ""
|
||||
}
|
||||
var match = findRegisteredUser(typedUser, true)
|
||||
return match ? (match.icon || "") : ""
|
||||
}
|
||||
|
||||
function triggerLogin() {
|
||||
var typedUser = username.text
|
||||
var targetUser = typedUser
|
||||
|
||||
if (config.UseRealName == "true") {
|
||||
for (var i = 0; i < userRegistry.list.length; i++) {
|
||||
var u = userRegistry.list[i]
|
||||
if (typedUser === u.realName || typedUser === u.name) {
|
||||
targetUser = u.name
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var j = 0; j < userRegistry.list.length; j++) {
|
||||
var u2 = userRegistry.list[j]
|
||||
if (typedUser === u2.name) {
|
||||
targetUser = u2.name
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
var match = findRegisteredUser(typedUser, config.UseRealName == "true")
|
||||
var targetUser = match ? match.name : typedUser
|
||||
|
||||
sddm.login(targetUser, password.text, sessionSelect.selectedSession)
|
||||
}
|
||||
@@ -43,8 +50,7 @@ Column {
|
||||
Item {
|
||||
id: errorMessageField
|
||||
|
||||
// change also in selectSession
|
||||
height: root.font.pointSize * 2
|
||||
height: rootHeightUnit * 1.5
|
||||
width: parent.width / 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
@@ -54,8 +60,9 @@ Column {
|
||||
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
|
||||
text: failed ? config.TranslateLoginFailedWarning || textConstants.loginFailed + "!" : keyboard.capsLock ? config.TranslateCapslockWarning || textConstants.capslockWarning : ""
|
||||
|
||||
font.pixelSize: rootFontSize * 1.33
|
||||
font.italic: true
|
||||
color: config.WarningColor
|
||||
opacity: 0
|
||||
@@ -92,7 +99,7 @@ Column {
|
||||
Item {
|
||||
id: usernameField
|
||||
|
||||
height: root.font.pointSize * 4.5
|
||||
height: username.height
|
||||
width: parent.width / 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
@@ -102,6 +109,7 @@ Column {
|
||||
width: parent.height
|
||||
height: parent.height
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: selectUser.height * 0.2
|
||||
z: 2
|
||||
|
||||
model: userModel
|
||||
@@ -127,15 +135,20 @@ Column {
|
||||
|
||||
delegate: ItemDelegate {
|
||||
// minus padding
|
||||
width: popupHandler.width - 20
|
||||
width: popupHandler.width - (rootWidthUnit * 1.5)
|
||||
anchors.horizontalCenter: popupHandler.horizontalCenter
|
||||
|
||||
topPadding: rootScaleUnit * 6
|
||||
bottomPadding: rootScaleUnit * 6
|
||||
leftPadding: rootScaleUnit * 12
|
||||
rightPadding: rootScaleUnit * 12
|
||||
|
||||
contentItem: Text {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
text: config.UseRealName == "true" ? (model.realName || model.name) : model.name
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
font.pixelSize: rootFontSize * 1.06
|
||||
font.capitalization: Font.MixedCase
|
||||
font.family: root.font.family
|
||||
color: config.DropdownTextColor
|
||||
@@ -153,10 +166,10 @@ Column {
|
||||
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
|
||||
|
||||
icon.height: parent.height * 0.4
|
||||
icon.width: parent.height * 0.4
|
||||
enabled: false
|
||||
icon.color: config.UserIconColor
|
||||
icon.source: Qt.resolvedUrl("../Assets/User.svg")
|
||||
@@ -178,12 +191,12 @@ Column {
|
||||
implicitHeight: contentItem.implicitHeight
|
||||
width: usernameField.width
|
||||
y: parent.height - username.height / 3
|
||||
x: config.RightToLeftLayout == "true" ? -loginButton.width + selectUser.width : 0
|
||||
x: config.RightToLeftLayout == "true" ? (-loginButton.width + selectUser.width + selectUser.anchors.leftMargin) : 0 - selectUser.anchors.leftMargin
|
||||
rightMargin: config.RightToLeftLayout == "true" ? root.padding + usernameField.width / 2 : undefined
|
||||
padding: 10
|
||||
padding: rootHeightUnit * 0.75
|
||||
|
||||
contentItem: ListView {
|
||||
implicitHeight: contentHeight + 20
|
||||
implicitHeight: contentHeight + (rootHeightUnit * 1.5)
|
||||
|
||||
clip: true
|
||||
model: selectUser.popup.visible ? selectUser.delegateModel : null
|
||||
@@ -192,7 +205,7 @@ Column {
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
radius: config.RoundCorners / 2
|
||||
radius: (rootScaleUnit * config.RoundCorners) / 2
|
||||
color: config.DropdownBackgroundColor
|
||||
layer.enabled: true
|
||||
}
|
||||
@@ -243,9 +256,12 @@ Column {
|
||||
id: username
|
||||
|
||||
anchors.centerIn: parent
|
||||
height: root.font.pointSize * 3
|
||||
height: rootHeightUnit * 3
|
||||
width: parent.width
|
||||
font.pixelSize: rootFontSize * 1.33
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
leftPadding: selectUser.width
|
||||
rightPadding: selectUser.width
|
||||
z: 1
|
||||
|
||||
text: config.ForceLastUser == "true" ? selectUser.displayText : null
|
||||
@@ -266,8 +282,8 @@ Column {
|
||||
color: config.LoginFieldBackgroundColor
|
||||
opacity: 0.2
|
||||
border.color: "transparent"
|
||||
border.width: parent.activeFocus ? 2 : 1
|
||||
radius: config.RoundCorners || 0
|
||||
border.width: parent.activeFocus ? (rootScaleUnit * 2) : (rootScaleUnit * 1)
|
||||
radius: rootScaleUnit * config.RoundCorners || 0
|
||||
}
|
||||
|
||||
onAccepted: triggerLogin()
|
||||
@@ -290,25 +306,30 @@ Column {
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: passwordFieldSpacer
|
||||
width: 1
|
||||
height: passwordFieldTopMargin
|
||||
}
|
||||
|
||||
Item {
|
||||
id: passwordField
|
||||
|
||||
height: root.font.pointSize * 4.5
|
||||
height: password.height
|
||||
width: parent.width / 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Button {
|
||||
id: passwordIcon
|
||||
|
||||
width: parent.height
|
||||
height: parent.height
|
||||
width: selectUser.height * 1
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: selectUser.height * 0
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.leftMargin: selectUser.height * 0.2
|
||||
z: 2
|
||||
|
||||
icon.height: parent.height * 0.25
|
||||
icon.width: parent.height * 0.25
|
||||
icon.height: parent.height * 0.4
|
||||
icon.width: parent.height * 0.4
|
||||
icon.color: config.PasswordIconColor
|
||||
icon.source: Qt.resolvedUrl("../Assets/Password2.svg")
|
||||
|
||||
@@ -374,19 +395,22 @@ Column {
|
||||
TextField {
|
||||
id: password
|
||||
|
||||
height: root.font.pointSize * 3
|
||||
height: rootHeightUnit * 3
|
||||
width: parent.width
|
||||
font.pixelSize: rootFontSize * 1.33
|
||||
anchors.centerIn: parent
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
leftPadding: passwordIcon.width
|
||||
rightPadding: passwordIcon.width
|
||||
|
||||
font.bold: true
|
||||
color: config.PasswordFieldTextColor
|
||||
focus: config.PasswordFocus == "true" ? true : false
|
||||
focus: config.PasswordFocus == "true"
|
||||
echoMode: passwordIcon.checked ? TextInput.Normal : TextInput.Password
|
||||
placeholderText: config.TranslatePlaceholderPassword || textConstants.password
|
||||
placeholderTextColor: config.PlaceholderTextColor
|
||||
passwordCharacter: "•"
|
||||
passwordMaskDelay: config.HideCompletePassword == "true" ? undefined : 1000
|
||||
passwordMaskDelay: config.ShowLastPasswordCharacter == "true" ? 1000 : undefined
|
||||
renderType: Text.QtRendering
|
||||
selectByMouse: true
|
||||
|
||||
@@ -394,8 +418,8 @@ Column {
|
||||
color: config.PasswordFieldBackgroundColor
|
||||
opacity: 0.2
|
||||
border.color: "transparent"
|
||||
border.width: parent.activeFocus ? 2 : 1
|
||||
radius: config.RoundCorners || 0
|
||||
border.width: parent.activeFocus ? (rootScaleUnit * 2) : (rootScaleUnit * 1)
|
||||
radius: rootScaleUnit * config.RoundCorners || 0
|
||||
}
|
||||
onAccepted: triggerLogin()
|
||||
KeyNavigation.down: loginButton
|
||||
@@ -425,27 +449,31 @@ Column {
|
||||
]
|
||||
}
|
||||
|
||||
Item {
|
||||
id: loginButtonSpacer
|
||||
width: 1
|
||||
height: loginButtonTopMargin
|
||||
}
|
||||
|
||||
Item {
|
||||
id: login
|
||||
|
||||
// important
|
||||
// try 4 or 9 ...
|
||||
height: root.font.pointSize * 9
|
||||
height: loginButton.height
|
||||
width: parent.width / 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
visible: config.HideLoginButton == "true" ? false : true
|
||||
visible: config.ShowLoginButton == "true"
|
||||
|
||||
Button {
|
||||
id: loginButton
|
||||
|
||||
height: root.font.pointSize * 3
|
||||
height: rootHeightUnit * 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
|
||||
enabled: config.AllowEmptyPassword == "true" || (username.text != "" && password.text != "")
|
||||
hoverEnabled: true
|
||||
|
||||
contentItem: Text {
|
||||
@@ -453,7 +481,7 @@ Column {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
font.bold: true
|
||||
font.pointSize: root.font.pointSize
|
||||
font.pixelSize: rootFontSize * 1.33
|
||||
font.family: root.font.family
|
||||
color: config.LoginButtonTextColor
|
||||
text: parent.text
|
||||
@@ -465,7 +493,7 @@ Column {
|
||||
|
||||
color: config.LoginButtonBackgroundColor
|
||||
opacity: 0.2
|
||||
radius: config.RoundCorners || 0
|
||||
radius: rootScaleUnit * config.RoundCorners || 0
|
||||
}
|
||||
|
||||
states: [
|
||||
@@ -534,7 +562,7 @@ Column {
|
||||
Keys.onReturnPressed: clicked()
|
||||
Keys.onEnterPressed: clicked()
|
||||
|
||||
KeyNavigation.down: config.HideSystemButtons == "true" ? virtualKeyboard : systemButtons.children[0]
|
||||
KeyNavigation.down: config.ShowSystemButtons == "true" ? systemButtons.children[0] : virtualKeyboard
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,7 +576,7 @@ Column {
|
||||
Item {
|
||||
Component.onCompleted: {
|
||||
var currentList = userRegistry.list
|
||||
currentList.push({ "name": model.name, "realName": model.realName || "" })
|
||||
currentList.push({ "name": model.name, "realName": model.realName || "", "icon": model.icon || "" })
|
||||
userRegistry.list = currentList
|
||||
}
|
||||
}
|
||||
|
||||
+95
-36
@@ -1,63 +1,122 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Copyright (C) 2022-2026 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
|
||||
import QtQuick.Layouts
|
||||
import SddmComponents 2.0 as SDDM
|
||||
|
||||
ColumnLayout {
|
||||
Item {
|
||||
id: formContainer
|
||||
SDDM.TextConstants { id: textConstants }
|
||||
|
||||
property int p: config.ScreenPadding == "" ? 0 : config.ScreenPadding
|
||||
property string a: config.FormPosition
|
||||
readonly property real clockTopMargin: (Number(config.ClockTopMargin) || 0) * rootHeightUnit
|
||||
readonly property real profilePictureTopMargin: (Number(config.ProfilePictureTopMargin) || 0) * rootHeightUnit
|
||||
readonly property real loginInputTopMargin: (Number(config.LoginInputTopMargin) || 0) * rootHeightUnit
|
||||
readonly property real systemButtonsBottomMargin: (Number(config.SystemButtonsBottomMargin) || 0) * rootHeightUnit
|
||||
readonly property real sessionSelectBottomMargin: (Number(config.SessionSelectBottomMargin) || 0) * rootHeightUnit
|
||||
readonly property real virtualKeyboardButtonBottomMargin: (Number(config.VirtualKeyboardButtonBottomMargin) || 0) * rootHeightUnit
|
||||
|
||||
ColumnLayout {
|
||||
id: topGroup
|
||||
spacing: 0
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Rectangle {
|
||||
id: clockBox
|
||||
color: "transparent"
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: clockTopMargin
|
||||
Layout.preferredHeight: clock.implicitHeight + (rootHeightUnit * 1.5)
|
||||
implicitWidth: clock.implicitWidth + (rootWidthUnit * 3)
|
||||
radius: 20
|
||||
Layout.preferredWidth: implicitWidth
|
||||
Clock {
|
||||
anchors.fill: parent
|
||||
id: clock
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
||||
// important
|
||||
Layout.preferredHeight: root.height / 3
|
||||
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
|
||||
}
|
||||
Rectangle {
|
||||
id: profilePictureBox
|
||||
color: "transparent"
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: profilePictureTopMargin
|
||||
Layout.preferredHeight: profilePicture.height
|
||||
implicitWidth: profilePicture.width + (rootWidthUnit * 3)
|
||||
Layout.preferredWidth: implicitWidth
|
||||
ProfilePicture {
|
||||
id: profilePicture
|
||||
visible: config.ShowProfilePicture == "true"
|
||||
anchors.centerIn: parent
|
||||
width: rootHeightUnit * 11
|
||||
height: rootHeightUnit * 11
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: inputBox
|
||||
color: "transparent"
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: loginInputTopMargin
|
||||
Layout.preferredHeight: input.implicitHeight
|
||||
implicitWidth: input.implicitWidth
|
||||
Layout.preferredWidth: implicitWidth
|
||||
Input {
|
||||
id: input
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.preferredHeight: root.height / 10
|
||||
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
|
||||
Layout.topMargin: 0
|
||||
anchors.centerIn: parent
|
||||
width: rootWidthUnit * 65
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: bottomGroup
|
||||
spacing: 0
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Rectangle {
|
||||
id: systemButtonsBox
|
||||
color: "transparent"
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.bottomMargin: systemButtonsBottomMargin
|
||||
Layout.preferredHeight: systemButtons.implicitHeight
|
||||
implicitWidth: systemButtons.implicitWidth
|
||||
Layout.preferredWidth: implicitWidth
|
||||
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
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
}
|
||||
Rectangle {
|
||||
id: sessionSelectBox
|
||||
color: "transparent"
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.bottomMargin: sessionSelectBottomMargin
|
||||
Layout.preferredHeight: sessionSelect.height
|
||||
implicitWidth: sessionSelect.width
|
||||
Layout.preferredWidth: implicitWidth
|
||||
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
|
||||
anchors.centerIn: parent
|
||||
width: rootWidthUnit * 32.5
|
||||
}
|
||||
|
||||
}
|
||||
Rectangle {
|
||||
id: virtualKeyboardButtonBox
|
||||
color: "transparent"
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.bottomMargin: virtualKeyboardButtonBottomMargin
|
||||
Layout.preferredHeight: virtualKeyboardButton.height
|
||||
implicitWidth: virtualKeyboardButton.width
|
||||
Layout.preferredWidth: implicitWidth
|
||||
VirtualKeyboardButton {
|
||||
id: virtualKeyboardButton
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
||||
Layout.preferredHeight: root.height / 27
|
||||
Layout.maximumHeight: root.height / 27
|
||||
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
|
||||
anchors.centerIn: parent
|
||||
width: rootWidthUnit * 32.5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2026 Keyitdev
|
||||
// Distributed under the GPLv3+ License https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
|
||||
Item {
|
||||
id: profilePicture
|
||||
|
||||
property url userIcon: input.currentUserIcon
|
||||
property bool hasCustomIcon: userIcon != ""
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: avatarImage
|
||||
radius: width / 2
|
||||
color: config.ProfilePictureBorderColor
|
||||
opacity: 0.2
|
||||
z: -1
|
||||
}
|
||||
|
||||
Image {
|
||||
id: avatarImage
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: ringBorder.border.width
|
||||
source: hasCustomIcon ? profilePicture.userIcon : Qt.resolvedUrl("../Assets/User.svg")
|
||||
fillMode: hasCustomIcon ? Image.PreserveAspectCrop : Image.PreserveAspectFit
|
||||
smooth: true
|
||||
mipmap: true
|
||||
asynchronous: true
|
||||
visible: false
|
||||
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: circleMask
|
||||
|
||||
anchors.fill: avatarImage
|
||||
radius: rootScaleUnit * config.ProfilePictureRoundedCorners || 0
|
||||
visible: false
|
||||
layer.enabled: true
|
||||
}
|
||||
|
||||
MultiEffect {
|
||||
anchors.fill: avatarImage
|
||||
source: avatarImage
|
||||
maskEnabled: true
|
||||
maskSource: circleMask
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: ringBorder
|
||||
|
||||
anchors.fill: parent
|
||||
radius: rootScaleUnit * config.ProfilePictureRoundedCorners || 0
|
||||
color: "transparent"
|
||||
border.width: rootScaleUnit * config.ProfilePictureBorderWidth || 2
|
||||
border.color: config.ProfilePictureBorderColor
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,25 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Copyright (C) 2022-2026 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
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Item {
|
||||
id: sessionButton
|
||||
|
||||
height: root.font.pointSize
|
||||
height: selectSession.height
|
||||
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
|
||||
height: rootHeightUnit
|
||||
width: parent.width
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
hoverEnabled: true
|
||||
@@ -38,15 +35,20 @@ Item {
|
||||
|
||||
delegate: ItemDelegate {
|
||||
// minus padding
|
||||
width: popupHandler.width - 20
|
||||
width: popupHandler.width - (rootScaleUnit * 20)
|
||||
anchors.horizontalCenter: popupHandler.horizontalCenter
|
||||
|
||||
topPadding: rootScaleUnit * 6
|
||||
bottomPadding: rootScaleUnit * 6
|
||||
leftPadding: rootScaleUnit * 12
|
||||
rightPadding: rootScaleUnit * 12
|
||||
|
||||
contentItem: Text {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
text: model.name
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
font.pixelSize: rootFontSize * 1.06
|
||||
font.family: root.font.family
|
||||
color: config.DropdownTextColor
|
||||
}
|
||||
@@ -64,18 +66,19 @@ Item {
|
||||
id: displayedItem
|
||||
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
text: (config.TranslateSessionSelection || "Session") + " (" + selectSession.currentText + ")"
|
||||
color: config.SessionButtonTextColor
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
font.pixelSize: rootFontSize * 1.06
|
||||
font.family: root.font.family
|
||||
|
||||
Keys.onReleased: parent.popup.open()
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
height: parent.visualFocus ? 2 : 0
|
||||
width: displayedItem.implicitWidth
|
||||
height: parent.visualFocus ? (rootScaleUnit * 2) : 0
|
||||
width: parent.width
|
||||
|
||||
color: "transparent"
|
||||
}
|
||||
@@ -85,12 +88,12 @@ Item {
|
||||
|
||||
implicitHeight: contentItem.implicitHeight
|
||||
width: sessionButton.width
|
||||
y: parent.height - 1
|
||||
x: -popupHandler.width/2 + displayedItem.width/2
|
||||
padding: 10
|
||||
y: parent.height + rootHeightUnit
|
||||
x: 0
|
||||
padding: rootScaleUnit * 10
|
||||
|
||||
contentItem: ListView {
|
||||
implicitHeight: contentHeight + 20
|
||||
implicitHeight: contentHeight + (rootScaleUnit * 20)
|
||||
|
||||
clip: true
|
||||
model: selectSession.popup.visible ? selectSession.delegateModel : null
|
||||
@@ -99,7 +102,7 @@ Item {
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
radius: config.RoundCorners / 2
|
||||
radius: (rootScaleUnit * config.RoundCorners) / 2
|
||||
color: config.DropdownBackgroundColor
|
||||
layer.enabled: true
|
||||
}
|
||||
|
||||
@@ -1,81 +1,77 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Copyright (C) 2022-2026 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
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
|
||||
RowLayout {
|
||||
|
||||
spacing: root.font.pointSize
|
||||
|
||||
spacing: rootFontSize
|
||||
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 {
|
||||
id: sysButton
|
||||
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)
|
||||
font.pixelSize: rootFontSize * 1.06
|
||||
icon.source: Qt.resolvedUrl("../Assets/" + modelData[0] + ".svg")
|
||||
icon.height: 2 * Math.round((rootFontSize * 3) / 2)
|
||||
icon.width: 2 * Math.round((rootFontSize * 3) / 2)
|
||||
icon.color: config.SystemButtonsIconsColor
|
||||
palette.buttonText: config.SystemButtonsIconsColor
|
||||
display: AbstractButton.TextUnderIcon
|
||||
visible: config.HideSystemButtons != "true" && (config.BypassSystemButtonsChecks == "true" ? 1 : modelData[2])
|
||||
spacing: rootScaleUnit * 6
|
||||
padding: rootScaleUnit * 8
|
||||
visible: config.ShowSystemButtons == "true" && (config.BypassSystemButtonsChecks == "true" || modelData[2])
|
||||
hoverEnabled: true
|
||||
|
||||
background: Rectangle {
|
||||
height: 2
|
||||
height: rootScaleUnit * 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()
|
||||
switch (index) {
|
||||
case 0: sddm.powerOff(); break
|
||||
case 1: sddm.reboot(); break
|
||||
case 2: sddm.suspend(); break
|
||||
default: sddm.hibernate()
|
||||
}
|
||||
}
|
||||
KeyNavigation.left: index > 0 ? parent.children[index-1] : null
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "pressed"
|
||||
when: parent.children[index].down
|
||||
when: sysButton.down
|
||||
PropertyChanges {
|
||||
target: parent.children[index]
|
||||
target: sysButton
|
||||
icon.color: root.palette.buttonText
|
||||
palette.buttonText: Qt.darker(root.palette.buttonText, 1.1)
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hovered"
|
||||
when: parent.children[index].hovered
|
||||
when: sysButton.hovered
|
||||
PropertyChanges {
|
||||
target: parent.children[index]
|
||||
target: sysButton
|
||||
icon.color: root.palette.buttonText
|
||||
palette.buttonText: Qt.lighter(root.palette.buttonText, 1.1)
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "focused"
|
||||
when: parent.children[index].activeFocus
|
||||
when: sysButton.activeFocus
|
||||
PropertyChanges {
|
||||
target: parent.children[index]
|
||||
target: sysButton
|
||||
icon.color: root.palette.buttonText
|
||||
palette.buttonText: root.palette.buttonText
|
||||
}
|
||||
@@ -89,9 +85,6 @@ RowLayout {
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Copyright (C) 2022-2026 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.VirtualKeyboard 2.3
|
||||
import QtQuick
|
||||
import QtQuick.VirtualKeyboard
|
||||
|
||||
InputPanel {
|
||||
id: virtualKeyboard
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Copyright (C) 2022-2026 Keyitdev
|
||||
// Distributed under the GPLv3+ License https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Item {
|
||||
id: virtualKeyboardButtonRoot
|
||||
|
||||
height: virtualKeyboardButton.height
|
||||
width: parent.width / 2
|
||||
|
||||
Button {
|
||||
id: virtualKeyboardButton
|
||||
|
||||
height: rootHeightUnit
|
||||
width: parent.width
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
z: 1
|
||||
|
||||
visible: virtualKeyboard.status == Loader.Ready && config.HideVirtualKeyboard == "false"
|
||||
visible: virtualKeyboard.status == Loader.Ready && config.ShowVirtualKeyboard == "true"
|
||||
checkable: true
|
||||
onClicked: virtualKeyboard.switchState()
|
||||
|
||||
@@ -28,8 +34,11 @@ Item {
|
||||
contentItem: Text {
|
||||
id: virtualKeyboardButtonText
|
||||
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)"
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
font.pixelSize: rootFontSize * 1.06
|
||||
font.family: root.font.family
|
||||
color: parent.visualFocus ? config.HoverVirtualKeyboardButtonTextColor : config.VirtualKeyboardButtonTextColor
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2025 Keyitdev
|
||||
// Copyright (C) 2022-2026 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
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Effects
|
||||
import QtMultimedia
|
||||
|
||||
@@ -14,8 +13,8 @@ import "Components"
|
||||
Pane {
|
||||
id: root
|
||||
|
||||
height: config.ScreenHeight || Screen.height
|
||||
width: config.ScreenWidth || Screen.ScreenWidth
|
||||
height: Screen.height
|
||||
width: Screen.width
|
||||
padding: config.ScreenPadding
|
||||
|
||||
LayoutMirroring.enabled: config.RightToLeftLayout == "true" ? true : Qt.application.layoutDirection === Qt.RightToLeft
|
||||
@@ -27,27 +26,36 @@ Pane {
|
||||
palette.buttonText: config.HoverSystemButtonsIconsColor
|
||||
|
||||
font.family: config.Font
|
||||
font.pointSize: config.FontSize !== "" ? config.FontSize : parseInt(height / 80) || 13
|
||||
|
||||
function safeOffset(val) {
|
||||
var n = Number(val)
|
||||
return (val === "" || val === undefined || val === null || isNaN(n)) ? 0 : n
|
||||
}
|
||||
|
||||
property real rootFontSize: (config.FontSize !== "" && config.FontSize !== undefined ? Number(config.FontSize) : (height / 90)) + safeOffset(config.FontSizeOffset)
|
||||
property real rootHeightUnit: (config.HeightUnit !== "" && config.HeightUnit !== undefined ? Number(config.HeightUnit) : (height / 90)) + safeOffset(config.HeightUnitOffset)
|
||||
property real rootWidthUnit: (config.WidthUnit !== "" && config.WidthUnit !== undefined ? Number(config.WidthUnit) : (width / 160)) + safeOffset(config.WidthUnitOffset)
|
||||
property real rootScaleUnit: (config.ScaleUnit !== "" && config.ScaleUnit !== undefined ? Number(config.ScaleUnit) : (height / 1080)) + safeOffset(config.ScaleUnitOffset)
|
||||
|
||||
focus: true
|
||||
|
||||
property bool leftleft: config.HaveFormBackground == "true" &&
|
||||
config.PartialBlur == "false" &&
|
||||
config.PartialBlur != "true" &&
|
||||
config.FormPosition == "left" &&
|
||||
config.BackgroundHorizontalAlignment == "left"
|
||||
|
||||
property bool leftcenter: config.HaveFormBackground == "true" &&
|
||||
config.PartialBlur == "false" &&
|
||||
config.PartialBlur != "true" &&
|
||||
config.FormPosition == "left" &&
|
||||
config.BackgroundHorizontalAlignment == "center"
|
||||
|
||||
property bool rightright: config.HaveFormBackground == "true" &&
|
||||
config.PartialBlur == "false" &&
|
||||
config.PartialBlur != "true" &&
|
||||
config.FormPosition == "right" &&
|
||||
config.BackgroundHorizontalAlignment == "right"
|
||||
|
||||
property bool rightcenter: config.HaveFormBackground == "true" &&
|
||||
config.PartialBlur == "false" &&
|
||||
config.PartialBlur != "true" &&
|
||||
config.FormPosition == "right" &&
|
||||
config.BackgroundHorizontalAlignment == "center"
|
||||
|
||||
@@ -77,7 +85,7 @@ Pane {
|
||||
z: 1
|
||||
|
||||
color: config.FormBackgroundColor
|
||||
visible: config.HaveFormBackground == "true" ? true : false
|
||||
visible: config.HaveFormBackground == "true"
|
||||
opacity: config.PartialBlur == "true" ? 0.3 : 1
|
||||
}
|
||||
|
||||
@@ -227,7 +235,7 @@ Pane {
|
||||
Image.AlignBottom : Image.AlignVCenter
|
||||
|
||||
speed: config.BackgroundSpeed == "" ? 1.0 : config.BackgroundSpeed
|
||||
paused: config.PauseBackground == "true" ? 1 : 0
|
||||
paused: config.PauseBackground == "true"
|
||||
fillMode: config.CropBackground == "true" ? Image.PreserveAspectCrop : Image.PreserveAspectFit
|
||||
asynchronous: true
|
||||
cache: true
|
||||
@@ -243,7 +251,7 @@ Pane {
|
||||
player.play();
|
||||
}
|
||||
else{
|
||||
backgroundImage.source = config.background || config.Background
|
||||
backgroundImage.source = config.Background
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -262,7 +270,7 @@ Pane {
|
||||
|
||||
sourceItem: backgroundImage
|
||||
sourceRect: Qt.rect(x,y,width,height)
|
||||
visible: config.FullBlur == "true" || config.PartialBlur == "true" ? true : false
|
||||
visible: config.FullBlur == "true" || config.PartialBlur == "true"
|
||||
}
|
||||
|
||||
MultiEffect {
|
||||
@@ -274,15 +282,21 @@ Pane {
|
||||
// anchors.centerIn: config.FullBlur == "true" ? parent : form
|
||||
|
||||
// This solves problem when FullBlur and HaveFormBackground is set to true but PartialBlur is false and FormPosition isn't center.
|
||||
width: (config.FullBlur == "true" && config.PartialBlur == "false" && config.FormPosition != "center" ) ? parent.width - formBackground.width : config.FullBlur == "true" ? parent.width : form.width
|
||||
width: config.FullBlur == "true" ? (config.HaveFormBackground == "true" && config.PartialBlur != "true" && config.FormPosition != "center" ? parent.width - formBackground.width : parent.width) : form.width
|
||||
anchors.centerIn: config.FullBlur == "true" ? backgroundImage : form
|
||||
|
||||
source: config.FullBlur == "true" ? backgroundImage : blurMask
|
||||
blurEnabled: true
|
||||
autoPaddingEnabled: false
|
||||
blur: config.Blur == "" ? 2.0 : config.Blur
|
||||
blurMax: config.BlurMax == "" ? 48 : config.BlurMax
|
||||
visible: config.FullBlur == "true" || config.PartialBlur == "true" ? true : false
|
||||
|
||||
property real parsedBlur: config.Blur === "" ? 2.0 : parseFloat(config.Blur)
|
||||
property real scaledBlur: parsedBlur * root.rootScaleUnit
|
||||
|
||||
blur: Math.min(1.0, scaledBlur)
|
||||
blurMax: config.BlurMax !== "" ? parseInt(config.BlurMax, 10) : 48
|
||||
blurMultiplier: Math.max(0.0, scaledBlur - 1.0)
|
||||
|
||||
visible: config.FullBlur == "true" || config.PartialBlur == "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ Author=keyitdev
|
||||
Website=https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
License=GPL-3.0-or-later
|
||||
Type=sddm-theme
|
||||
Version=1.4
|
||||
Version=1.5
|
||||
ConfigFile=Themes/astronaut.conf
|
||||
Screenshot=Previews/astronaut.png
|
||||
MainScript=Main.qml
|
||||
|
||||
Reference in New Issue
Block a user