mirror of
https://github.com/Keyitdev/sddm-astronaut-theme.git
synced 2026-09-24 02:22:09 +00:00
Fix: Fixed virtual keyboard.
This commit is contained in:
@@ -13,9 +13,6 @@ ColumnLayout {
|
||||
|
||||
property int p: config.ScreenPadding
|
||||
property string a: config.FormPosition
|
||||
property alias systemButtonVisibility: systemButtons.visible
|
||||
property alias clockVisibility: clock.visible
|
||||
property bool virtualKeyboardActive
|
||||
|
||||
Clock {
|
||||
id: clock
|
||||
@@ -30,7 +27,7 @@ ColumnLayout {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.preferredHeight: root.height / 10
|
||||
Layout.leftMargin: p != "0" ? a == "left" ? -p : a == "right" ? p : 0 : 0
|
||||
Layout.topMargin: virtualKeyboardActive ? -height * 1.5 : 0
|
||||
Layout.topMargin: 0
|
||||
}
|
||||
|
||||
SystemButtons {
|
||||
|
||||
@@ -81,25 +81,35 @@ Pane {
|
||||
LoginForm {
|
||||
id: form
|
||||
|
||||
height: virtualKeyboard.state == "visible" ? parent.height - virtualKeyboard.implicitHeight : parent.height
|
||||
height: 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
|
||||
checkable: true
|
||||
onClicked: virtualKeyboard.switchState()
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
toggle();
|
||||
virtualKeyboard.switchState();
|
||||
}
|
||||
Keys.onEnterPressed: {
|
||||
toggle();
|
||||
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"
|
||||
id: buttonVirtualKeyboard
|
||||
text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)"
|
||||
color: parent.visualFocus ? palette.highlight : palette.text
|
||||
font.pointSize: root.font.pointSize * 0.8
|
||||
}
|
||||
@@ -107,6 +117,16 @@ Pane {
|
||||
id: vkbbg
|
||||
color: "transparent"
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "checked"
|
||||
when: vkb.checked
|
||||
PropertyChanges {
|
||||
target: buttonVirtualKeyboard
|
||||
text: config.TranslateVirtualKeyboardButtonOn || "Virtual Keyboard (on)"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Loader {
|
||||
@@ -114,18 +134,14 @@ Pane {
|
||||
source: "Components/VirtualKeyboard.qml"
|
||||
state: "hidden"
|
||||
property bool keyboardActive: item ? item.active : false
|
||||
onKeyboardActiveChanged: keyboardActive ? state = "visible" : state = "hidden"
|
||||
width: parent.width
|
||||
// x * 0.4 = x / 2.5
|
||||
width: config.KeyboardSize == "" ? parent.width * 0.4 : parent.width * config.KeyboardSize
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
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
|
||||
@@ -186,6 +202,7 @@ Pane {
|
||||
}
|
||||
ScriptAction {
|
||||
script: {
|
||||
virtualKeyboard.item.activated = false;
|
||||
Qt.inputMethod.hide();
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 791 KiB |
@@ -17,8 +17,17 @@ Here are some examples:
|
||||
|
||||
### Dependencies
|
||||
|
||||
#### Arch, Void
|
||||
```sh
|
||||
qt6-declarative qt6-svg sddm
|
||||
sddm qt6-svg
|
||||
```
|
||||
#### Fedora
|
||||
```sh
|
||||
sddm qt6-qtsvg
|
||||
```
|
||||
#### OpenSUSE
|
||||
```sh
|
||||
sddm-qt6 qt6-svg
|
||||
```
|
||||
|
||||
### Install
|
||||
@@ -37,6 +46,24 @@ qt6-declarative qt6-svg sddm
|
||||
Current=sddm-astronaut-theme" | sudo tee /etc/sddm.conf
|
||||
```
|
||||
|
||||
|
||||
### Virtual keyboard
|
||||
|
||||

|
||||
|
||||
#### Arch
|
||||
1. Install package.
|
||||
```sh
|
||||
sddm qt6-virtualkeyboard
|
||||
```
|
||||
|
||||
2. Then edit `/etc/sddm.conf.d/virtualkbd.conf`, so that it looks like this:
|
||||
|
||||
```sh
|
||||
[General]
|
||||
InputMethod=qtvirtualkeyboard
|
||||
```
|
||||
|
||||
### Credits
|
||||
|
||||
Based on the theme [`Sugar Dark for SDDM`](https://github.com/MarianArlt/sddm-sugar-dark) by **MarianArlt**.
|
||||
|
||||
+4
-1
@@ -78,6 +78,8 @@ FontSize=""
|
||||
HideLoginButton="true"
|
||||
## Hides login button if set to true.
|
||||
|
||||
KeyboardSize=""
|
||||
## Default 0.4.
|
||||
|
||||
## [Interface Behavior]
|
||||
|
||||
@@ -136,5 +138,6 @@ TranslateSuspend=""
|
||||
TranslateHibernate=""
|
||||
TranslateReboot=""
|
||||
TranslateShutdown=""
|
||||
TranslateVirtualKeyboardButton=""
|
||||
TranslateVirtualKeyboardButtonOn=""
|
||||
TranslateVirtualKeyboardButtonOff=""
|
||||
## These don't necessarily need to translate anything. You can enter whatever you want here.
|
||||
|
||||
Reference in New Issue
Block a user