Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
4bbf78a2
Commit
4bbf78a2
authored
Dec 17, 2020
by
Andrey Butirsky
Browse files
feat: context menu for Keyboard Layout applet
Counterpart commit with the same title is in P-D
parent
7d07c3af
Changes
3
Hide whitespace changes
Inline
Side-by-side
components/keyboardlayout/keyboardlayout.cpp
View file @
4bbf78a2
...
...
@@ -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
)())
{
...
...
components/keyboardlayout/keyboardlayout.h
View file @
4bbf78a2
...
...
@@ -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
>
...
...
components/workspace/KeyboardLayoutButton.qml
View file @
4bbf78a2
...
...
@@ -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
"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment