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
bc0b0adb
Commit
bc0b0adb
authored
Nov 25, 2020
by
Andrey Butirsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Keyboard Layout applet: switch layout by mouse wheel
In parity with legacy layout Widget FEATURE: CCBUG: 390079
parent
48a08838
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
0 deletions
+20
-0
components/keyboardlayout/keyboardlayout.cpp
components/keyboardlayout/keyboardlayout.cpp
+5
-0
components/keyboardlayout/keyboardlayout.h
components/keyboardlayout/keyboardlayout.h
+1
-0
components/keyboardlayout/org.kde.KeyboardLayouts.xml
components/keyboardlayout/org.kde.KeyboardLayouts.xml
+2
-0
components/workspace/KeyboardLayoutButton.qml
components/workspace/KeyboardLayoutButton.qml
+12
-0
No files found.
components/keyboardlayout/keyboardlayout.cpp
View file @
bc0b0adb
...
...
@@ -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
)())
{
...
...
components/keyboardlayout/keyboardlayout.h
View file @
bc0b0adb
...
...
@@ -41,6 +41,7 @@ Q_SIGNALS:
protected
Q_SLOTS
:
void
switchToNextLayout
();
void
switchToPreviousLayout
();
private:
enum
DBusData
{
LayoutDisplayName
,
LayoutLongName
,
Layouts
};
...
...
components/keyboardlayout/org.kde.KeyboardLayouts.xml
View file @
bc0b0adb
...
...
@@ -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"
/>
...
...
components/workspace/KeyboardLayoutButton.qml
View file @
bc0b0adb
...
...
@@ -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
}
...
...
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