summaryrefslogtreecommitdiff
path: root/.sddm/themes/sugar-dark/Main.qml
diff options
context:
space:
mode:
authorRoger Gonzalez <rogergonzalez21@gmail.com>2019-12-30 15:52:33 -0300
committerRoger Gonzalez <rogergonzalez21@gmail.com>2019-12-30 15:52:33 -0300
commit3259133a20921e14d7e6e1ebe6d2644d2987da8b (patch)
treed2a11266c4a41f59d4712779995592eb2f6cd38f /.sddm/themes/sugar-dark/Main.qml
parent02bd638160122e2b987c00fbbf3b7071c692fff3 (diff)
Added sddm themes
Diffstat (limited to '.sddm/themes/sugar-dark/Main.qml')
-rw-r--r--.sddm/themes/sugar-dark/Main.qml231
1 files changed, 231 insertions, 0 deletions
diff --git a/.sddm/themes/sugar-dark/Main.qml b/.sddm/themes/sugar-dark/Main.qml
new file mode 100644
index 00000000..770f9068
--- /dev/null
+++ b/.sddm/themes/sugar-dark/Main.qml
@@ -0,0 +1,231 @@
+//
+// This file is part of Sugar Dark, a theme for the Simple Display Desktop Manager.
+//
+// Copyright 2018 Marian Arlt
+//
+// Sugar Dark is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Sugar Dark is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Sugar Dark. If not, see <https://www.gnu.org/licenses/>.
+//
+
+import QtQuick 2.11
+import QtQuick.Layouts 1.11
+import QtQuick.Controls 2.4
+import QtGraphicalEffects 1.0
+import "Components"
+
+Pane {
+ id: root
+
+ height: config.ScreenHeight || Screen.height
+ width: config.ScreenWidth || Screen.ScreenWidth
+
+ LayoutMirroring.enabled: config.ForceRightToLeft == "true" ? true : Qt.application.layoutDirection === Qt.RightToLeft
+ LayoutMirroring.childrenInherit: true
+
+ padding: config.ScreenPadding
+ palette.button: "transparent"
+ palette.highlight: config.AccentColor
+ palette.text: config.MainColor
+ palette.buttonText: config.MainColor
+ palette.window: "#444"
+
+ font.family: config.Font
+ font.pointSize: config.FontSize !== "" ? config.FontSize : parseInt(height / 80)
+ focus: true
+
+ property bool leftleft: config.HaveFormBackground == "true" &&
+ config.PartialBlur == "false" &&
+ config.FormPosition == "left" &&
+ config.BackgroundImageAlignment == "left"
+
+ property bool leftcenter: config.HaveFormBackground == "true" &&
+ config.PartialBlur == "false" &&
+ config.FormPosition == "left" &&
+ config.BackgroundImageAlignment == "center"
+
+ property bool rightright: config.HaveFormBackground == "true" &&
+ config.PartialBlur == "false" &&
+ config.FormPosition == "right" &&
+ config.BackgroundImageAlignment == "right"
+
+ property bool rightcenter: config.HaveFormBackground == "true" &&
+ config.PartialBlur == "false" &&
+ config.FormPosition == "right" &&
+ config.BackgroundImageAlignment == "center"
+
+ Item {
+ id: sizeHelper
+
+ anchors.fill: parent
+ height: parent.height
+ width: parent.width
+
+ Rectangle {
+ id: formBackground
+ anchors.fill: form
+ anchors.centerIn: form
+ color: "#444"
+ opacity: config.PartialBlur == "true" ? 0.3 : 1
+ z: 1
+ }
+
+ LoginForm {
+ id: form
+
+ height: virtualKeyboard.state == "visible" ? parent.height - virtualKeyboard.implicitHeight : parent.height
+ width: parent.width / 2.5
+ anchors.horizontalCenter: config.FormPosition == "center" ? parent.horizontalCenter : undefined
+ anchors.left: config.FormPosition == "left" ? parent.left : 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"
+ 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" }
+ states: [
+ State {
+ name: "visible"
+ PropertyChanges {
+ target: form
+ systemButtonVisibility: false
+ clockVisibility: false
+ }
+ PropertyChanges {
+ target: virtualKeyboard
+ y: root.height - virtualKeyboard.height
+ opacity: 1
+ }
+ },
+ State {
+ name: "hidden"
+ PropertyChanges {
+ target: virtualKeyboard
+ y: root.height - root.height/4
+ opacity: 0
+ }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "hidden"
+ to: "visible"
+ SequentialAnimation {
+ ScriptAction {
+ script: {
+ virtualKeyboard.item.activated = true;
+ Qt.inputMethod.show();
+ }
+ }
+ ParallelAnimation {
+ NumberAnimation {
+ target: virtualKeyboard
+ property: "y"
+ duration: 100
+ easing.type: Easing.OutQuad
+ }
+ OpacityAnimator {
+ target: virtualKeyboard
+ duration: 100
+ easing.type: Easing.OutQuad
+ }
+ }
+ }
+ },
+ Transition {
+ from: "visible"
+ to: "hidden"
+ SequentialAnimation {
+ ParallelAnimation {
+ NumberAnimation {
+ target: virtualKeyboard
+ property: "y"
+ duration: 100
+ easing.type: Easing.InQuad
+ }
+ OpacityAnimator {
+ target: virtualKeyboard
+ duration: 100
+ easing.type: Easing.InQuad
+ }
+ }
+ ScriptAction {
+ script: {
+ Qt.inputMethod.hide();
+ }
+ }
+ }
+ }
+ ]
+ }
+
+ Image {
+ id: backgroundImage
+
+ 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.right: rightright ||
+ rightcenter ?
+ formBackground.left : undefined
+
+ horizontalAlignment: config.BackgroundImageAlignment == "left" ?
+ Image.AlignLeft :
+ config.BackgroundImageAlignment == "right" ?
+ Image.AlignRight :
+ config.BackgroundImageAlignment == "center" ?
+ Image.AlignHCenter : undefined
+
+ source: config.background || config.Background
+ fillMode: config.ScaleImageCropped == "true" ? Image.PreserveAspectCrop : Image.PreserveAspectFit
+ asynchronous: true
+ cache: true
+ clip: true
+ mipmap: true
+ }
+
+ MouseArea {
+ anchors.fill: backgroundImage
+ onClicked: parent.forceActiveFocus()
+ }
+ }
+}