mirror of
https://github.com/Keyitdev/sddm-astronaut-theme.git
synced 2026-09-24 02:22:09 +00:00
Update: Moved virtual keyboard button to LoginForm.qml. Replaced anchors with layout alignment. Cleaned up some code.
This commit is contained in:
@@ -33,20 +33,25 @@ ColumnLayout {
|
||||
SystemButtons {
|
||||
id: systemButtons
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
||||
Layout.preferredHeight: root.height / 4
|
||||
Layout.maximumHeight: root.height / 4
|
||||
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.AlignVCenter
|
||||
// Layout.preferredHeight: root.height / 16
|
||||
// Layout.maximumHeight: root.height / 16
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: parent.height/16
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@ RowLayout {
|
||||
RoundButton {
|
||||
text: modelData[1]
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
Layout.topMargin: root.font.pointSize * 6.5
|
||||
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)
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
||||
// Copyright (C) 2022-2024 Keyitdev
|
||||
// Distributed under the GPLv3+ License https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
Item {
|
||||
Button {
|
||||
id: virtualKeyboardButton
|
||||
checkable: true
|
||||
onClicked: virtualKeyboard.switchState()
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
toggle();
|
||||
virtualKeyboard.switchState();
|
||||
}
|
||||
Keys.onEnterPressed: {
|
||||
toggle();
|
||||
virtualKeyboard.switchState();
|
||||
}
|
||||
visible: virtualKeyboard.status == Loader.Ready && config.HideVirtualKeyboard == "false"
|
||||
// anchors.bottom: parent.bottom
|
||||
// anchors.bottomMargin: implicitHeight
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
z: 1
|
||||
contentItem: Text {
|
||||
id: virtualKeyboardButtonText
|
||||
text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)"
|
||||
color: parent.visualFocus ? config.HoverVirtualKeyboardButtonTextColor : config.VirtualKeyboardButtonTextColor
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
font.family: root.font.family
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -86,65 +86,6 @@ Pane {
|
||||
z: 1
|
||||
}
|
||||
|
||||
Button {
|
||||
id: vkb
|
||||
checkable: true
|
||||
onClicked: virtualKeyboard.switchState()
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
toggle();
|
||||
virtualKeyboard.switchState();
|
||||
}
|
||||
Keys.onEnterPressed: {
|
||||
toggle();
|
||||
virtualKeyboard.switchState();
|
||||
}
|
||||
visible: virtualKeyboard.status == Loader.Ready && config.HideVirtualKeyboard == "false"
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: implicitHeight
|
||||
anchors.horizontalCenter: form.horizontalCenter
|
||||
z: 1
|
||||
contentItem: Text {
|
||||
id: buttonVirtualKeyboard
|
||||
text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)"
|
||||
color: parent.visualFocus ? config.HoverVirtualKeyboardButtonTextColor : config.VirtualKeyboardButtonTextColor
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
font.family: root.font.family
|
||||
}
|
||||
background: Rectangle {
|
||||
id: vkbbg
|
||||
color: "transparent"
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "HoveredAndChecked"
|
||||
when: vkb.checked && vkb.hovered
|
||||
PropertyChanges {
|
||||
target: buttonVirtualKeyboard
|
||||
text: config.TranslateVirtualKeyboardButtonOn || "Virtual Keyboard (on)"
|
||||
color: config.HoverVirtualKeyboardButtonTextColor
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "checked"
|
||||
when: vkb.checked
|
||||
PropertyChanges {
|
||||
target: buttonVirtualKeyboard
|
||||
text: config.TranslateVirtualKeyboardButtonOn || "Virtual Keyboard (on)"
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hovered"
|
||||
when: vkb.hovered
|
||||
PropertyChanges {
|
||||
target: buttonVirtualKeyboard
|
||||
text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)"
|
||||
color: config.HoverVirtualKeyboardButtonTextColor
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: virtualKeyboard
|
||||
source: "Components/VirtualKeyboard.qml"
|
||||
|
||||
Reference in New Issue
Block a user