added base theme

parents
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
id="svg8"
version="1.1"
viewBox="0 0 34 34"
height="34"
width="34">
<defs
id="defs2" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<path
style="opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
d="M 17,1 C 8.163444,1 1,8.163444 1,17 1,25.836556 8.163444,33 17,33 25.836556,33 33,25.836556 33,17 33,8.163444 25.836556,1 17,1 Z m 0,1 C 25.284271,2 32,8.7157288 32,17 32,25.284271 25.284271,32 17,32 8.7157288,32 2,25.284271 2,17 2,8.7157288 8.7157288,2 17,2 Z"
id="path831" />
<path
id="path816"
d="M 17 11 C 13.686292 11 11 13.686292 11 17 C 11 20.313708 13.686292 23 17 23 C 20.313708 23 23 20.313708 23 17 C 23 13.686292 20.313708 11 17 11 z M 17 12 A 5 5 0 0 1 22 17 A 5 5 0 0 1 17 22 A 5 5 0 0 1 12 17 A 5 5 0 0 1 17 12 z "
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.71428573;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 24 24" width="512" height="512"><path d="M23.821,11.181v0C22.943,9.261,19.5,3,12,3S1.057,9.261.179,11.181a1.969,1.969,0,0,0,0,1.64C1.057,14.739,4.5,21,12,21s10.943-6.261,11.821-8.181A1.968,1.968,0,0,0,23.821,11.181ZM12,18a6,6,0,1,1,6-6A6.006,6.006,0,0,1,12,18Z"/><circle cx="12" cy="12" r="4"/></svg>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generator: Adobe Illustrator 25.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512.19 512.19" style="enable-background:new 0 0 512.19 512.19;" xml:space="preserve" width="512" height="512">
<g>
<path d="M496.543,200.771c-19.259-31.537-43.552-59.707-71.915-83.392l59.733-59.733c8.185-8.475,7.95-21.98-0.525-30.165 c-8.267-7.985-21.374-7.985-29.641,0l-64.96,65.045c-40.269-23.918-86.306-36.385-133.141-36.053 c-132.075,0-207.339,90.411-240.448,144.299c-20.862,33.743-20.862,76.379,0,110.123c19.259,31.537,43.552,59.707,71.915,83.392 l-59.733,59.733c-8.475,8.185-8.71,21.691-0.525,30.165c8.185,8.475,21.691,8.71,30.165,0.525c0.178-0.172,0.353-0.347,0.525-0.525 l65.109-65.109c40.219,23.915,86.201,36.402,132.992,36.117c132.075,0,207.339-90.411,240.448-144.299 C517.405,277.151,517.405,234.515,496.543,200.771z M128.095,255.833c-0.121-70.575,56.992-127.885,127.567-128.006 c26.703-0.046,52.75,8.275,74.481,23.793l-30.976,30.976c-13.004-7.842-27.887-12.022-43.072-12.096 c-47.128,0-85.333,38.205-85.333,85.333c0.074,15.185,4.254,30.068,12.096,43.072l-30.976,30.976 C136.414,308.288,128.096,282.394,128.095,255.833z M256.095,383.833c-26.561-0.001-52.455-8.319-74.048-23.787l30.976-30.976 c13.004,7.842,27.887,12.022,43.072,12.096c47.128,0,85.333-38.205,85.333-85.333c-0.074-15.185-4.254-30.068-12.096-43.072 l30.976-30.976c41.013,57.434,27.702,137.242-29.732,178.255C308.845,375.558,282.798,383.879,256.095,383.833z"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
width="34"
height="34"
viewBox="0 0 34 34"
version="1.1"
id="svg8">
<defs
id="defs2" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
transform="matrix(1.000593,0,0,1.0006688,0.99050505,-287.73702)">
<path
style="opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.00189281;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
d="M 19.001953,1.1308594 V 2 H 19 v 11 h 1 V 2.3359375 A 15,15 45 0 1 32,17 15,15 45 0 1 21.001953,31.455078 v 1.033203 A 16.009488,16.010701 45 0 0 33.009766,17 16.009488,16.010701 45 0 0 19.001953,1.1308594 Z M 12.998047,1.5117188 A 16.009488,16.010701 45 0 0 0.99023438,17 16.009488,16.010701 45 0 0 14.998047,32.869141 V 32 H 15 V 21 H 14 V 31.664062 A 15,15 45 0 1 2,17 15,15 45 0 1 12.998047,2.5449219 Z"
transform="matrix(0.70668771,-0.70663419,0.70668771,0.70663419,-8.0273788,304.53335)"
id="path817" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
id="svg8"
version="1.1"
viewBox="0 0 34 34"
height="34"
width="34">
<defs
id="defs2" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<path
id="path822"
d="M 14 1 L 14 13 L 15 13 L 15 1 L 14 1 z M 19 1 L 19 13 L 20 13 L 20 1 L 19 1 z M 9 3.1855469 C 4.1702837 5.9748853 1.0026451 11.162345 1 17 C 1 25.836556 8.163444 33 17 33 C 25.836556 33 33 25.836556 33 17 C 32.99593 11.163669 29.828666 5.9780498 25 3.1894531 L 25 4.3496094 C 29.280842 7.0494632 31.988612 11.788234 32 17 C 32 25.284271 25.284271 32 17 32 C 8.7157288 32 2 25.284271 2 17 C 2.0120649 11.788824 4.7195457 7.0510246 9 4.3515625 L 9 3.1855469 z "
style="opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill" />
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
id="svg8"
version="1.1"
viewBox="0 0 34 34"
height="34"
width="34">
<defs
id="defs2" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<path
style="opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill"
d="M 17,1 C 8.163444,1 1,8.163444 1,17 1,25.836556 8.163444,33 17,33 25.836556,33 33,25.836556 33,17 33,8.163444 25.836556,1 17,1 Z m 0,1 C 25.284271,2 32,8.7157288 32,17 32,25.284271 25.284271,32 17,32 8.7157288,32 2,25.284271 2,17 2,8.7157288 8.7157288,2 17,2 Z m -4,9 v 12 h 1 V 11 Z m 7,0 v 12 h 1 V 11 Z"
id="path831" />
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="28"
width="28"
id="svg12"
xml:space="preserve"
viewBox="0 0 28 28"
y="0px"
x="0px"
version="1.1"
sodipodi:docname="user.svgz"
inkscape:version="0.92.2 2405546, 2018-03-11"><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1440"
inkscape:window-height="843"
id="namedview8"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="3.2721019"
inkscape:cx="11.317087"
inkscape:cy="22.626613"
inkscape:window-x="0"
inkscape:window-y="22"
inkscape:window-maximized="1"
inkscape:current-layer="svg12" /><metadata
id="metadata18"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs16" /><g
id="g6"
transform="scale(0.06862745)"><g
id="g4"><path
id="path2"
d="M 204,204 C 260.1,204 306,158.1 306,102 306,45.9 260.1,0 204,0 147.9,0 102,45.9 102,102 c 0,56.1 45.9,102 102,102 z m 0,51 C 135.15,255 0,288.15 0,357 v 51 H 408 V 357 C 408,288.15 272.85,255 204,255 Z"
inkscape:connector-curvature="0" /></g></g></svg>
\ No newline at end of file
import QtQuick 2.15
import QtQuick.Controls 2.15
Column {
id: clock
width: parent.width / 2
spacing: 0
Label {
id: timeLabel
anchors.horizontalCenter: parent.horizontalCenter
font.pointSize: root.font.pointSize * 9
font.bold: true
color: config.TimeTextColor
renderType: Text.QtRendering
function updateTime() {
text = new Date().toLocaleTimeString(Qt.locale(config.Locale), config.HourFormat == "long" ? Locale.LongFormat : config.HourFormat !== "" ? config.HourFormat : Locale.ShortFormat)
}
}
Label {
id: dateLabel
anchors.horizontalCenter: parent.horizontalCenter
color: config.DateTextColor
font.pointSize: root.font.pointSize * 2
font.bold: true
renderType: Text.QtRendering
function updateTime() {
text = new Date().toLocaleDateString(Qt.locale(config.Locale), config.DateFormat == "short" ? Locale.ShortFormat : config.DateFormat !== "" ? config.DateFormat : Locale.LongFormat)
}
}
Timer {
interval: 1000
repeat: true
running: true
onTriggered: {
dateLabel.updateTime()
timeLabel.updateTime()
}
}
Component.onCompleted: {
dateLabel.updateTime()
timeLabel.updateTime()
}
}
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
Column {
id: inputContainer
Layout.fillWidth: true
property ComboBox exposeSession: sessionSelect.exposeSession
property bool failed
Item {
id: errorMessageField
// change also in selectSession
height: root.font.pointSize * 2
width: parent.width / 2
anchors.horizontalCenter: parent.horizontalCenter
Label {
id: errorMessage
width: parent.width
horizontalAlignment: Text.AlignHCenter
text: failed ? config.TranslateLoginFailedWarning || textConstants.loginFailed + "!" : keyboard.capsLock ? config.TranslateCapslockWarning || textConstants.capslockWarning : null
font.pointSize: root.font.pointSize * 0.8
font.italic: true
color: config.WarningColor
opacity: 0
states: [
State {
name: "fail"
when: failed
PropertyChanges {
target: errorMessage
opacity: 1
}
},
State {
name: "capslock"
when: keyboard.capsLock
PropertyChanges {
target: errorMessage
opacity: 1
}
}
]
transitions: [
Transition {
PropertyAnimation {
properties: "opacity"
duration: 100
}
}
]
}
}
Item {
id: usernameField
height: root.font.pointSize * 4.5
width: parent.width / 2
anchors.horizontalCenter: parent.horizontalCenter
ComboBox {
id: selectUser
width: parent.height
height: parent.height
anchors.left: parent.left
z: 2
model: userModel
currentIndex: model.lastIndex
textRole: "name"
hoverEnabled: true
onActivated: {
username.text = currentText
}
property var popkey: config.RightToLeftLayout == "true" ? Qt.Key_Right : Qt.Key_Left
Keys.onPressed: function(event) {
if (event.key == Qt.Key_Down && !popup.opened)
username.forceActiveFocus();
if ((event.key == Qt.Key_Up || event.key == popkey) && !popup.opened)
popup.open();
}
KeyNavigation.down: username
KeyNavigation.right: username
delegate: ItemDelegate {
// minus padding
width: popupHandler.width - 20
anchors.horizontalCenter: popupHandler.horizontalCenter
contentItem: Text {
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: model.name
font.pointSize: root.font.pointSize * 0.8
font.capitalization: Font.AllLowercase
font.family: root.font.family
color: config.DropdownTextColor
}
background: Rectangle {
color: selectUser.highlightedIndex === index ? config.DropdownSelectedBackgroundColor : "transparent"
}
}
indicator: Button {
id: usernameIcon
width: selectUser.height * 1
height: parent.height
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: selectUser.height * 0
icon.height: parent.height * 0.25
icon.width: parent.height * 0.25
enabled: false
icon.color: config.UserIconColor
icon.source: Qt.resolvedUrl("../Assets/User.svg")
background: Rectangle {
color: "transparent"
border.color: "transparent"
}
}
background: Rectangle {
color: "transparent"
border.color: "transparent"
}
popup: Popup {
id: popupHandler
implicitHeight: contentItem.implicitHeight
width: usernameField.width
y: parent.height - username.height / 3
x: config.RightToLeftLayout == "true" ? -loginButton.width + selectUser.width : 0
rightMargin: config.RightToLeftLayout == "true" ? root.padding + usernameField.width / 2 : undefined
padding: 10
contentItem: ListView {
implicitHeight: contentHeight + 20
clip: true
model: selectUser.popup.visible ? selectUser.delegateModel : null
currentIndex: selectUser.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle {
radius: config.RoundCorners / 2
color: config.DropdownBackgroundColor
layer.enabled: true
}
enter: Transition {
NumberAnimation { property: "opacity"; from: 0; to: 1 }
}
}
states: [
State {
name: "pressed"
when: selectUser.down
PropertyChanges {
target: usernameIcon
icon.color: Qt.lighter(config.HoverUserIconColor, 1.1)
}
},
State {
name: "hovered"
when: selectUser.hovered
PropertyChanges {
target: usernameIcon
icon.color: Qt.lighter(config.HoverUserIconColor, 1.2)
}
},
State {
name: "focused"
when: selectUser.activeFocus
PropertyChanges {
target: usernameIcon
icon.color: config.HoverUserIconColor
}
}
]
transitions: [
Transition {
PropertyAnimation {
properties: "color, border.color, icon.color"
duration: 150
}
}
]
}
TextField {
id: username
anchors.centerIn: parent
height: root.font.pointSize * 3
width: parent.width
horizontalAlignment: TextInput.AlignHCenter
z: 1
text: config.ForceLastUser == "true" ? selectUser.currentText : null
color: config.LoginFieldTextColor
font.bold: true
font.capitalization: config.AllowUppercaseLettersInUsernames == "false" ? Font.AllLowercase : Font.MixedCase
placeholderText: config.TranslatePlaceholderUsername || textConstants.userName
placeholderTextColor: config.PlaceholderTextColor
selectByMouse: true
renderType: Text.QtRendering
onFocusChanged:{
if(focus)
selectAll()
}
background: Rectangle {
color: config.LoginFieldBackgroundColor
opacity: 0.2
border.color: "transparent"
border.width: parent.activeFocus ? 2 : 1
radius: config.RoundCorners || 0
}
onAccepted: config.AllowUppercaseLettersInUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession)
KeyNavigation.down: passwordIcon
states: [
State {
name: "focused"
when: username.activeFocus
PropertyChanges {
target: username.background
border.color: config.HighlightBorderColor
}
PropertyChanges {
target: username
color: Qt.lighter(config.LoginFieldTextColor, 1.15)
}
}
]
}
}
Item {
id: passwordField
height: root.font.pointSize * 4.5
width: parent.width / 2
anchors.horizontalCenter: parent.horizontalCenter
Button {
id: passwordIcon
height: parent.height
width: selectUser.height * 1
anchors.left: parent.left
anchors.leftMargin: selectUser.height * 0
anchors.verticalCenter: parent.verticalCenter
z: 2
icon.height: parent.height * 0.25
icon.width: parent.height * 0.25
icon.color: config.PasswordIconColor
icon.source: Qt.resolvedUrl("../Assets/Password2.svg")
background: Rectangle {
color: "transparent"
border.color: "transparent"
}
states: [
State {
name: "visiblePasswordFocused"
when: passwordIcon.checked && passwordIcon.activeFocus
PropertyChanges {
target: passwordIcon
icon.source: Qt.resolvedUrl("../Assets/Password.svg")
icon.color: config.HoverPasswordIconColor
}
},
State {
name: "visiblePasswordHovered"
when: passwordIcon.checked && passwordIcon.hovered
PropertyChanges {
target: passwordIcon
icon.source: Qt.resolvedUrl("../Assets/Password.svg")
icon.color: config.HoverPasswordIconColor
}
},
State {
name: "visiblePassword"
when: passwordIcon.checked
PropertyChanges {
target: passwordIcon
icon.source: Qt.resolvedUrl("../Assets/Password.svg")
}
},
State {
name: "hiddenPasswordFocused"
when: passwordIcon.enabled && passwordIcon.activeFocus
PropertyChanges {
target: passwordIcon
icon.source: Qt.resolvedUrl("../Assets/Password2.svg")
icon.color: config.HoverPasswordIconColor
}
},
State {
name: "hiddenPasswordHovered"
when: passwordIcon.hovered
PropertyChanges {
target: passwordIcon
icon.source: Qt.resolvedUrl("../Assets/Password2.svg")
icon.color: config.HoverPasswordIconColor
}
}
]
onClicked: toggle()
Keys.onReturnPressed: toggle()
Keys.onEnterPressed: toggle()
KeyNavigation.down: password
}
TextField {
id: password
height: root.font.pointSize * 3
width: parent.width
anchors.centerIn: parent
horizontalAlignment: TextInput.AlignHCenter
font.bold: true
color: config.PasswordFieldTextColor
focus: config.PasswordFocus == "true" ? true : false
echoMode: passwordIcon.checked ? TextInput.Normal : TextInput.Password
placeholderText: config.TranslatePlaceholderPassword || textConstants.password
placeholderTextColor: config.PlaceholderTextColor
passwordCharacter: "•"
passwordMaskDelay: config.HideCompletePassword == "true" ? undefined : 1000
renderType: Text.QtRendering
selectByMouse: true
background: Rectangle {
color: config.PasswordFieldBackgroundColor
opacity: 0.2
border.color: "transparent"
border.width: parent.activeFocus ? 2 : 1
radius: config.RoundCorners || 0
}
onAccepted: config.AllowUppercaseLettersInUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession)
KeyNavigation.down: loginButton
}
states: [
State {
name: "focused"
when: password.activeFocus
PropertyChanges {
target: password.background
border.color: config.HighlightBorderColor
}
PropertyChanges {
target: password
color: Qt.lighter(config.LoginFieldTextColor, 1.15)
}
}
]
transitions: [
Transition {
PropertyAnimation {
properties: "color, border.color"
duration: 150
}
}
]
}
Item {
id: login
// important
// try 4 or 9 ...
height: root.font.pointSize * 9
width: parent.width / 2
anchors.horizontalCenter: parent.horizontalCenter
visible: config.HideLoginButton == "true" ? false : true
Button {
id: loginButton
height: root.font.pointSize * 3
implicitWidth: parent.width
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
text: config.TranslateLogin || textConstants.login
enabled: config.AllowEmptyPassword == "true" || username.text != "" && password.text != "" ? true : false
hoverEnabled: true
contentItem: Text {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.bold: true
font.pointSize: root.font.pointSize
font.family: root.font.family
color: config.LoginButtonTextColor
text: parent.text
opacity: 0.5
}
background: Rectangle {
id: buttonBackground
color: config.LoginButtonBackgroundColor
opacity: 0.2
radius: config.RoundCorners || 0
}
states: [
State {
name: "pressed"
when: loginButton.down
PropertyChanges {
target: buttonBackground
color: Qt.darker(config.LoginButtonBackgroundColor, 1.1)
opacity: 1
}
PropertyChanges {
target: loginButton.contentItem
}
},
State {
name: "hovered"
when: loginButton.hovered
PropertyChanges {
target: buttonBackground
color: Qt.lighter(config.LoginButtonBackgroundColor, 1.15)
opacity: 1
}
PropertyChanges {
target: loginButton.contentItem
opacity: 1
}
},
State {
name: "focused"
when: loginButton.activeFocus
PropertyChanges {
target: buttonBackground
color: Qt.lighter(config.LoginButtonBackgroundColor, 1.2)
opacity: 1
}
PropertyChanges {
target: loginButton.contentItem
opacity: 1
}
},
State {
name: "enabled"
when: loginButton.enabled
PropertyChanges {
target: buttonBackground;
color: config.LoginButtonBackgroundColor;
opacity: 1
}
PropertyChanges {
target: loginButton.contentItem;
opacity: 1
}
}
]
transitions: [
Transition {
PropertyAnimation {
properties: "opacity, color";
duration: 300
}
}
]
onClicked: config.AllowUppercaseLettersInUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession)
Keys.onReturnPressed: clicked()
Keys.onEnterPressed: clicked()
KeyNavigation.down: config.HideSystemButtons == "true" ? virtualKeyboard : systemButtons.children[0]
}
}
Connections {
target: sddm
function onLoginSucceeded() {}
function onLoginFailed() {
failed = true
resetError.running ? resetError.stop() && resetError.start() : resetError.start()
}
}
Timer {
id: resetError
interval: 2000
onTriggered: failed = false
running: false
}
}
import QtQuick 2.15
import QtQuick.Layouts 1.15
import SddmComponents 2.0 as SDDM
ColumnLayout {
id: formContainer
SDDM.TextConstants { id: textConstants }
property int p: config.ScreenPadding == "" ? 0 : config.ScreenPadding
property string a: config.FormPosition
Clock {
id: clock
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
// important
Layout.preferredHeight: root.height / 3
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
}
Input {
id: input
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: root.height / 10
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
Layout.topMargin: 0
}
SystemButtons {
id: systemButtons
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.preferredHeight: root.height / 5
Layout.maximumHeight: root.height / 5
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
exposedSession: input.exposeSession
}
SessionButton {
id: sessionSelect
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.preferredHeight: root.height / 54
Layout.maximumHeight: root.height / 54
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
}
VirtualKeyboardButton {
id: virtualKeyboardButton
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
Layout.preferredHeight: root.height / 27
Layout.maximumHeight: root.height / 27
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
}
}
import QtQuick 2.15
import QtQuick.Controls 2.15
Item {
id: sessionButton
height: root.font.pointSize
width: parent.width / 2
property var selectedSession: selectSession.currentIndex
property string textConstantSession
property int loginButtonWidth
property ComboBox exposeSession: selectSession
ComboBox {
id: selectSession
// important
// change also in errorMessage
height: root.font.pointSize * 2
anchors.horizontalCenter: parent.horizontalCenter
hoverEnabled: true
model: sessionModel
currentIndex: model.lastIndex
textRole: "name"
Keys.onPressed: function(event) {
if ((event.key == Qt.Key_Left || event.key == Qt.Key_Right) && !popup.opened) {
popup.open();
}
}
delegate: ItemDelegate {
// minus padding
width: popupHandler.width - 20
anchors.horizontalCenter: popupHandler.horizontalCenter
contentItem: Text {
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: model.name
font.pointSize: root.font.pointSize * 0.8
font.family: root.font.family
color: config.DropdownTextColor
}
background: Rectangle {
color: selectSession.highlightedIndex === index ? config.DropdownSelectedBackgroundColor : "transparent"
}
}
indicator {
visible: false
}
contentItem: Text {
id: displayedItem
verticalAlignment: Text.AlignVCenter
text: (config.TranslateSessionSelection || "Session") + " (" + selectSession.currentText + ")"
color: config.SessionButtonTextColor
font.pointSize: root.font.pointSize * 0.8
font.family: root.font.family
Keys.onReleased: parent.popup.open()
}
background: Rectangle {
height: parent.visualFocus ? 2 : 0
width: displayedItem.implicitWidth
color: "transparent"
}
popup: Popup {
id: popupHandler
implicitHeight: contentItem.implicitHeight
width: sessionButton.width
y: parent.height - 1
x: -popupHandler.width/2 + displayedItem.width/2
padding: 10
contentItem: ListView {
implicitHeight: contentHeight + 20
clip: true
model: selectSession.popup.visible ? selectSession.delegateModel : null
currentIndex: selectSession.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator { }
}
background: Rectangle {
radius: config.RoundCorners / 2
color: config.DropdownBackgroundColor
layer.enabled: true
}
enter: Transition {
NumberAnimation { property: "opacity"; from: 0; to: 1 }
}
}
states: [
State {
name: "pressed"
when: selectSession.down
PropertyChanges {
target: displayedItem
color: Qt.darker(config.HoverSessionButtonTextColor, 1.1)
}
},
State {
name: "hovered"
when: selectSession.hovered
PropertyChanges {
target: displayedItem
color: Qt.lighter(config.HoverSessionButtonTextColor, 1.1)
}
},
State {
name: "focused"
when: selectSession.visualFocus
PropertyChanges {
target: displayedItem
color: config.HoverSessionButtonTextColor
}
}
]
transitions: [
Transition {
PropertyAnimation {
properties: "color"
duration: 150
}
}
]
}
}
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
RowLayout {
spacing: root.font.pointSize
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 {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.topMargin: root.font.pointSize * 6.5
text: modelData[1]
font.pointSize: root.font.pointSize * 0.8
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.SystemButtonsIconsColor
palette.buttonText: config.SystemButtonsIconsColor
display: AbstractButton.TextUnderIcon
visible: config.HideSystemButtons != "true" && (config.BypassSystemButtonsChecks == "true" ? 1 : modelData[2])
hoverEnabled: true
background: Rectangle {
height: 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
PropertyChanges {
target: parent.children[index]
icon.color: root.palette.buttonText
palette.buttonText: Qt.darker(root.palette.buttonText, 1.1)
}
},
State {
name: "hovered"
when: parent.children[index].hovered
PropertyChanges {
target: parent.children[index]
icon.color: root.palette.buttonText
palette.buttonText: Qt.lighter(root.palette.buttonText, 1.1)
}
},
State {
name: "focused"
when: parent.children[index].activeFocus
PropertyChanges {
target: parent.children[index]
icon.color: root.palette.buttonText
palette.buttonText: root.palette.buttonText
}
}
]
transitions: [
Transition {
PropertyAnimation {
properties: "palette.buttonText, border.color"
duration: 150
}
}
]
}
}
}
\ No newline at end of file
import QtQuick 2.15
import QtQuick.VirtualKeyboard 2.3
InputPanel {
id: virtualKeyboard
property bool activated: false
active: activated && Qt.inputMethod.visible
visible: active
}
import QtQuick 2.15
import QtQuick.Controls 2.15
Item {
Button {
id: virtualKeyboardButton
anchors.horizontalCenter: parent.horizontalCenter
z: 1
visible: virtualKeyboard.status == Loader.Ready && config.HideVirtualKeyboard == "false"
checkable: true
onClicked: virtualKeyboard.switchState()
Keys.onReturnPressed: {
toggle();
virtualKeyboard.switchState();
}
Keys.onEnterPressed: {
toggle();
virtualKeyboard.switchState();
}
contentItem: Text {
id: virtualKeyboardButtonText
text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)"
font.pointSize: root.font.pointSize * 0.8
font.family: root.font.family
color: parent.visualFocus ? config.HoverVirtualKeyboardButtonTextColor : config.VirtualKeyboardButtonTextColor
}
background: Rectangle {
id: virtualKeyboardButtonBackground
color: "transparent"
}
states: [
State {
name: "HoveredAndChecked"
when: virtualKeyboardButton.checked && virtualKeyboardButton.hovered
PropertyChanges {
target: virtualKeyboardButtonText
text: config.TranslateVirtualKeyboardButtonOn || "Virtual Keyboard (on)"
color: config.HoverVirtualKeyboardButtonTextColor
}
},
State {
name: "checked"
when: virtualKeyboardButton.checked
PropertyChanges {
target: virtualKeyboardButtonText
text: config.TranslateVirtualKeyboardButtonOn || "Virtual Keyboard (on)"
}
},
State {
name: "hovered"
when: virtualKeyboardButton.hovered
PropertyChanges {
target: virtualKeyboardButtonText
text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)"
color: config.HoverVirtualKeyboardButtonTextColor
}
}
]
}
}
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQuick.Effects
import QtMultimedia
import "Components"
Pane {
id: root
height: config.ScreenHeight || Screen.height
width: config.ScreenWidth || Screen.ScreenWidth
padding: config.ScreenPadding
LayoutMirroring.enabled: config.RightToLeftLayout == "true" ? true : Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true
palette.window: config.BackgroundColor
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) || 13
focus: true
property bool leftleft: config.HaveFormBackground == "true" &&
config.PartialBlur == "false" &&
config.FormPosition == "left" &&
config.BackgroundHorizontalAlignment == "left"
property bool leftcenter: config.HaveFormBackground == "true" &&
config.PartialBlur == "false" &&
config.FormPosition == "left" &&
config.BackgroundHorizontalAlignment == "center"
property bool rightright: config.HaveFormBackground == "true" &&
config.PartialBlur == "false" &&
config.FormPosition == "right" &&
config.BackgroundHorizontalAlignment == "right"
property bool rightcenter: config.HaveFormBackground == "true" &&
config.PartialBlur == "false" &&
config.FormPosition == "right" &&
config.BackgroundHorizontalAlignment == "center"
Item {
id: sizeHelper
height: parent.height
width: parent.width
anchors.fill: parent
Rectangle {
id: tintLayer
height: parent.height
width: parent.width
anchors.fill: parent
z: 1
color: config.DimBackgroundColor
opacity: config.DimBackground
}
Rectangle {
id: formBackground
anchors.fill: form
anchors.centerIn: form
z: 1
color: config.FormBackgroundColor
visible: config.HaveFormBackground == "true" ? true : false
opacity: config.PartialBlur == "true" ? 0.3 : 1
}
LoginForm {
id: form
height: parent.height
width: parent.width / 3.5
anchors.left: config.FormPosition == "left" ? parent.left : undefined
anchors.horizontalCenter: config.FormPosition == "center" ? parent.horizontalCenter : undefined
anchors.right: config.FormPosition == "right" ? parent.right : undefined
z: 1
}
Loader {
id: virtualKeyboard
source: "Components/VirtualKeyboard.qml"
// x * 0.4 = x / 2.5
width: config.KeyboardSize == "" ? parent.width * 0.4 : parent.width * config.KeyboardSize
anchors.bottom: parent.bottom
anchors.left: config.VirtualKeyboardPosition == "left" ? parent.left : undefined;
anchors.horizontalCenter: config.VirtualKeyboardPosition == "center" ? parent.horizontalCenter : undefined;
anchors.right: config.VirtualKeyboardPosition == "right" ? parent.right : undefined;
z: 1
state: "hidden"
property bool keyboardActive: item ? item.active : false
function switchState() { state = state == "hidden" ? "visible" : "hidden"}
states: [
State {
name: "visible"
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: {
virtualKeyboard.item.activated = false;
Qt.inputMethod.hide();
}
}
}
}
]
}
Image {
id: backgroundPlaceholderImage
z: 10
source: config.BackgroundPlaceholder
visible: false
}
AnimatedImage {
id: backgroundImage
MediaPlayer {
id: player
videoOutput: videoOutput
autoPlay: true
playbackRate: config.BackgroundSpeed == "" ? 1.0 : config.BackgroundSpeed
loops: -1
onPlayingChanged: {
console.log("Video started.")
backgroundPlaceholderImage.visible = false;
}
}
VideoOutput {
id: videoOutput
fillMode: config.CropBackground == "true" ? VideoOutput.PreserveAspectCrop : VideoOutput.PreserveAspectFit
anchors.fill: parent
}
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.BackgroundHorizontalAlignment == "left" ?
Image.AlignLeft :
config.BackgroundHorizontalAlignment == "right" ?
Image.AlignRight : Image.AlignHCenter
verticalAlignment: config.BackgroundVerticalAlignment == "top" ?
Image.AlignTop :
config.BackgroundVerticalAlignment == "bottom" ?
Image.AlignBottom : Image.AlignVCenter
speed: config.BackgroundSpeed == "" ? 1.0 : config.BackgroundSpeed
paused: config.PauseBackground == "true" ? 1 : 0
fillMode: config.CropBackground == "true" ? Image.PreserveAspectCrop : Image.PreserveAspectFit
asynchronous: true
cache: true
clip: true
mipmap: true
Component.onCompleted:{
var fileType = config.Background.substring(config.Background.lastIndexOf(".") + 1)
const videoFileTypes = ["avi", "mp4", "mov", "mkv", "m4v", "webm"];
if (videoFileTypes.includes(fileType)) {
backgroundPlaceholderImage.visible = true;
player.source = Qt.resolvedUrl(config.Background)
player.play();
}
else{
backgroundImage.source = config.background || config.Background
}
}
}
MouseArea {
anchors.fill: backgroundImage
onClicked: parent.forceActiveFocus()
}
ShaderEffectSource {
id: blurMask
height: parent.height
width: form.width
anchors.centerIn: form
sourceItem: backgroundImage
sourceRect: Qt.rect(x,y,width,height)
visible: config.FullBlur == "true" || config.PartialBlur == "true" ? true : false
}
MultiEffect {
id: blur
height: parent.height
// width: config.FullBlur == "true" ? parent.width : form.width
// anchors.centerIn: config.FullBlur == "true" ? parent : form
// This solves problem when FullBlur and HaveFormBackground is set to true but PartialBlur is false and FormPosition isn't center.
width: (config.FullBlur == "true" && config.PartialBlur == "false" && config.FormPosition != "center" ) ? parent.width - formBackground.width : config.FullBlur == "true" ? parent.width : form.width
anchors.centerIn: config.FullBlur == "true" ? backgroundImage : form
source: config.FullBlur == "true" ? backgroundImage : blurMask
blurEnabled: true
autoPaddingEnabled: false
blur: config.Blur == "" ? 2.0 : config.Blur
blurMax: config.BlurMax == "" ? 48 : config.BlurMax
visible: config.FullBlur == "true" || config.PartialBlur == "true" ? true : false
}
}
}
[SddmGreeterTheme]
Name=sddm-theme-ximper
Description=sddm-theme-ximper
Author=fiersik
Website=https://gitlab.eterfund.ru/ximperlinux/sddm-theme-ximper
License=GPL-3.0
Type=sddm-theme
Version=1.0
ConfigFile=theme.conf
MainScript=Main.qml
TranslationsDirectory=translations
Theme-Id=sddm-theme-ximper
Theme-API=2.0
QtVersion=6
[General]
#################### General ####################
ScreenWidth="1920"
ScreenHeight="1080"
ScreenPadding=""
Font="FiraCode Nerd Font"
FontSize="12"
KeyboardSize="1.0"
RoundCorners="15"
Locale=""
HourFormat="HH:mm"
DateFormat="dddd d MMMM"
#################### Background ####################
BackgroundPlaceholder="nightcity.png"
Background="nightcity.png"
BackgroundSpeed="1.0"
PauseBackground=""
DimBackground="0.0"
CropBackground="true"
BackgroundHorizontalAlignment="center"
BackgroundVerticalAlignment="center"
#################### Colors ####################
DateTextColor="#D8E2EA"
TimeTextColor="#D8E2EA"
FormBackgroundColor="#0B0E1D"
BackgroundColor="#0B0E1D"
DimBackgroundColor="#0B0E1D"
LoginFieldBackgroundColor="#0B0E1D"
PasswordFieldBackgroundColor="#0B0E1D"
LoginFieldTextColor="#D8E2EA"
PasswordFieldTextColor="#D8E2EA"
UserIconColor="#a6a7ac"
PasswordIconColor="#a6a7ac"
PlaceholderTextColor="#a6a7ac"
WarningColor="#e89b0b"
LoginButtonTextColor="#D8E2EA"
LoginButtonBackgroundColor="#323648"
SystemButtonsIconsColor="#a6a7ac"
SessionButtonTextColor="#a6a7ac"
VirtualKeyboardButtonTextColor="#a6a7ac"
DropdownTextColor="#D8E2EA"
DropdownSelectedBackgroundColor="#0B0E1D"
DropdownBackgroundColor="#1D202F"
HighlightTextColor="#000055"
HighlightBackgroundColor="#b4d8ff"
HighlightBorderColor="transparent"
HoverUserIconColor="#fcfcff"
HoverPasswordIconColor="#fcfcff"
HoverSystemButtonsIconsColor="#fcfcff"
HoverSessionButtonTextColor="#fcfcff"
HoverVirtualKeyboardButtonTextColor="#fcfcff"
#################### Form ####################
PartialBlur="true"
FullBlur=""
BlurMax="48.0"
Blur="1.0"
HaveFormBackground="true"
FormPosition="center"
#################### Virtual Keyboard ####################
VirtualKeyboardPosition="center"
#################### Interface Behavior ####################
HideVirtualKeyboard="false"
HideSystemButtons="false"
HideLoginButton="false"
ForceLastUser="true"
PasswordFocus="true"
HideCompletePassword="true"
AllowEmptyPassword="false"
AllowUppercaseLettersInUsernames="false"
BypassSystemButtonsChecks="false"
RightToLeftLayout="false"
#################### Translation ####################
TranslatePlaceholderUsername=""
TranslatePlaceholderPassword=""
TranslateLogin=""
TranslateLoginFailedWarning=""
TranslateCapslockWarning=""
TranslateSuspend=""
TranslateHibernate=""
TranslateReboot=""
TranslateShutdown=""
TranslateSessionSelection=""
TranslateVirtualKeyboardButtonOn=""
TranslateVirtualKeyboardButtonOff=""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment