diff --git a/Backgrounds/default b/Backgrounds/default new file mode 100644 index 0000000..0e45505 Binary files /dev/null and b/Backgrounds/default differ diff --git a/Backgrounds/default.png b/Backgrounds/default.png deleted file mode 100644 index a31ad92..0000000 Binary files a/Backgrounds/default.png and /dev/null differ diff --git a/Components/Clock.qml b/Components/Clock.qml index aca05d8..55fafe8 100644 --- a/Components/Clock.qml +++ b/Components/Clock.qml @@ -1,5 +1,5 @@ // Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme -// Copyright (C) 2022-2024 Keyitdev +// 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 @@ -8,23 +8,31 @@ import QtQuick.Controls 2.15 Column { id: clock - spacing: 0 + width: parent.width / 2 + spacing: 0 Label { + id:headerTextLabel + anchors.horizontalCenter: parent.horizontalCenter - font.pointSize: config.HeaderText !=="" ? root.font.pointSize * 3 : 0 - color: root.palette.text + + font.pointSize: root.font.pointSize * 3 + color: config.HeaderTextColor renderType: Text.QtRendering text: config.HeaderText } Label { id: timeLabel + anchors.horizontalCenter: parent.horizontalCenter - font.pointSize: root.font.pointSize * 3 - color: root.palette.text + + 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) } @@ -32,10 +40,14 @@ Column { Label { id: dateLabel + anchors.horizontalCenter: parent.horizontalCenter - color: root.palette.text + + color: config.DateTextColor font.pointSize: root.font.pointSize * 2 + 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) } diff --git a/Components/Input.qml b/Components/Input.qml index 0ef2b9f..a980e1b 100644 --- a/Components/Input.qml +++ b/Components/Input.qml @@ -1,34 +1,40 @@ // Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme -// Copyright (C) 2022-2024 Keyitdev +// 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 -import Qt5Compat.GraphicalEffects Column { id: inputContainer + Layout.fillWidth: true - property Control exposeSession: sessionSelect.exposeSession + 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 - text: failed ? config.TranslateLoginFailedWarning || textConstants.loginFailed + "!" : keyboard.capsLock ? config.TranslateCapslockWarning || textConstants.capslockWarning : null 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: root.palette.text + color: config.WarningColor opacity: 0 + states: [ State { name: "fail" @@ -66,22 +72,11 @@ Column { anchors.horizontalCenter: parent.horizontalCenter ComboBox { - id: selectUser width: parent.height height: parent.height anchors.left: parent.left - - property var popkey: config.ForceRightToLeft == "true" ? Qt.Key_Right : Qt.Key_Left - Keys.onPressed: { - 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 z: 2 model: userModel @@ -92,40 +87,56 @@ Column { 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 { - width: parent.width - anchors.horizontalCenter: parent.horizontalCenter + // 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 - color: selectUser.highlightedIndex === index ? root.palette.highlight.hslLightness >= 0.7 ? "#444" : "white" : root.palette.window.hslLightness >= 0.8 ? root.palette.highlight.hslLightness >= 0.8 ? "#444" : root.palette.highlight : "white" - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter + font.family: root.font.family + color: config.DropdownTextColor } - highlighted: parent.highlightedIndex === index + background: Rectangle { - color: selectUser.highlightedIndex === index ? root.palette.highlight : "transparent" + 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: root.palette.text - icon.source: Qt.resolvedUrl("../Assets/User.svg") + id: usernameIcon - background: Rectangle { - color: "transparent" - border.color: "transparent" - } + 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 { @@ -134,16 +145,19 @@ Column { } popup: Popup { - y: parent.height - username.height / 3 - x: config.ForceRightToLeft == "true" ? -loginButton.width + selectUser.width : 0 - rightMargin: config.ForceRightToLeft == "true" ? root.padding + usernameField.width / 2 : undefined - width: usernameField.width + 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 { - clip: true implicitHeight: contentHeight + 20 + + clip: true model: selectUser.popup.visible ? selectUser.delegateModel : null currentIndex: selectUser.highlightedIndex ScrollIndicator.vertical: ScrollIndicator { } @@ -151,17 +165,8 @@ Column { background: Rectangle { radius: config.RoundCorners / 2 - color: root.palette.window + color: config.DropdownBackgroundColor layer.enabled: true - layer.effect: DropShadow { - transparentBorder: true - horizontalOffset: 0 - verticalOffset: 10 * config.InterfaceShadowSize - radius: 20 * config.InterfaceShadowSize - samples: 41 * config.InterfaceShadowSize - cached: true - color: Qt.hsla(0,0,0,config.InterfaceShadowOpacity) - } } enter: Transition { @@ -175,7 +180,7 @@ Column { when: selectUser.down PropertyChanges { target: usernameIcon - icon.color: Qt.lighter(root.palette.highlight, 1.1) + icon.color: Qt.lighter(config.HoverUserIconColor, 1.1) } }, State { @@ -183,7 +188,7 @@ Column { when: selectUser.hovered PropertyChanges { target: usernameIcon - icon.color: Qt.lighter(root.palette.highlight, 1.2) + icon.color: Qt.lighter(config.HoverUserIconColor, 1.2) } }, State { @@ -191,11 +196,10 @@ Column { when: selectUser.activeFocus PropertyChanges { target: usernameIcon - icon.color: root.palette.highlight + icon.color: config.HoverUserIconColor } } ] - transitions: [ Transition { PropertyAnimation { @@ -209,31 +213,37 @@ Column { TextField { id: username - text: config.ForceLastUser == "true" ? selectUser.currentText : null - font.bold: true - font.capitalization: config.AllowBadUsernames == "false" ? Font.AllLowercase : Font.MixedCase + anchors.centerIn: parent height: root.font.pointSize * 3 width: parent.width - placeholderText: config.TranslatePlaceholderUsername || textConstants.userName - placeholderTextColor: config.placeholderColor - selectByMouse: true 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: "#222222" + color: config.LoginFieldBackgroundColor opacity: 0.2 border.color: "transparent" border.width: parent.activeFocus ? 2 : 1 radius: config.RoundCorners || 0 } - onAccepted: config.AllowBadUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession) - KeyNavigation.down: showPassword - z: 1 + + 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 { @@ -241,11 +251,11 @@ Column { when: username.activeFocus PropertyChanges { target: username.background - border.color: root.palette.highlight + border.color: config.HighlightBorderColor } PropertyChanges { target: username - color: root.palette.highlightedText + color: Qt.lighter(config.LoginFieldTextColor, 1.15) } } ] @@ -260,16 +270,18 @@ Column { anchors.horizontalCenter: parent.horizontalCenter Button { - id: showPassword - z: 2 - width: selectUser.height * 1 + id: passwordIcon + height: parent.height + width: selectUser.height * 1 anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter 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: root.palette.text + icon.color: config.PasswordIconColor icon.source: Qt.resolvedUrl("../Assets/Password2.svg") background: Rectangle { @@ -280,46 +292,46 @@ Column { states: [ State { name: "visiblePasswordFocused" - when: showPassword.checked && showPassword.activeFocus + when: passwordIcon.checked && passwordIcon.activeFocus PropertyChanges { - target: showPassword + target: passwordIcon icon.source: Qt.resolvedUrl("../Assets/Password.svg") - icon.color: root.palette.highlight + icon.color: config.HoverPasswordIconColor } }, State { name: "visiblePasswordHovered" - when: showPassword.checked && showPassword.hovered + when: passwordIcon.checked && passwordIcon.hovered PropertyChanges { - target: showPassword + target: passwordIcon icon.source: Qt.resolvedUrl("../Assets/Password.svg") - icon.color: root.palette.highlight + icon.color: config.HoverPasswordIconColor } }, State { name: "visiblePassword" - when: showPassword.checked + when: passwordIcon.checked PropertyChanges { - target: showPassword + target: passwordIcon icon.source: Qt.resolvedUrl("../Assets/Password.svg") } }, State { name: "hiddenPasswordFocused" - when: showPassword.enabled && showPassword.activeFocus + when: passwordIcon.enabled && passwordIcon.activeFocus PropertyChanges { - target: showPassword + target: passwordIcon icon.source: Qt.resolvedUrl("../Assets/Password2.svg") - icon.color: root.palette.highlight + icon.color: config.HoverPasswordIconColor } }, State { name: "hiddenPasswordHovered" - when: showPassword.hovered + when: passwordIcon.hovered PropertyChanges { - target: showPassword + target: passwordIcon icon.source: Qt.resolvedUrl("../Assets/Password2.svg") - icon.color: root.palette.highlight + icon.color: config.HoverPasswordIconColor } } ] @@ -333,27 +345,31 @@ Column { TextField { id: password - anchors.centerIn: parent + height: root.font.pointSize * 3 width: parent.width - font.bold: true - focus: config.ForcePasswordFocus == "true" ? true : false - selectByMouse: true - echoMode: showPassword.checked ? TextInput.Normal : TextInput.Password - placeholderText: config.TranslatePlaceholderPassword || textConstants.password - placeholderTextColor: config.placeholderColor + 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.ForceHideCompletePassword == "true" ? undefined : 1000 + passwordMaskDelay: config.HideCompletePassword == "true" ? undefined : 1000 renderType: Text.QtRendering + selectByMouse: true + background: Rectangle { - color: "#222222" + color: config.PasswordFieldBackgroundColor opacity: 0.2 border.color: "transparent" border.width: parent.activeFocus ? 2 : 1 radius: config.RoundCorners || 0 } - onAccepted: config.AllowBadUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession) + onAccepted: config.AllowUppercaseLettersInUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession) KeyNavigation.down: loginButton } @@ -363,15 +379,14 @@ Column { when: password.activeFocus PropertyChanges { target: password.background - border.color: root.palette.highlight + border.color: config.HighlightBorderColor } PropertyChanges { target: password - color: root.palette.highlight + color: Qt.lighter(config.LoginFieldTextColor, 1.15) } } ] - transitions: [ Transition { PropertyAnimation { @@ -384,35 +399,43 @@ Column { 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 + + visible: config.HideLoginButton == "true" ? false : true + Button { - id: loginButton - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - text: config.TranslateLogin || textConstants.login + 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 { - text: parent.text - color: config.OverrideLoginButtonTextColor != "" ? config.OverrideLoginButtonTextColor : root.palette.highlight.hslLightness >= 0.7 ? "#444" : "white" - font.pointSize: root.font.pointSize - font.family: root.font.family 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.5 } background: Rectangle { id: buttonBackground - color: "white" + + color: config.LoginButtonBackgroundColor opacity: 0.2 radius: config.RoundCorners || 0 } @@ -423,7 +446,7 @@ Column { when: loginButton.down PropertyChanges { target: buttonBackground - color: Qt.darker(root.palette.highlight, 1.1) + color: Qt.darker(config.LoginButtonBackgroundColor, 1.1) opacity: 1 } PropertyChanges { @@ -435,7 +458,7 @@ Column { when: loginButton.hovered PropertyChanges { target: buttonBackground - color: Qt.lighter(root.palette.highlight, 1.15) + color: Qt.lighter(config.LoginButtonBackgroundColor, 1.15) opacity: 1 } PropertyChanges { @@ -448,7 +471,7 @@ Column { when: loginButton.activeFocus PropertyChanges { target: buttonBackground - color: Qt.lighter(root.palette.highlight, 1.2) + color: Qt.lighter(config.LoginButtonBackgroundColor, 1.2) opacity: 1 } PropertyChanges { @@ -461,7 +484,7 @@ Column { when: loginButton.enabled PropertyChanges { target: buttonBackground; - color: root.palette.highlight; + color: config.LoginButtonBackgroundColor; opacity: 1 } PropertyChanges { @@ -470,7 +493,6 @@ Column { } } ] - transitions: [ Transition { PropertyAnimation { @@ -479,22 +501,19 @@ Column { } } ] - onClicked: config.AllowBadUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession) + + 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() - KeyNavigation.down: sessionSelect.exposeSession + + KeyNavigation.down: config.HideSystemButtons == "true" ? virtualKeyboard : systemButtons.children[0] } } - SessionButton { - id: sessionSelect - loginButtonWidth: loginButton.background.width - } - Connections { target: sddm - onLoginSucceeded: {} - onLoginFailed: { + function onLoginSucceeded() {} + function onLoginFailed() { failed = true resetError.running ? resetError.stop() && resetError.start() : resetError.start() } @@ -506,4 +525,4 @@ Column { onTriggered: failed = false running: false } -} \ No newline at end of file +} diff --git a/Components/LoginForm.qml b/Components/LoginForm.qml index 2283449..2d79981 100644 --- a/Components/LoginForm.qml +++ b/Components/LoginForm.qml @@ -1,5 +1,5 @@ // Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme -// Copyright (C) 2022-2024 Keyitdev +// 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 @@ -11,14 +11,12 @@ ColumnLayout { id: formContainer SDDM.TextConstants { id: textConstants } - property int p: config.ScreenPadding + property int p: config.ScreenPadding == "" ? 0 : config.ScreenPadding property string a: config.FormPosition - property alias systemButtonVisibility: systemButtons.visible - property alias clockVisibility: clock.visible - property bool virtualKeyboardActive Clock { id: clock + Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom // important Layout.preferredHeight: root.height / 3 @@ -27,19 +25,39 @@ ColumnLayout { 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: virtualKeyboardActive ? -height * 1.5 : 0 + Layout.topMargin: 0 } SystemButtons { id: systemButtons + Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom - Layout.preferredHeight: root.height / 4 - Layout.maximumHeight: root.height / 4 + 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 + } + + 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 + } } diff --git a/Components/SessionButton.qml b/Components/SessionButton.qml index d6b753b..8c5a1d6 100644 --- a/Components/SessionButton.qml +++ b/Components/SessionButton.qml @@ -1,64 +1,58 @@ // Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme -// Copyright (C) 2022-2024 Keyitdev +// 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 -import Qt5Compat.GraphicalEffects Item { id: sessionButton + height: root.font.pointSize width: parent.width / 2 - anchors.horizontalCenter: parent.horizontalCenter + property var selectedSession: selectSession.currentIndex property string textConstantSession property int loginButtonWidth - property Control exposeSession: selectSession + property ComboBox exposeSession: selectSession ComboBox { id: selectSession + // important // change also in errorMessage height: root.font.pointSize * 2 - hoverEnabled: true - anchors.left: parent.left - Keys.onPressed: { - if (event.key == Qt.Key_Up && loginButton.state != "enabled" && !popup.opened) - revealSecret.focus = true, - revealSecret.state = "focused", - currentIndex = currentIndex + 1; - if (event.key == Qt.Key_Up && loginButton.state == "enabled" && !popup.opened) - loginButton.focus = true, - loginButton.state = "focused", - currentIndex = currentIndex + 1; - if (event.key == Qt.Key_Down && !popup.opened) - systemButtons.children[0].focus = true, - systemButtons.children[0].state = "focused", - currentIndex = currentIndex - 1; - if ((event.key == Qt.Key_Left || event.key == Qt.Key_Right) && !popup.opened) - popup.open(); - } + 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 { - width: parent.width - anchors.horizontalCenter: parent.horizontalCenter + // 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: selectSession.highlightedIndex === index ? root.palette.highlight.hslLightness >= 0.7 ? "#444444" : "white" : root.palette.window.hslLightness >= 0.8 ? root.palette.highlight.hslLightness >= 0.8 ? "#444444" : root.palette.highlight : "white" - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter + color: config.DropdownTextColor } - highlighted: parent.highlightedIndex === index + background: Rectangle { - color: selectSession.highlightedIndex === index ? root.palette.highlight : "transparent" + color: selectSession.highlightedIndex === index ? config.DropdownSelectedBackgroundColor : "transparent" } } @@ -68,38 +62,37 @@ Item { contentItem: Text { id: displayedItem - text: selectSession.currentText - color: root.palette.text + verticalAlignment: Text.AlignVCenter - anchors.left: parent.left - anchors.leftMargin: 3 + + 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 { - color: "transparent" - border.width: parent.visualFocus ? 1 : 0 - border.color: "transparent" height: parent.visualFocus ? 2 : 0 width: displayedItem.implicitWidth - anchors.top: parent.bottom - anchors.left: parent.left - anchors.leftMargin: 3 + + color: "transparent" } popup: Popup { id: popupHandler - y: parent.height - 1 - x: config.ForceRightToLeft == "true" ? -loginButtonWidth + displayedItem.width : 0 - width: sessionButton.width + implicitHeight: contentItem.implicitHeight + width: sessionButton.width + y: parent.height - 1 + x: -popupHandler.width/2 + displayedItem.width/2 padding: 10 contentItem: ListView { - clip: true implicitHeight: contentHeight + 20 + + clip: true model: selectSession.popup.visible ? selectSession.delegateModel : null currentIndex: selectSession.highlightedIndex ScrollIndicator.vertical: ScrollIndicator { } @@ -107,17 +100,8 @@ Item { background: Rectangle { radius: config.RoundCorners / 2 - color: config.BackgroundColor + color: config.DropdownBackgroundColor layer.enabled: true - layer.effect: DropShadow { - transparentBorder: true - horizontalOffset: 0 - verticalOffset: 0 - radius: 20 * config.InterfaceShadowSize - samples: 41 * config.InterfaceShadowSize - cached: true - color: Qt.hsla(0,0,0,config.InterfaceShadowOpacity) - } } enter: Transition { @@ -131,11 +115,7 @@ Item { when: selectSession.down PropertyChanges { target: displayedItem - color: Qt.darker(root.palette.highlight, 1.1) - } - PropertyChanges { - target: selectSession.background - border.color: Qt.darker(root.palette.highlight, 1.1) + color: Qt.darker(config.HoverSessionButtonTextColor, 1.1) } }, State { @@ -143,11 +123,7 @@ Item { when: selectSession.hovered PropertyChanges { target: displayedItem - color: Qt.lighter(root.palette.highlight, 1.1) - } - PropertyChanges { - target: selectSession.background - border.color: Qt.lighter(root.palette.highlight, 1.1) + color: Qt.lighter(config.HoverSessionButtonTextColor, 1.1) } }, State { @@ -155,19 +131,14 @@ Item { when: selectSession.visualFocus PropertyChanges { target: displayedItem - color: root.palette.highlight - } - PropertyChanges { - target: selectSession.background - border.color: root.palette.highlight + color: config.HoverSessionButtonTextColor } } ] - transitions: [ Transition { PropertyAnimation { - properties: "color, border.color" + properties: "color" duration: 150 } } diff --git a/Components/SystemButtons.qml b/Components/SystemButtons.qml index be340d6..eb7ab2b 100644 --- a/Components/SystemButtons.qml +++ b/Components/SystemButtons.qml @@ -1,5 +1,5 @@ // Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme -// Copyright (C) 2022-2024 Keyitdev +// 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 @@ -11,59 +11,55 @@ 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 var reboot: ["Reboot", config.TranslateReboot || textConstants.reboot, sddm.canReboot] - property var shutdown: ["Shutdown", config.TranslateShutdown || textConstants.shutdown, sddm.canPowerOff] - property Control exposedSession + property ComboBox exposedSession Repeater { - id: systemButtons - model: [suspend, hibernate, reboot, shutdown] + + 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 - Layout.alignment: Qt.AlignHCenter 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.IconColor + icon.color: config.SystemButtonsIconsColor + palette.buttonText: config.SystemButtonsIconsColor display: AbstractButton.TextUnderIcon - visible: config.ForceHideSystemButtons != "true" && modelData[2] + visible: config.HideSystemButtons != "true" && (config.BypassSystemButtonsChecks == "true" ? 1 : modelData[2]) hoverEnabled: true - palette.buttonText: root.palette.text + background: Rectangle { height: 2 - color: "transparent" width: parent.width - border.width: parent.activeFocus ? 1 : 0 - border.color: "transparent" - anchors.top: parent.bottom + + color: "transparent" } + Keys.onReturnPressed: clicked() onClicked: { parent.forceActiveFocus() - index == 0 ? sddm.suspend() : index == 1 ? sddm.hibernate() : index == 2 ? sddm.reboot() : sddm.powerOff() + index == 0 ? sddm.powerOff() : index == 1 ? sddm.reboot() : index == 2 ? sddm.suspend() : sddm.hibernate() } - KeyNavigation.up: exposedSession - KeyNavigation.left: parent.children[index-1] - + 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.highlight - palette.buttonText: Qt.darker(root.palette.highlight, 1.1) - } - PropertyChanges { - target: parent.children[index].background - icon.color: root.palette.highlight - border.color: Qt.darker(root.palette.highlight, 1.1) + icon.color: root.palette.buttonText + palette.buttonText: Qt.darker(root.palette.buttonText, 1.1) } }, State { @@ -71,13 +67,8 @@ RowLayout { when: parent.children[index].hovered PropertyChanges { target: parent.children[index] - icon.color: root.palette.highlight - palette.buttonText: Qt.lighter(root.palette.highlight, 1.1) - } - PropertyChanges { - target: parent.children[index].background - icon.color: root.palette.highlight - border.color: Qt.lighter(root.palette.highlight, 1.1) + icon.color: root.palette.buttonText + palette.buttonText: Qt.lighter(root.palette.buttonText, 1.1) } }, State { @@ -85,17 +76,11 @@ RowLayout { when: parent.children[index].activeFocus PropertyChanges { target: parent.children[index] - icon.color: root.palette.highlight - palette.buttonText: root.palette.highlight - } - PropertyChanges { - target: parent.children[index].background - icon.color: root.palette.highlight - border.color: root.palette.highlight + icon.color: root.palette.buttonText + palette.buttonText: root.palette.buttonText } } ] - transitions: [ Transition { PropertyAnimation { @@ -109,4 +94,4 @@ RowLayout { } -} +} \ No newline at end of file diff --git a/Components/VirtualKeyboard.qml b/Components/VirtualKeyboard.qml index 1247d7e..638860c 100644 --- a/Components/VirtualKeyboard.qml +++ b/Components/VirtualKeyboard.qml @@ -1,5 +1,5 @@ // Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme -// Copyright (C) 2022-2024 Keyitdev +// 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 @@ -8,6 +8,7 @@ import QtQuick.VirtualKeyboard 2.3 InputPanel { id: virtualKeyboard + property bool activated: false active: activated && Qt.inputMethod.visible visible: active diff --git a/Components/VirtualKeyboardButton.qml b/Components/VirtualKeyboardButton.qml new file mode 100644 index 0000000..2688831 --- /dev/null +++ b/Components/VirtualKeyboardButton.qml @@ -0,0 +1,71 @@ +// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme +// Copyright (C) 2022-2025 Keyitdev +// Distributed under the GPLv3+ License https://www.gnu.org/licenses/gpl-3.0.html + +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +Item { + Button { + id: virtualKeyboardButton + + anchors.horizontalCenter: parent.horizontalCenter + z: 1 + + visible: virtualKeyboard.status == Loader.Ready && config.HideVirtualKeyboard == "false" + checkable: true + onClicked: virtualKeyboard.switchState() + + Keys.onReturnPressed: { + toggle(); + virtualKeyboard.switchState(); + } + Keys.onEnterPressed: { + toggle(); + virtualKeyboard.switchState(); + } + + contentItem: Text { + id: virtualKeyboardButtonText + + text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)" + font.pointSize: root.font.pointSize * 0.8 + font.family: root.font.family + color: parent.visualFocus ? config.HoverVirtualKeyboardButtonTextColor : config.VirtualKeyboardButtonTextColor + } + + background: Rectangle { + id: virtualKeyboardButtonBackground + + color: "transparent" + } + states: [ + State { + name: "HoveredAndChecked" + when: virtualKeyboardButton.checked && virtualKeyboardButton.hovered + PropertyChanges { + target: virtualKeyboardButtonText + text: config.TranslateVirtualKeyboardButtonOn || "Virtual Keyboard (on)" + color: config.HoverVirtualKeyboardButtonTextColor + } + }, + State { + name: "checked" + when: virtualKeyboardButton.checked + PropertyChanges { + target: virtualKeyboardButtonText + text: config.TranslateVirtualKeyboardButtonOn || "Virtual Keyboard (on)" + } + }, + State { + name: "hovered" + when: virtualKeyboardButton.hovered + PropertyChanges { + target: virtualKeyboardButtonText + text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)" + color: config.HoverVirtualKeyboardButtonTextColor + } + } + ] + } +} \ No newline at end of file diff --git a/Fonts/ARCADECLASSIC.TTF b/Fonts/ARCADECLASSIC.TTF new file mode 100644 index 0000000..394a9f7 Binary files /dev/null and b/Fonts/ARCADECLASSIC.TTF differ diff --git a/Fonts/ESPACION.ttf b/Fonts/ESPACION.ttf new file mode 100644 index 0000000..f6b41e5 Binary files /dev/null and b/Fonts/ESPACION.ttf differ diff --git a/Fonts/Electroharmonix.otf b/Fonts/Electroharmonix.otf new file mode 100644 index 0000000..5574edf Binary files /dev/null and b/Fonts/Electroharmonix.otf differ diff --git a/Fonts/Fragile Bombers Attack.otf b/Fonts/Fragile Bombers Attack.otf new file mode 100644 index 0000000..857c823 Binary files /dev/null and b/Fonts/Fragile Bombers Attack.otf differ diff --git a/Fonts/Fragile Bombers Down.otf b/Fonts/Fragile Bombers Down.otf new file mode 100644 index 0000000..3e402b3 Binary files /dev/null and b/Fonts/Fragile Bombers Down.otf differ diff --git a/Fonts/Fragile Bombers.otf b/Fonts/Fragile Bombers.otf new file mode 100644 index 0000000..bdd8cbf Binary files /dev/null and b/Fonts/Fragile Bombers.otf differ diff --git a/Fonts/KogniGear.ttf b/Fonts/KogniGear.ttf new file mode 100644 index 0000000..6196b52 Binary files /dev/null and b/Fonts/KogniGear.ttf differ diff --git a/Fonts/OpenSans/OpenSans-Bold.ttf b/Fonts/OpenSans/OpenSans-Bold.ttf new file mode 100644 index 0000000..4d8f3e5 Binary files /dev/null and b/Fonts/OpenSans/OpenSans-Bold.ttf differ diff --git a/Fonts/OpenSans/OpenSans-BoldItalic.ttf b/Fonts/OpenSans/OpenSans-BoldItalic.ttf new file mode 100644 index 0000000..eba75d7 Binary files /dev/null and b/Fonts/OpenSans/OpenSans-BoldItalic.ttf differ diff --git a/Fonts/OpenSans/OpenSans-ExtraBold.ttf b/Fonts/OpenSans/OpenSans-ExtraBold.ttf new file mode 100644 index 0000000..db66f6a Binary files /dev/null and b/Fonts/OpenSans/OpenSans-ExtraBold.ttf differ diff --git a/Fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf b/Fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf new file mode 100644 index 0000000..b7611bb Binary files /dev/null and b/Fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf differ diff --git a/Fonts/OpenSans/OpenSans-Italic.ttf b/Fonts/OpenSans/OpenSans-Italic.ttf new file mode 100644 index 0000000..b088474 Binary files /dev/null and b/Fonts/OpenSans/OpenSans-Italic.ttf differ diff --git a/Fonts/OpenSans/OpenSans-Light.ttf b/Fonts/OpenSans/OpenSans-Light.ttf new file mode 100644 index 0000000..d01b20c Binary files /dev/null and b/Fonts/OpenSans/OpenSans-Light.ttf differ diff --git a/Fonts/OpenSans/OpenSans-LightItalic.ttf b/Fonts/OpenSans/OpenSans-LightItalic.ttf new file mode 100644 index 0000000..0441a59 Binary files /dev/null and b/Fonts/OpenSans/OpenSans-LightItalic.ttf differ diff --git a/Fonts/OpenSans/OpenSans-Medium.ttf b/Fonts/OpenSans/OpenSans-Medium.ttf new file mode 100644 index 0000000..6b41918 Binary files /dev/null and b/Fonts/OpenSans/OpenSans-Medium.ttf differ diff --git a/Fonts/OpenSans/OpenSans-MediumItalic.ttf b/Fonts/OpenSans/OpenSans-MediumItalic.ttf new file mode 100644 index 0000000..c84fe4f Binary files /dev/null and b/Fonts/OpenSans/OpenSans-MediumItalic.ttf differ diff --git a/Fonts/OpenSans/OpenSans-Regular.ttf b/Fonts/OpenSans/OpenSans-Regular.ttf new file mode 100644 index 0000000..3a29f26 Binary files /dev/null and b/Fonts/OpenSans/OpenSans-Regular.ttf differ diff --git a/Fonts/OpenSans/OpenSans-SemiBold.ttf b/Fonts/OpenSans/OpenSans-SemiBold.ttf new file mode 100644 index 0000000..219f6e8 Binary files /dev/null and b/Fonts/OpenSans/OpenSans-SemiBold.ttf differ diff --git a/Fonts/OpenSans/OpenSans-SemiBoldItalic.ttf b/Fonts/OpenSans/OpenSans-SemiBoldItalic.ttf new file mode 100644 index 0000000..259ac50 Binary files /dev/null and b/Fonts/OpenSans/OpenSans-SemiBoldItalic.ttf differ diff --git a/Fonts/Orbitron Black.ttf b/Fonts/Orbitron Black.ttf new file mode 100644 index 0000000..aa17eda Binary files /dev/null and b/Fonts/Orbitron Black.ttf differ diff --git a/Fonts/Thunderman.ttf b/Fonts/Thunderman.ttf new file mode 100644 index 0000000..e1cbc39 Binary files /dev/null and b/Fonts/Thunderman.ttf differ diff --git a/Fonts/pixelon.regular.ttf b/Fonts/pixelon.regular.ttf new file mode 100644 index 0000000..acb3c81 Binary files /dev/null and b/Fonts/pixelon.regular.ttf differ diff --git a/Main.qml b/Main.qml index 4b34315..af53482 100644 --- a/Main.qml +++ b/Main.qml @@ -1,12 +1,14 @@ // Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme -// Copyright (C) 2022-2024 Keyitdev +// 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 -import Qt5Compat.GraphicalEffects +import QtQuick.Effects +import QtMultimedia + import "Components" Pane { @@ -14,117 +16,101 @@ Pane { height: config.ScreenHeight || Screen.height width: config.ScreenWidth || Screen.ScreenWidth + padding: config.ScreenPadding - LayoutMirroring.enabled: config.ForceRightToLeft == "true" ? true : Qt.application.layoutDirection === Qt.RightToLeft + LayoutMirroring.enabled: config.RightToLeftLayout == "true" ? true : Qt.application.layoutDirection === Qt.RightToLeft LayoutMirroring.childrenInherit: true - padding: config.ScreenPadding - palette.button: "transparent" - palette.highlight: config.AccentColor - palette.highlightedText: config.OverrideTextFieldColor !== "" ? config.OverrideTextFieldColor : root.palette.highlight - palette.text: config.MainColor - palette.buttonText: config.MainColor palette.window: config.BackgroundColor + palette.highlight: config.HighlightBackgroundColor + palette.highlightedText: config.HighlightTextColor + palette.buttonText: config.HoverSystemButtonsIconsColor font.family: config.Font - font.pointSize: config.FontSize !== "" ? config.FontSize : parseInt(height / 80) + font.pointSize: config.FontSize !== "" ? config.FontSize : parseInt(height / 80) || 13 + focus: true property bool leftleft: config.HaveFormBackground == "true" && config.PartialBlur == "false" && config.FormPosition == "left" && - config.BackgroundImageHAlignment == "left" + config.BackgroundHorizontalAlignment == "left" property bool leftcenter: config.HaveFormBackground == "true" && config.PartialBlur == "false" && config.FormPosition == "left" && - config.BackgroundImageHAlignment == "center" + config.BackgroundHorizontalAlignment == "center" property bool rightright: config.HaveFormBackground == "true" && config.PartialBlur == "false" && config.FormPosition == "right" && - config.BackgroundImageHAlignment == "right" + config.BackgroundHorizontalAlignment == "right" property bool rightcenter: config.HaveFormBackground == "true" && config.PartialBlur == "false" && config.FormPosition == "right" && - config.BackgroundImageHAlignment == "center" + config.BackgroundHorizontalAlignment == "center" Item { id: sizeHelper - anchors.fill: parent height: parent.height width: parent.width - + anchors.fill: parent + Rectangle { id: tintLayer - anchors.fill: parent - width: parent.width + height: parent.height - color: "black" - opacity: config.DimBackgroundImage + width: parent.width + anchors.fill: parent z: 1 + color: config.DimBackgroundColor + opacity: config.DimBackground } Rectangle { id: formBackground + anchors.fill: form anchors.centerIn: form - color: root.palette.window + z: 1 + + color: config.FormBackgroundColor visible: config.HaveFormBackground == "true" ? true : false opacity: config.PartialBlur == "true" ? 0.3 : 1 - z: 1 } LoginForm { id: form - height: virtualKeyboard.state == "visible" ? parent.height - virtualKeyboard.implicitHeight : parent.height + height: parent.height width: parent.width / 2.5 - anchors.horizontalCenter: config.FormPosition == "center" ? parent.horizontalCenter : undefined anchors.left: config.FormPosition == "left" ? parent.left : undefined + anchors.horizontalCenter: config.FormPosition == "center" ? parent.horizontalCenter : undefined anchors.right: config.FormPosition == "right" ? parent.right : undefined - virtualKeyboardActive: virtualKeyboard.state == "visible" ? true : false z: 1 } - Button { - id: vkb - onClicked: virtualKeyboard.switchState() - visible: virtualKeyboard.status == Loader.Ready && config.ForceHideVirtualKeyboardButton == "false" - anchors.bottom: parent.bottom - anchors.bottomMargin: implicitHeight - anchors.horizontalCenter: form.horizontalCenter - z: 1 - contentItem: Text { - text: config.TranslateVirtualKeyboardButton || "Virtual Keyboard" - color: parent.visualFocus ? palette.highlight : palette.text - font.pointSize: root.font.pointSize * 0.8 - } - background: Rectangle { - id: vkbbg - color: "transparent" - } - } - Loader { id: virtualKeyboard source: "Components/VirtualKeyboard.qml" + + // x * 0.4 = x / 2.5 + width: config.KeyboardSize == "" ? parent.width * 0.4 : parent.width * config.KeyboardSize + anchors.bottom: parent.bottom + anchors.left: config.VirtualKeyboardPosition == "left" ? parent.left : undefined; + anchors.horizontalCenter: config.VirtualKeyboardPosition == "center" ? parent.horizontalCenter : undefined; + anchors.right: config.VirtualKeyboardPosition == "right" ? parent.right : undefined; + z: 1 + state: "hidden" property bool keyboardActive: item ? item.active : false - onKeyboardActiveChanged: keyboardActive ? state = "visible" : state = "hidden" - width: parent.width - z: 1 - function switchState() { state = state == "hidden" ? "visible" : "hidden" } + + function switchState() { state = state == "hidden" ? "visible" : "hidden"} states: [ State { name: "visible" - PropertyChanges { - target: form - systemButtonVisibility: false - clockVisibility: false - } PropertyChanges { target: virtualKeyboard y: root.height - virtualKeyboard.height @@ -185,6 +171,7 @@ Pane { } ScriptAction { script: { + virtualKeyboard.item.activated = false; Qt.inputMethod.hide(); } } @@ -192,36 +179,73 @@ Pane { } ] } - + Image { + id: backgroundPlaceholderImage + + z: 10 + source: config.BackgroundPlaceholder + visible: false + } + + AnimatedImage { id: backgroundImage + + MediaPlayer { + id: player + + videoOutput: videoOutput + autoPlay: true + playbackRate: config.BackgroundSpeed == "" ? 1.0 : config.BackgroundSpeed + loops: -1 + onPlayingChanged: { + console.log("Video started.") + backgroundPlaceholderImage.visible = false; + } + } + + VideoOutput { + id: videoOutput + + fillMode: config.CropBackground == "true" ? VideoOutput.PreserveAspectCrop : VideoOutput.PreserveAspectFit + anchors.fill: parent + } height: parent.height width: config.HaveFormBackground == "true" && config.FormPosition != "center" && config.PartialBlur != "true" ? parent.width - formBackground.width : parent.width - anchors.left: leftleft || - leftcenter ? - formBackground.right : undefined + anchors.left: leftleft || leftcenter ? formBackground.right : undefined + anchors.right: rightright || rightcenter ? formBackground.left : undefined - anchors.right: rightright || - rightcenter ? - formBackground.left : undefined - - horizontalAlignment: config.BackgroundImageHAlignment == "left" ? + horizontalAlignment: config.BackgroundHorizontalAlignment == "left" ? Image.AlignLeft : - config.BackgroundImageHAlignment == "right" ? + config.BackgroundHorizontalAlignment == "right" ? Image.AlignRight : Image.AlignHCenter - verticalAlignment: config.BackgroundImageVAlignment == "top" ? + verticalAlignment: config.BackgroundVerticalAlignment == "top" ? Image.AlignTop : - config.BackgroundImageVAlignment == "bottom" ? + config.BackgroundVerticalAlignment == "bottom" ? Image.AlignBottom : Image.AlignVCenter - source: config.background || config.Background - fillMode: config.ScaleImageCropped == "true" ? Image.PreserveAspectCrop : Image.PreserveAspectFit + speed: config.BackgroundSpeed == "" ? 1.0 : config.BackgroundSpeed + paused: config.PauseBackground == "true" ? 1 : 0 + fillMode: config.CropBackground == "true" ? Image.PreserveAspectCrop : Image.PreserveAspectFit asynchronous: true cache: true clip: true mipmap: true + + Component.onCompleted:{ + var fileType = config.Background.substring(config.Background.lastIndexOf(".") + 1) + const videoFileTypes = ["avi", "mp4", "mov", "mkv", "m4v", "webm"]; + if (videoFileTypes.includes(fileType)) { + backgroundPlaceholderImage.visible = true; + player.source = Qt.resolvedUrl(config.Background) + player.play(); + } + else{ + backgroundImage.source = config.background || config.Background + } + } } MouseArea { @@ -232,24 +256,32 @@ Pane { ShaderEffectSource { id: blurMask - sourceItem: backgroundImage - width: form.width height: parent.height + width: form.width anchors.centerIn: form + + sourceItem: backgroundImage sourceRect: Qt.rect(x,y,width,height) visible: config.FullBlur == "true" || config.PartialBlur == "true" ? true : false } - GaussianBlur { + MultiEffect { id: blur - + height: parent.height - width: config.FullBlur == "true" ? parent.width : form.width + + // width: config.FullBlur == "true" ? parent.width : form.width + // 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 + anchors.centerIn: config.FullBlur == "true" ? backgroundImage : form + source: config.FullBlur == "true" ? backgroundImage : blurMask - radius: config.BlurRadius - samples: config.BlurRadius * 2 + 1 - cached: true - anchors.centerIn: config.FullBlur == "true" ? parent : form + 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 } } diff --git a/Previews/1.png b/Previews/1.png index cb2b6a9..91e01cd 100644 Binary files a/Previews/1.png and b/Previews/1.png differ diff --git a/metadata.desktop b/metadata.desktop old mode 100755 new mode 100644 index ee5c013..20e917b --- a/metadata.desktop +++ b/metadata.desktop @@ -2,14 +2,14 @@ Name=sddm-astronaut-theme Description=sddm-astronaut-theme Author=keyitdev +Website=https://github.com/Keyitdev/sddm-astronaut-theme License=GPL-3.0-or-later Type=sddm-theme -Version=1.0 -Website=https://github.com/Keyitdev/sddm-astronaut-theme -Screenshot=Previews/preview.png -MainScript=Main.qml +Version=1.3 ConfigFile=theme.conf +Screenshot=Previews/astronaut.png +MainScript=Main.qml TranslationsDirectory=translations Theme-Id=sddm-astronaut-theme Theme-API=2.0 -QtVersion=6 +QtVersion=6 \ No newline at end of file