mirror of
https://github.com/Keyitdev/sddm-astronaut-theme.git
synced 2026-09-24 02:22:09 +00:00
Fix: Removed useless KeyNavigation and key events. Fixed typos. Cleaned up some code.
This commit is contained in:
@@ -7,64 +7,65 @@ 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
|
||||
}
|
||||
}
|
||||
]
|
||||
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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user