Commit 4bbf78a2 authored by Andrey Butirsky's avatar Andrey Butirsky

feat: context menu for Keyboard Layout applet

Counterpart commit with the same title is in P-D
parent 7d07c3af
......@@ -68,6 +68,11 @@ void KeyboardLayout::switchToPreviousLayout()
if (mIface) mIface->switchToPreviousLayout();
}
void KeyboardLayout::setLayout(const QString &layout)
{
if (mIface) mIface->setLayout(layout);
}
template<class T>
void KeyboardLayout::requestDBusData(QDBusPendingReply<T> pendingReply, T &out, void (KeyboardLayout::*notify)())
{
......
......@@ -18,6 +18,9 @@ class KeyboardLayout : public QObject
{
Q_OBJECT
Q_PROPERTY(QString layout
WRITE setLayout)
Q_PROPERTY(QString layoutDisplayName
MEMBER mLayoutDisplayName
NOTIFY layoutDisplayNameChanged)
......@@ -44,6 +47,8 @@ protected Q_SLOTS:
void switchToPreviousLayout();
private:
void setLayout(const QString &layout);
enum DBusData {LayoutDisplayName, LayoutLongName, Layouts};
template<class T>
......
......@@ -11,11 +11,10 @@ import org.kde.plasma.workspace.keyboardlayout 1.0
PlasmaComponents3.ToolButton {
id: kbLayoutButton
property alias layoutShortName: layout.layoutDisplayName
property alias layoutLongName: layout.layoutLongName
property alias layout: layout
readonly property bool hasMultipleKeyboardLayouts: layout.layouts.length > 1
text: layoutLongName
text: layout.layoutLongName
visible: hasMultipleKeyboardLayouts
Accessible.name: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Button to change keyboard layout", "Switch 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