Commit 6b673cfd authored by Andrey Butirsky's avatar Andrey Butirsky

feat: context menu for Keyboard Layout applet

It's in parity with legacy widget.
Flags in the menu are not supported yet.

Counterpart commit with the same title is in P-W

FEATURE:
CCBUG: 390079
parent 772cb33f
......@@ -3,13 +3,14 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick 2.12
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.workspace.components 2.0
KeyboardLayoutButton {
text: layoutShortName
Plasmoid.toolTipSubText: layoutLongName
text: layout.layoutDisplayName
Plasmoid.toolTipSubText: layout.layoutLongName
// TODO: add flag support
icon.name: ""
......@@ -17,6 +18,24 @@ KeyboardLayoutButton {
Plasmoid.status: hasMultipleKeyboardLayouts ? PlasmaCore.Types.ActiveStatus : PlasmaCore.Types.HiddenStatus
Connections {
target: layout
function onLayoutsChanged() {
plasmoid.clearActions()
layout.layouts.forEach(
function(layoutID) {
plasmoid.setAction(layoutID, layoutID)
}
)
}
}
function actionTriggered(selectedLayout) {
Plasmoid.activated()
layout.layout = selectedLayout
}
// to fit at least 2 letters in systray
leftPadding: 0
rightPadding: 0
......
Markdown is supported
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