diff --git a/Components/Clock.qml b/Components/Clock.qml index 2949f22..f1b9fab 100644 --- a/Components/Clock.qml +++ b/Components/Clock.qml @@ -14,7 +14,7 @@ Column { Label { anchors.horizontalCenter: parent.horizontalCenter font.pointSize: config.HeaderText !=="" ? root.font.pointSize * 3 : 0 - color: root.palette.text + color: config.HeaderTextColor renderType: Text.QtRendering text: config.HeaderText } @@ -24,7 +24,7 @@ Column { anchors.horizontalCenter: parent.horizontalCenter font.pointSize: root.font.pointSize * 9 font.bold: true - color: root.palette.text + color: config.DateTextColor renderType: Text.QtRendering function updateTime() { text = new Date().toLocaleTimeString(Qt.locale(config.Locale), config.HourFormat == "long" ? Locale.LongFormat : config.HourFormat !== "" ? config.HourFormat : Locale.ShortFormat) @@ -34,7 +34,7 @@ Column { Label { id: dateLabel anchors.horizontalCenter: parent.horizontalCenter - color: root.palette.text + color: config.TimeTextColor font.pointSize: root.font.pointSize * 2 font.bold: true renderType: Text.QtRendering diff --git a/Components/Input.qml b/Components/Input.qml index fdbf865..3c17dc0 100644 --- a/Components/Input.qml +++ b/Components/Input.qml @@ -26,7 +26,7 @@ Column { horizontalAlignment: Text.AlignHCenter font.pointSize: root.font.pointSize * 0.8 font.italic: true - color: root.palette.text + color: config.WarningColor opacity: 0 states: [ State { @@ -98,13 +98,13 @@ Column { 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" + color: config.DropdownTextColor verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } highlighted: parent.highlightedIndex === index background: Rectangle { - color: selectUser.highlightedIndex === index ? root.palette.highlight : "transparent" + color: selectUser.highlightedIndex === index ? config.DropdownSelectedBackgroundColor : "transparent" } } @@ -118,7 +118,7 @@ Column { icon.height: parent.height * 0.25 icon.width: parent.height * 0.25 enabled: false - icon.color: root.palette.text + icon.color: config.UserIconColor icon.source: Qt.resolvedUrl("../Assets/User.svg") background: Rectangle { @@ -150,7 +150,7 @@ Column { background: Rectangle { radius: config.RoundCorners / 2 - color: root.palette.alternateBase + color: config.DropdownBackgroundColor layer.enabled: true } @@ -165,7 +165,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 { @@ -173,7 +173,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 { @@ -181,7 +181,7 @@ Column { when: selectUser.activeFocus PropertyChanges { target: usernameIcon - icon.color: root.palette.highlight + icon.color: config.HoverUserIconColor } } ] @@ -200,13 +200,14 @@ Column { TextField { id: username text: config.ForceLastUser == "true" ? selectUser.currentText : null + color: config.LoginFieldTextColor font.bold: true font.capitalization: config.AllowUppercaseLettersInUsernames == "false" ? Font.AllLowercase : Font.MixedCase anchors.centerIn: parent height: root.font.pointSize * 3 width: parent.width placeholderText: config.TranslatePlaceholderUsername || textConstants.userName - placeholderTextColor: root.palette.shadow + placeholderTextColor: config.PlacholderTextColor selectByMouse: true horizontalAlignment: TextInput.AlignHCenter renderType: Text.QtRendering @@ -215,7 +216,7 @@ Column { selectAll() } background: Rectangle { - color: "#222222" + color: config.LoginFieldBackgroundColor opacity: 0.2 border.color: "transparent" border.width: parent.activeFocus ? 2 : 1 @@ -231,11 +232,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) } } ] @@ -259,7 +260,7 @@ Column { anchors.leftMargin: selectUser.height * 0 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 { @@ -274,7 +275,7 @@ Column { PropertyChanges { target: showPassword icon.source: Qt.resolvedUrl("../Assets/Password.svg") - icon.color: root.palette.highlight + icon.color: config.HoverPasswordIconColor } }, State { @@ -283,7 +284,7 @@ Column { PropertyChanges { target: showPassword icon.source: Qt.resolvedUrl("../Assets/Password.svg") - icon.color: root.palette.highlight + icon.color: config.HoverPasswordIconColor } }, State { @@ -300,7 +301,7 @@ Column { PropertyChanges { target: showPassword icon.source: Qt.resolvedUrl("../Assets/Password2.svg") - icon.color: root.palette.highlight + icon.color: config.HoverPasswordIconColor } }, State { @@ -309,7 +310,7 @@ Column { PropertyChanges { target: showPassword icon.source: Qt.resolvedUrl("../Assets/Password2.svg") - icon.color: root.palette.highlight + icon.color: config.HoverPasswordIconColor } } ] @@ -324,6 +325,7 @@ Column { TextField { id: password anchors.centerIn: parent + color: config.PasswordFieldTextColor height: root.font.pointSize * 3 width: parent.width font.bold: true @@ -331,13 +333,13 @@ Column { selectByMouse: true echoMode: showPassword.checked ? TextInput.Normal : TextInput.Password placeholderText: config.TranslatePlaceholderPassword || textConstants.password - placeholderTextColor: root.palette.shadow + placeholderTextColor: config.PlacholderTextColor horizontalAlignment: TextInput.AlignHCenter passwordCharacter: "•" passwordMaskDelay: config.HideCompletePassword == "true" ? undefined : 1000 renderType: Text.QtRendering background: Rectangle { - color: "#222222" + color: config.PasswordFieldBackgroundColor opacity: 0.2 border.color: "transparent" border.width: parent.activeFocus ? 2 : 1 @@ -353,11 +355,11 @@ Column { when: password.activeFocus PropertyChanges { target: password.background - border.color: root.palette.highlight + border.color: config.HighlightBorderColor } PropertyChanges { target: password - color: root.palette.highlightedText + color: Qt.lighter(config.LoginFieldTextColor, 1.15) } } ] @@ -393,7 +395,7 @@ Column { contentItem: Text { text: parent.text - color: root.palette.mid + color: config.LoginButtonTextColor font.pointSize: root.font.pointSize font.family: root.font.family horizontalAlignment: Text.AlignHCenter @@ -403,7 +405,7 @@ Column { background: Rectangle { id: buttonBackground - color: "white" + color: config.LoginButtonBackgroundColor opacity: 0.2 radius: config.RoundCorners || 0 } @@ -414,7 +416,7 @@ Column { when: loginButton.down PropertyChanges { target: buttonBackground - color: Qt.darker(root.palette.link, 1.1) + color: Qt.darker(config.LoginButtonBackgroundColor, 1.1) opacity: 1 } PropertyChanges { @@ -426,7 +428,7 @@ Column { when: loginButton.hovered PropertyChanges { target: buttonBackground - color: Qt.lighter(root.palette.link, 1.15) + color: Qt.lighter(config.LoginButtonBackgroundColor, 1.15) opacity: 1 } PropertyChanges { @@ -439,7 +441,7 @@ Column { when: loginButton.activeFocus PropertyChanges { target: buttonBackground - color: Qt.lighter(root.palette.link, 1.2) + color: Qt.lighter(config.LoginButtonBackgroundColor, 1.2) opacity: 1 } PropertyChanges { @@ -452,7 +454,7 @@ Column { when: loginButton.enabled PropertyChanges { target: buttonBackground; - color: root.palette.link; + color: config.LoginButtonBackgroundColor; opacity: 1 } PropertyChanges { diff --git a/Components/SessionButton.qml b/Components/SessionButton.qml index 856f3d8..50dbffe 100644 --- a/Components/SessionButton.qml +++ b/Components/SessionButton.qml @@ -51,13 +51,13 @@ Item { 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" + color: config.DropdownTextColor verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } highlighted: parent.highlightedIndex === index background: Rectangle { - color: selectSession.highlightedIndex === index ? root.palette.highlight : "transparent" + color: selectSession.highlightedIndex === index ? config.DropdownSelectedBackgroundColor : "transparent" } } @@ -68,7 +68,7 @@ Item { contentItem: Text { id: displayedItem text: (config.TranslateSessionSelection || "Session") + " (" + selectSession.currentText + ")" - color: root.palette.text + color: config.SessionButtonTextColor verticalAlignment: Text.AlignVCenter font.pointSize: root.font.pointSize * 0.8 font.family: root.font.family @@ -105,7 +105,7 @@ Item { background: Rectangle { radius: config.RoundCorners / 2 - color: root.palette.alternateBase + color: config.DropdownBackgroundColor layer.enabled: true } @@ -120,11 +120,11 @@ Item { when: selectSession.down PropertyChanges { target: displayedItem - color: Qt.darker(root.palette.toolTipBase, 1.1) + color: Qt.darker(config.HoverSessionButtonTextColor, 1.1) } PropertyChanges { target: selectSession.background - border.color: Qt.darker(root.palette.toolTipBase, 1.1) + border.color: Qt.darker(config.HoverSessionButtonTextColor, 1.1) } }, State { @@ -132,11 +132,11 @@ Item { when: selectSession.hovered PropertyChanges { target: displayedItem - color: Qt.lighter(root.palette.toolTipBase, 1.1) + color: Qt.lighter(config.HoverSessionButtonTextColor, 1.1) } PropertyChanges { target: selectSession.background - border.color: Qt.lighter(root.palette.toolTipBase, 1.1) + border.color: Qt.lighter(config.HoverSessionButtonTextColor, 1.1) } }, State { @@ -144,11 +144,11 @@ Item { when: selectSession.visualFocus PropertyChanges { target: displayedItem - color: root.palette.toolTipBase + color: config.HoverSessionButtonTextColor } PropertyChanges { target: selectSession.background - border.color: root.palette.toolTipBase + border.color: config.HoverSessionButtonTextColor } } ] diff --git a/Components/SystemButtons.qml b/Components/SystemButtons.qml index 5efcee3..5b4975a 100644 --- a/Components/SystemButtons.qml +++ b/Components/SystemButtons.qml @@ -30,11 +30,11 @@ RowLayout { 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.SystemButtonsIconColor + icon.color: config.SystemButtonsIconsColor display: AbstractButton.TextUnderIcon visible: config.HideSystemButtons != "true" && modelData[2] hoverEnabled: true - palette.buttonText: config.SystemButtonsIconColor + palette.buttonText: config.SystemButtonsIconsColor background: Rectangle { height: 2 color: "transparent" @@ -57,13 +57,13 @@ RowLayout { when: parent.children[index].down PropertyChanges { target: parent.children[index] - icon.color: root.palette.highlight - palette.buttonText: Qt.darker(root.palette.highlight, 1.1) + icon.color: root.palette.buttonText + palette.buttonText: Qt.darker(root.palette.buttonText, 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 + border.color: Qt.darker(root.palette.buttonText, 1.1) } }, State { @@ -71,13 +71,13 @@ 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) + icon.color: root.palette.buttonText + palette.buttonText: Qt.lighter(root.palette.buttonText, 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 + border.color: Qt.lighter(root.palette.buttonText, 1.1) } }, State { @@ -85,13 +85,13 @@ RowLayout { when: parent.children[index].activeFocus PropertyChanges { target: parent.children[index] - icon.color: root.palette.highlight - palette.buttonText: root.palette.highlight + icon.color: root.palette.buttonText + palette.buttonText: root.palette.buttonText } PropertyChanges { target: parent.children[index].background - icon.color: root.palette.highlight - border.color: root.palette.highlight + icon.color: root.palette.buttonText + border.color: root.palette.buttonText } } ] @@ -109,4 +109,4 @@ RowLayout { } -} +} \ No newline at end of file diff --git a/Main.qml b/Main.qml index 1d21053..12c4739 100644 --- a/Main.qml +++ b/Main.qml @@ -20,17 +20,10 @@ Pane { LayoutMirroring.enabled: config.RightToLeftLayout == "true" ? true : Qt.application.layoutDirection === Qt.RightToLeft LayoutMirroring.childrenInherit: true - palette.button: "transparent" - palette.highlight: config.HighlightColor palette.window: config.BackgroundColor - palette.text: config.TextColor - palette.shadow: config.PlaceholderColor - palette.buttonText: config.TextColor - palette.highlightedText: config.HighlightTextColor == "" ? config.HighlightColor : config.HighlightTextColor - palette.link: config.LoginButtonBackgroundColor == "" ? config.HighlightColor : config.LoginButtonBackgroundColor - palette.mid: config.LoginButtonTextColor == "" ? config.TextColor : config.LoginButtonTextColor - palette.alternateBase: config.BackgroundListColor == "" ? config.BackgroundColor: config.BackgroundListColor - palette.toolTipBase: config.HoverSessionAndVirtualKeyboard == "" ? config.HighlightColor : config.HoverSessionAndVirtualKeyboard + 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) @@ -62,13 +55,12 @@ Pane { anchors.fill: parent height: parent.height width: parent.width - + Rectangle { id: tintLayer anchors.fill: parent width: parent.width height: parent.height - color: "black" opacity: config.DimBackground z: 1 } @@ -77,7 +69,7 @@ Pane { id: formBackground anchors.fill: form anchors.centerIn: form - color: root.palette.window + color: config.FormBackgroundColor visible: config.HaveFormBackground == "true" ? true : false opacity: config.PartialBlur == "true" ? 0.3 : 1 z: 1 @@ -85,7 +77,6 @@ Pane { LoginForm { id: form - height: parent.height width: parent.width / 2.5 anchors.horizontalCenter: config.FormPosition == "center" ? parent.horizontalCenter : undefined @@ -121,7 +112,7 @@ Pane { contentItem: Text { id: buttonVirtualKeyboard text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)" - color: parent.visualFocus ? palette.highlight : palette.text + color: parent.visualFocus ? config.HoverVirtualKeyboardButtonTextColor : config.VirtualKeyboardButtonTextColor font.pointSize: root.font.pointSize * 0.8 } background: Rectangle { @@ -135,7 +126,7 @@ Pane { PropertyChanges { target: buttonVirtualKeyboard text: config.TranslateVirtualKeyboardButtonOn || "Virtual Keyboard (on)" - color: root.palette.toolTipBase + color: config.HoverVirtualKeyboardButtonTextColor } }, State { @@ -152,7 +143,7 @@ Pane { PropertyChanges { target: buttonVirtualKeyboard text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)" - color: root.palette.toolTipBase + color: config.HoverVirtualKeyboardButtonTextColor } } ] diff --git a/Themes/theme1.conf b/Themes/theme1.conf index 3e1054b..5b7a010 100644 --- a/Themes/theme1.conf +++ b/Themes/theme1.conf @@ -46,27 +46,42 @@ BackgroundVerticalAlignment="center" #################### Colors #################### -HighlightColor="#343746" -# Main color. -BackgroundColor="#21222C" -# Background color. -# Connected with: HaveFormBackground -TextColor="#ffffff" -PlaceholderColor="#bbbbbb" -# Placholder text color (username, password). -SystemButtonsIconColor="#F8F8F2" -# System icon colors. +HeaderTextColor="#ffffff" +DateTextColor="#ffffff" +TimeTextColor="#ffffff" -HighlightTextColor="#b7cef1" -# Overrides HighlightColor. -LoginButtonTextColor="" -# Overrides TextColor. -LoginButtonBackgroundColor="" -# Overrides HighlightColor. -BackgroundListColor="" -# Overrides BackgroundColor. -HoverSessionAndVirtualKeyboard="#b7cef1" -# Overrides HighlightColor. +FormBackgroundColor="#21222C" +BackgroundColor="#21222C" + +LoginFieldBackgroundColor="#222222" +PasswordFieldBackgroundColor="#222222" +LoginFieldTextColor="#ffffff" +PasswordFieldTextColor="#ffffff" +UserIconColor="#ffffff" +PasswordIconColor="#ffffff" + +PlacholderTextColor="#bbbbbb" +WarningColor="#343746" + +LoginButtonTextColor="#ffffff" +LoginButtonBackgroundColor="#343746" +SystemButtonsIconsColor="#F8F8F2" +SessionButtonTextColor="#F8F8F2" +VirtualKeyboardButtonTextColor="#F8F8F2" + +DropdownTextColor="#ffffff" +DropdownSelectedBackgroundColor="#343746" +DropdownBackgroundColor="#21222C" + +HighlightTextColor="#bbbbbb" +HighlightBackgroundColor="#343746" +HighlightBorderColor="#343746" + +HoverUserIconColor="#b7cef1" +HoverPasswordIconColor="#b7cef1" +HoverSystemButtonsIconsColor="#b7cef1" +HoverSessionButtonTextColor="#b7cef1" +HoverVirtualKeyboardButtonTextColor="#b7cef1" #################### Form #################### @@ -97,7 +112,7 @@ VirtualKeyboardPosition="center" HideVirtualKeyboard="false" HideSystemButtons="false" -HideLoginButton="true" +HideLoginButton="false" ForceLastUser="true" # If set to true last successfully logged in user appeares automatically in the username field. diff --git a/metadata.desktop b/metadata.desktop index d10e2ff..fbb1d18 100644 --- a/metadata.desktop +++ b/metadata.desktop @@ -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.1 +Version=1.2 ConfigFile=Themes/theme1.conf Screenshot=Previews/preview1.png MainScript=Main.qml