Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Plasma
Plasma Workspace
Commits
4bbf78a2
Commit
4bbf78a2
authored
Dec 17, 2020
by
Andrey Butirsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
3 changed files
with
12 additions
and
3 deletions
+12
-3
components/keyboardlayout/keyboardlayout.cpp
components/keyboardlayout/keyboardlayout.cpp
+5
-0
components/keyboardlayout/keyboardlayout.h
components/keyboardlayout/keyboardlayout.h
+5
-0
components/workspace/KeyboardLayoutButton.qml
components/workspace/KeyboardLayoutButton.qml
+2
-3
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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