diff --git a/Components/LoginForm.qml b/Components/LoginForm.qml index cf3cca1..77c93fb 100644 --- a/Components/LoginForm.qml +++ b/Components/LoginForm.qml @@ -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 + } } diff --git a/Components/SystemButtons.qml b/Components/SystemButtons.qml index 3b98097..7ab9418 100644 --- a/Components/SystemButtons.qml +++ b/Components/SystemButtons.qml @@ -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) diff --git a/Components/VirtualKeyboardButton.qml b/Components/VirtualKeyboardButton.qml new file mode 100644 index 0000000..3f7abc9 --- /dev/null +++ b/Components/VirtualKeyboardButton.qml @@ -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 + } + } + ] + } + + + +} \ No newline at end of file diff --git a/Main.qml b/Main.qml index 59388cd..32f0e10 100644 --- a/Main.qml +++ b/Main.qml @@ -85,65 +85,6 @@ Pane { anchors.right: config.FormPosition == "right" ? parent.right : undefined 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 @@ -230,7 +171,7 @@ Pane { } ] } - + Image { id: backgroundImage