From 6bdc6557198e1e466d0185d8c465c09eaf5de3a7 Mon Sep 17 00:00:00 2001 From: demmm Date: Thu, 15 Jul 2021 19:30:43 +0200 Subject: [PATCH] [usersq] complete using names for colors add line breaks add negative outline color --- src/modules/usersq/usersq.qml | 87 +++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 29 deletions(-) diff --git a/src/modules/usersq/usersq.qml b/src/modules/usersq/usersq.qml index 76c9f8c91..6b0694036 100644 --- a/src/modules/usersq/usersq.qml +++ b/src/modules/usersq/usersq.qml @@ -21,14 +21,17 @@ import QtQuick.Window 2.3 Kirigami.ScrollablePage { // You can hard-code a color here, or bind to a Kirigami theme color, // or use a color from Calamares branding, or .. - readonly property color unfilledFieldColor : "#FBFBFB"; // Kirigami.Theme.backgroundColor; + readonly property color unfilledFieldColor: "#FBFBFB" //Kirigami.Theme.backgroundColor + readonly property color positiveFieldColor: "#F0FFF0" //Kirigami.Theme.positiveBackgroundColor + readonly property color negativeFieldColor: "#EBCED1" //Kirigami.Theme.negativeBackgroundColor + readonly property color unfilledFieldOutlineColor: "#F1F1F1" + readonly property color positiveFieldOutlineColor: "#DCFFDC" + readonly property color negativeFieldOutlineColor: "#BE5F68" + readonly property color commentsColor: "#6D6D6D" width: parent.width height: parent.height - Kirigami.Theme.backgroundColor: "#EFF0F1" - Kirigami.Theme.textColor: "#1F1F1F" - header: Kirigami.Heading { Layout.fillWidth: true height: 50 @@ -60,8 +63,10 @@ Kirigami.ScrollablePage { text: config.fullName onTextChanged: config.setFullName(text) - palette.base: _userNameField.text.length ? "#f0fff0" : unfilledFieldColor - palette.highlight : _userNameField.text.length ? "#dcffdc" : unfilledFieldColor + palette.base: _userNameField.text.length + ? positiveFieldColor : unfilledFieldColor + palette.highlight : _userNameField.text.length + ? positiveFieldOutlineColor : unfilledFieldOutlineColor } } @@ -92,8 +97,17 @@ Kirigami.ScrollablePage { palette.base: _userLoginField.text.length ? ( acceptableInput ? ( _userLoginField.text === "root" - ? "#ffdae0" : "#f0fff0" ) : "#ffdae0" ) : unfilledFieldColor - palette.highlight : _userLoginField.text.length ? "#dcffdc" : unfilledFieldColor + ? negativeFieldColor + : positiveFieldColor ) + : negativeFieldColor ) + : unfilledFieldColor + palette.highlight : _userLoginField.text.length + ? ( acceptableInput + ? ( _userLoginField.text === "root" + ? negativeFieldOutlineColor + : positiveFieldOutlineColor ) + : negativeFieldOutlineColor ) + : unfilledFieldOutlineColor } Label { @@ -101,7 +115,7 @@ Kirigami.ScrollablePage { text: qsTr("If more than one person will use this computer, you can create multiple accounts after installation.") font.weight: Font.Thin font.pointSize: 8 - color: "#6D6D6D" + color: commentsColor } } @@ -146,10 +160,16 @@ Kirigami.ScrollablePage { palette.base: _hostName.text.length ? ( acceptableInput - ? ( _hostName.text === "localhost" ? "#ffdae0" : "#f0fff0" ) - : "#ffdae0") + ? ( _hostName.text === "localhost" + ? negativeFieldColor : positiveFieldColor ) + : negativeFieldColor) : unfilledFieldColor - palette.highlight : _hostName.text.length ? "#dcffdc" : unfilledFieldColor + palette.highlight : _hostName.text.length + ? ( acceptableInput + ? ( _hostName.text === "localhost" + ? negativeFieldOutlineColor : positiveFieldOutlineColor ) + : negativeFieldOutlineColor) + : unfilledFieldOutlineColor } Label { @@ -157,7 +177,7 @@ Kirigami.ScrollablePage { text: qsTr("This name will be used if you make the computer visible to others on a network.") font.weight: Font.Thin font.pointSize: 8 - color: "#6D6D6D" + color: commentsColor } } @@ -197,8 +217,10 @@ Kirigami.ScrollablePage { text: config.userPassword onTextChanged: config.setUserPassword(text) - palette.base: _passwordField.text.length ? "#f0fff0" : unfilledFieldColor - palette.highlight : _passwordField.text.length ? "#dcffdc" : unfilledFieldColor + palette.base: _passwordField.text.length + ? positiveFieldColor : unfilledFieldColor + palette.highlight : _passwordField.text.length + ? positiveFieldOutlineColor : unfilledFieldOutlineColor echoMode: TextInput.Password passwordMaskDelay: 300 @@ -220,9 +242,12 @@ Kirigami.ScrollablePage { palette.base: _verificationPasswordField.text.length ? ( _passwordField.text === _verificationPasswordField.text - ? "#f0fff0" : "#ffdae0" ) + ? positiveFieldColor : negativeFieldColor ) : unfilledFieldColor - palette.highlight : _verificationPasswordField.text.length ? "#dcffdc" : unfilledFieldColor + palette.highlight : _verificationPasswordField.text.length + ? ( _passwordField.text === _verificationPasswordField.text + ? positiveFieldOutlineColor : negativeFieldOutlineColor ) + : unfilledFieldOutlineColor echoMode: TextInput.Password passwordMaskDelay: 300 @@ -236,7 +261,7 @@ Kirigami.ScrollablePage { font.weight: Font.Thin font.pointSize: 8 wrapMode: Text.WordWrap - color: "#6D6D6D" + color: commentsColor } } @@ -275,7 +300,7 @@ Kirigami.ScrollablePage { text: qsTr("Use the same password for the administrator account.") font.weight: Font.Thin font.pointSize: 8 - color: "#6D6D6D" + color: commentsColor } Column { @@ -300,8 +325,10 @@ Kirigami.ScrollablePage { onTextChanged: config.setRootPassword(text) - palette.base: _rootPasswordField.text.length ? "#f0fff0" : unfilledFieldColor - palette.highlight : _rootPasswordField.text.length ? "#dcffdc" : unfilledFieldColor + palette.base: _rootPasswordField.text.length + ? positiveFieldColor : unfilledFieldColor + palette.highlight : _rootPasswordField.text.length + ? positiveFieldOutlineColor : unfilledFieldOutlineColor echoMode: TextInput.Password passwordMaskDelay: 300 @@ -316,15 +343,17 @@ Kirigami.ScrollablePage { onTextChanged: _rootPasswordField.text === _verificationRootPasswordField.text ? ( config.setRootPasswordSecondary(text), - rootPassMessage.visible = false, - rootValidityMessage.visible = true ) - : ( rootPassMessage.visible = true, - rootValidityMessage.visible = false ) + rootPassMessage.visible = false,rootValidityMessage.visible = true ) + : ( rootPassMessage.visible = true,rootValidityMessage.visible = false ) palette.base: _verificationRootPasswordField.text.length ? ( _rootPasswordField.text === _verificationRootPasswordField.text - ? "#f0fff0" : "#ffdae0") : unfilledFieldColor - palette.highlight : _verificationRootPasswordField.text.length ? "#dcffdc" : unfilledFieldColor + ? positiveFieldColor : negativeFieldColor) + : unfilledFieldColor + palette.highlight : _verificationRootPasswordField.text.length + ? ( _rootPasswordField.text === _verificationRootPasswordField.text + ? positiveFieldOutlineColor : negativeFieldOutlineColor) + : unfilledFieldOutlineColor echoMode: TextInput.Password passwordMaskDelay: 300 @@ -338,7 +367,7 @@ Kirigami.ScrollablePage { text: qsTr("Enter the same password twice, so that it can be checked for typing errors.") font.weight: Font.Thin font.pointSize: 8 - color: "#6D6D6D" + color: commentsColor } } @@ -386,7 +415,7 @@ Kirigami.ScrollablePage { text: qsTr("When this box is checked, password-strength checking is done and you will not be able to use a weak password.") font.weight: Font.Thin font.pointSize: 8 - color: "#6D6D6D" + color: commentsColor } } }