Commit bc0b0adb authored by Andrey Butirsky's avatar Andrey Butirsky

feat: Keyboard Layout applet: switch layout by mouse wheel

In parity with legacy layout Widget

FEATURE:
CCBUG: 390079
parent 48a08838
......@@ -63,6 +63,11 @@ void KeyboardLayout::switchToNextLayout()
if (mIface) mIface->switchToNextLayout();
}
void KeyboardLayout::switchToPreviousLayout()
{
if (mIface) mIface->switchToPreviousLayout();
}
template<class T>
void KeyboardLayout::requestDBusData(QDBusPendingReply<T> pendingReply, T &out, void (KeyboardLayout::*notify)())
{
......
......@@ -41,6 +41,7 @@ Q_SIGNALS:
protected Q_SLOTS:
void switchToNextLayout();
void switchToPreviousLayout();
private:
enum DBusData {LayoutDisplayName, LayoutLongName, Layouts};
......
......@@ -9,6 +9,8 @@
</signal>
<method name="switchToNextLayout">
</method>
<method name="switchToPreviousLayout">
</method>
<method name="setLayout">
<arg type="b" direction="out"/>
<arg name="layout" type="s" direction="in"/>
......
......@@ -23,6 +23,18 @@ PlasmaComponents3.ToolButton {
onClicked: layout.switchToNextLayout()
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
onWheel: {
if (wheel.angleDelta.y > 0) {
layout.switchToNextLayout()
} else {
layout.switchToPreviousLayout()
}
}
}
KeyboardLayout {
id: layout
}
......
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