Commit d6c1a0fc authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

applets/manage-inputmethod: add `Plasmoid.onActivated`

This adds support for keyboard navigation.
parent 7a1c4067
......@@ -19,24 +19,37 @@ Item {
id: root
property var overlays: []
Plasmoid.onActivated: if (!Keyboards.KWinVirtualKeyboard.available) {
root.action_settings()
} else if (Keyboards.KWinVirtualKeyboard.visible) {
Keyboards.KWinVirtualKeyboard.active = false
} else {
Keyboards.KWinVirtualKeyboard.enabled = !Keyboards.KWinVirtualKeyboard.enabled
}
Plasmoid.preferredRepresentation: Plasmoid.compactRepresentation
Plasmoid.fullRepresentation: Plasmoid.compactRepresentation
Plasmoid.compactRepresentation: PlasmaCore.IconItem {
activeFocusOnTab: true
source: Plasmoid.icon
active: compactMouse.containsMouse
overlays: root.overlays
Keys.onPressed: {
switch (event.key) {
case Qt.Key_Space:
case Qt.Key_Enter:
case Qt.Key_Return:
case Qt.Key_Select:
Plasmoid.activated();
break;
}
}
MouseArea {
id: compactMouse
anchors.fill: parent
hoverEnabled: true
onClicked: if (!Keyboards.KWinVirtualKeyboard.available) {
root.action_settings()
} else if (Keyboards.KWinVirtualKeyboard.visible) {
Keyboards.KWinVirtualKeyboard.active = false
} else {
Keyboards.KWinVirtualKeyboard.enabled = !Keyboards.KWinVirtualKeyboard.enabled
}
onClicked: Plasmoid.activated()
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment