diff --git a/README.md b/README.md index 90c44bd..5b0b74b 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,7 @@ Simple dark SDDM theme. ## Installing -1. Install QML modules: - * Qt Graphical Effects - * Qt Quick Controls +1. Install `Qt Graphical Effects` QML module 2. Install Roboto font (optional, you can change to other font, see below) 3. `git clone https://github.com/RadRussianRus/sddm-slice.git` 4. `cp -r sddm-slice/slice /usr/share/sddm/themes/slice` @@ -29,6 +27,8 @@ Create file `theme.conf.user` in theme folder. See `slice/theme.conf` for refere * `color_button_text` - button text color (in any state). Defaults to `#1f1f1f`. * `color_text` - main text and foreground elements color (such as progress bar and power icons). Defaults to `#dddddd`. * `color_placeholder_text` - placeholder text color (in password field). Defaults to `#888888`. +* `color_selection_bg` - selected text background color. Defaults to `#555555`. +* `color_selection_text` - selected text color. Defaults to `#dddddd`. ## License diff --git a/slice/LoopListPowerItem.qml b/slice/LoopListPowerItem.qml index 3cf62ed..93e3f0e 100644 --- a/slice/LoopListPowerItem.qml +++ b/slice/LoopListPowerItem.qml @@ -1,7 +1,6 @@ import QtQuick 2.7 import QtGraphicalEffects 1.0 import SddmComponents 2.0 -import QtQuick.Controls 2.0 Item { @@ -45,7 +44,7 @@ Item color: config.color_text } - Label + Text { id: descriptionLabel text: itemRoot.title diff --git a/slice/LoopListSessionItem.qml b/slice/LoopListSessionItem.qml index 22e01c0..0b7fbed 100644 --- a/slice/LoopListSessionItem.qml +++ b/slice/LoopListSessionItem.qml @@ -1,7 +1,6 @@ import QtQuick 2.7 import QtGraphicalEffects 1.0 import SddmComponents 2.0 -import QtQuick.Controls 2.0 Item { @@ -12,7 +11,7 @@ Item property real distance: 1.0 property string sessionName: "" - Label + Text { id: sessionNameLabel anchors.centerIn: parent diff --git a/slice/LoopListUserItem.qml b/slice/LoopListUserItem.qml index 6aa0490..e2e67d2 100644 --- a/slice/LoopListUserItem.qml +++ b/slice/LoopListUserItem.qml @@ -1,7 +1,6 @@ import QtQuick 2.7 import QtGraphicalEffects 1.0 import SddmComponents 2.0 -import QtQuick.Controls 2.0 Item { @@ -28,7 +27,7 @@ Item sourceSize.height: 64 } - Label + Text { text: userName color: config.color_text @@ -44,7 +43,7 @@ Item y: 0 } - Label + Text { text: userLogin color: config.color_text diff --git a/slice/Main.qml b/slice/Main.qml index 3c21886..60da738 100644 --- a/slice/Main.qml +++ b/slice/Main.qml @@ -1,8 +1,6 @@ import QtQuick 2.7 import QtGraphicalEffects 1.0 import SddmComponents 2.0 -import QtQuick.Controls 1.4 - Rectangle { diff --git a/slice/PagePower.qml b/slice/PagePower.qml index f11371b..2465117 100644 --- a/slice/PagePower.qml +++ b/slice/PagePower.qml @@ -1,7 +1,6 @@ import QtQuick 2.7 import QtGraphicalEffects 1.0 import SddmComponents 2.0 -import QtQuick.Controls 2.0 import QtQuick.Layouts 1.3 diff --git a/slice/PageSessions.qml b/slice/PageSessions.qml index b929a21..7c99bb8 100644 --- a/slice/PageSessions.qml +++ b/slice/PageSessions.qml @@ -1,8 +1,4 @@ import QtQuick 2.7 -import QtGraphicalEffects 1.0 -import SddmComponents 2.0 -import QtQuick.Controls 2.0 - Item { diff --git a/slice/PageUsers.qml b/slice/PageUsers.qml index 8bd790f..908a4e2 100644 --- a/slice/PageUsers.qml +++ b/slice/PageUsers.qml @@ -1,8 +1,4 @@ import QtQuick 2.7 -import QtGraphicalEffects 1.0 -import SddmComponents 2.0 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 Item { @@ -217,22 +213,19 @@ Item userAvatar: get_avatar(3) } - TextField + TextInput { id: passwordField y: hasLoginShown ? pageRoot.height / 2.3 + 35 : pageRoot.height / 2.3 + 60 width: parent.width + height: 25 opacity: hasLoginShown ? 1 : 0 + color: config.color_text + selectionColor: config.color_selection_bg + selectedTextColor: config.color_selection_text - placeholderText: localeText.password echoMode: TextInput.Password - - style: TextFieldStyle - { - textColor: config.color_text - placeholderTextColor: config.color_placeholder_text - background: Item { height: 25 } - } + clip: true font { @@ -245,6 +238,26 @@ Item } + Text + { + id: passwordFieldPlaceholder + x: passwordField.x + y: passwordField.y + width: passwordField.width + opacity: passwordField.text.length > 0 || !hasLoginShown ? 0 : 1 + + color: config.color_placeholder_text + + font + { + family: config.font + bold: true + pointSize: 18 + } + + text: localeText.password + } + Rectangle { id: progressBar @@ -304,7 +317,7 @@ Item onClicked: back_to_selection() } - Label + Text { id: errorMessage text: localeText.loginFailed @@ -373,6 +386,7 @@ Item NumberAnimation { target: middleItem; property: "y"; to: pageRoot.height / 2.3 - 40; duration: userListContainer.scrollDuration } NumberAnimation { target: passwordField; property: "opacity"; to: 1; duration: userListContainer.scrollDuration } + NumberAnimation { target: passwordFieldPlaceholder; property: "opacity"; to: 1; duration: userListContainer.scrollDuration } NumberAnimation { target: progressBar; property: "opacity"; to: 1; duration: userListContainer.scrollDuration } NumberAnimation { target: buttonUserBack; property: "opacity"; to: 1; duration: userListContainer.scrollDuration } NumberAnimation { target: buttonUserLogin; property: "opacity"; to: 1; duration: userListContainer.scrollDuration } @@ -400,6 +414,7 @@ Item NumberAnimation { target: middleItem; property: "y"; to: pageRoot.height / 2.3; duration: userListContainer.scrollDuration } NumberAnimation { target: passwordField; property: "opacity"; to: 0; duration: userListContainer.scrollDuration } + NumberAnimation { target: passwordFieldPlaceholder; property: "opacity"; to: 0; duration: userListContainer.scrollDuration } NumberAnimation { target: progressBar; property: "opacity"; to: 0; duration: userListContainer.scrollDuration } NumberAnimation { target: buttonUserBack; property: "opacity"; to: 0; duration: userListContainer.scrollDuration } NumberAnimation { target: buttonUserLogin; property: "opacity"; to: 0; duration: userListContainer.scrollDuration } diff --git a/slice/SlicedButton.qml b/slice/SlicedButton.qml index 99ddd1d..adf358c 100644 --- a/slice/SlicedButton.qml +++ b/slice/SlicedButton.qml @@ -1,6 +1,4 @@ import QtQuick 2.7 -import QtQuick.Controls 1.4 - Item { @@ -191,7 +189,7 @@ Item } - Label + Text { id: buttonText x: paddingLeft diff --git a/slice/theme.conf b/slice/theme.conf index 1a0e6ec..012c6cf 100644 --- a/slice/theme.conf +++ b/slice/theme.conf @@ -7,4 +7,6 @@ color_button_bg_selected=#dddddd color_button_bg_selected_hover=#cccccc color_button_text=#1f1f1f color_text=#dddddd -color_placeholder_text=#888888 \ No newline at end of file +color_placeholder_text=#888888 +color_selection_bg=#555555 +color_selection_text=#dddddd \ No newline at end of file