mirror of
https://github.com/Keyitdev/sddm-astronaut-theme.git
synced 2026-09-24 02:22:09 +00:00
81 lines
2.6 KiB
QML
81 lines
2.6 KiB
QML
// Config created by Keyitdev https://github.com/Keyitdev/sddm-astronaut-theme
|
|
// Copyright (C) 2022-2026 Keyitdev
|
|
// Distributed under the GPLv3+ License https://www.gnu.org/licenses/gpl-3.0.html
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls
|
|
|
|
Item {
|
|
id: virtualKeyboardButtonRoot
|
|
|
|
height: virtualKeyboardButton.height
|
|
width: parent.width / 2
|
|
|
|
Button {
|
|
id: virtualKeyboardButton
|
|
height: rootHeightUnit
|
|
width: parent.width
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
z: 1
|
|
|
|
visible: virtualKeyboard.status == Loader.Ready && config.ShowVirtualKeyboard == "true"
|
|
checkable: true
|
|
onClicked: virtualKeyboard.switchState()
|
|
|
|
Keys.onReturnPressed: {
|
|
toggle();
|
|
virtualKeyboard.switchState();
|
|
}
|
|
Keys.onEnterPressed: {
|
|
toggle();
|
|
virtualKeyboard.switchState();
|
|
}
|
|
|
|
contentItem: Text {
|
|
id: virtualKeyboardButtonText
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
text: config.TranslateVirtualKeyboardButtonOff || "Virtual Keyboard (off)"
|
|
font.pixelSize: rootFontSize * 1.06
|
|
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
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|