Major update: Improved scaling, added new scaling units, refactored font scaling, and changed how blur is calculated.

This commit is contained in:
Keyitdev
2026-07-14 15:20:13 +02:00
parent ad3390b420
commit 07b64f0781
10 changed files with 101 additions and 83 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
// 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
@@ -17,7 +17,7 @@ Column {
anchors.horizontalCenter: parent.horizontalCenter
font.pointSize: rootFontSize * 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: rootFontSize * 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: rootFontSize * 2
font.pixelSize: rootFontSize * 2.66
font.bold: true
renderType: Text.QtRendering
+19 -15
View File
@@ -1,5 +1,5 @@
// 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
@@ -72,7 +72,7 @@ Column {
text: failed ? config.TranslateLoginFailedWarning || textConstants.loginFailed + "!" : keyboard.capsLock ? config.TranslateCapslockWarning || textConstants.capslockWarning : ""
font.pointSize: rootFontSize
font.pixelSize: rootFontSize * 1.33
font.italic: true
color: config.WarningColor
opacity: 0
@@ -148,12 +148,17 @@ Column {
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: rootFontSize
font.pixelSize: rootFontSize * 1.06
font.capitalization: Font.MixedCase
font.family: root.font.family
color: config.DropdownTextColor
@@ -196,7 +201,7 @@ 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: rootHeightUnit * 0.75
@@ -210,7 +215,7 @@ Column {
}
background: Rectangle {
radius: config.RoundCorners / 2
radius: (rootScaleUnit * config.RoundCorners) / 2
color: config.DropdownBackgroundColor
layer.enabled: true
}
@@ -263,7 +268,7 @@ Column {
anchors.centerIn: parent
height: rootHeightUnit * 3
width: parent.width
font.pointSize: rootFontSize
font.pixelSize: rootFontSize * 1.33
horizontalAlignment: TextInput.AlignHCenter
leftPadding: selectUser.width
rightPadding: selectUser.width
@@ -287,8 +292,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()
@@ -327,11 +332,10 @@ Column {
Button {
id: passwordIcon
width: parent.height
height: parent.height
width: selectUser.height * 1
anchors.left: parent.left
anchors.leftMargin: selectUser.height * 0.2
anchors.verticalCenter: parent.verticalCenter
z: 2
icon.height: parent.height * 0.4
@@ -403,7 +407,7 @@ Column {
height: rootHeightUnit * 3
width: parent.width
font.pointSize: rootFontSize
font.pixelSize: rootFontSize * 1.33
anchors.centerIn: parent
horizontalAlignment: TextInput.AlignHCenter
leftPadding: passwordIcon.width
@@ -424,8 +428,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
@@ -487,7 +491,7 @@ Column {
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pointSize: rootFontSize
font.pixelSize: rootFontSize * 1.33
font.family: root.font.family
color: config.LoginButtonTextColor
text: parent.text
@@ -499,7 +503,7 @@ Column {
color: config.LoginButtonBackgroundColor
opacity: 0.2
radius: config.RoundCorners || 0
radius: rootScaleUnit * config.RoundCorners || 0
}
states: [
+3 -1
View File
@@ -1,10 +1,12 @@
// 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 SddmComponents 2.0 as SDDM
Item {
id: formContainer
SDDM.TextConstants { id: textConstants }
+7 -3
View File
@@ -1,3 +1,7 @@
// 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
@@ -33,7 +37,7 @@ Item {
id: circleMask
anchors.fill: avatarImage
radius: config.ProfilePictureRoundedCorners || 0
radius: rootScaleUnit * config.ProfilePictureRoundedCorners || 0
visible: false
layer.enabled: true
}
@@ -49,9 +53,9 @@ Item {
id: ringBorder
anchors.fill: parent
radius: config.ProfilePictureRoundedCorners || 0
radius: rootScaleUnit * config.ProfilePictureRoundedCorners || 0
color: "transparent"
border.width: config.ProfilePictureBorderWidth || 2
border.width: rootScaleUnit * config.ProfilePictureBorderWidth || 2
border.color: config.ProfilePictureBorderColor
}
}
+17 -10
View File
@@ -1,5 +1,5 @@
// 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
@@ -21,6 +21,7 @@ Item {
id: selectSession
height: rootHeightUnit
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
hoverEnabled: true
@@ -36,15 +37,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: rootFontSize
font.pixelSize: rootFontSize * 1.06
font.family: root.font.family
color: config.DropdownTextColor
}
@@ -62,18 +68,19 @@ Item {
id: displayedItem
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: (config.TranslateSessionSelection || "Session") + " (" + selectSession.currentText + ")"
color: config.SessionButtonTextColor
font.pointSize: rootFontSize * 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"
}
@@ -84,11 +91,11 @@ Item {
implicitHeight: contentItem.implicitHeight
width: sessionButton.width
y: parent.height + rootHeightUnit
x: -popupHandler.width/2 + displayedItem.width/2
padding: 10
x: 0
padding: rootScaleUnit * 10
contentItem: ListView {
implicitHeight: contentHeight + 20
implicitHeight: contentHeight + (rootScaleUnit * 20)
clip: true
model: selectSession.popup.visible ? selectSession.delegateModel : null
@@ -97,7 +104,7 @@ Item {
}
background: Rectangle {
radius: config.RoundCorners / 2
radius: (rootScaleUnit * config.RoundCorners) / 2
color: config.DropdownBackgroundColor
layer.enabled: true
}
+13 -23
View File
@@ -1,5 +1,5 @@
// 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
@@ -8,73 +8,66 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
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
text: modelData[1]
font.pointSize: rootFontSize * 0.8
font.pixelSize: rootFontSize * 1.06
icon.source: modelData ? 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
spacing: rootScaleUnit * 6
padding: rootScaleUnit * 8
visible: config.HideSystemButtons != "true" && (config.BypassSystemButtonsChecks == "true" ? 1 : 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()
}
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
}
@@ -88,9 +81,6 @@ RowLayout {
}
}
]
}
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
// 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
+3 -2
View File
@@ -1,5 +1,5 @@
// 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
@@ -14,6 +14,7 @@ Item {
Button {
id: virtualKeyboardButton
height: rootHeightUnit
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
z: 1
@@ -37,7 +38,7 @@ Item {
horizontalAlignment: Text.AlignHCenter
text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)"
font.pointSize: rootFontSize * 0.8
font.pixelSize: rootFontSize * 1.06
font.family: root.font.family
color: parent.visualFocus ? config.HoverVirtualKeyboardButtonTextColor : config.VirtualKeyboardButtonTextColor
}
+21 -11
View File
@@ -1,10 +1,9 @@
// 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.Effects
import QtMultimedia
@@ -14,8 +13,8 @@ import "Components"
Pane {
id: root
height: config.ScreenHeight || Screen.height
width: config.ScreenWidth || Screen.width
height: Screen.height
width: Screen.width
padding: config.ScreenPadding
LayoutMirroring.enabled: config.RightToLeftLayout == "true" ? true : Qt.application.layoutDirection === Qt.RightToLeft
@@ -27,11 +26,16 @@ Pane {
palette.buttonText: config.HoverSystemButtonsIconsColor
font.family: config.Font
// font.pointSize: config.FontSize !== "" ? config.FontSize : parseInt(height / 80) || 13
//
property real rootFontSize: config.FontSize !== "" ? config.FontSize : (height / 90) || 12
property real rootHeightUnit: config.HeightUnit !== "" ? config.HeightUnit : (height / 90) || 12
property real rootWidthUnit: config.WidthUnit !== "" ? config.WidthUnit : (width / 160) || 12
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
@@ -284,8 +288,14 @@ Pane {
source: config.FullBlur == "true" ? backgroundImage : blurMask
blurEnabled: true
autoPaddingEnabled: false
blur: config.Blur == "" ? 2.0 : config.Blur
blurMax: config.BlurMax == "" ? 48 : config.BlurMax
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" ? true : false
}
}
+1 -1
View File
@@ -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