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
bc0b0adb
Commit
bc0b0adb
authored
Nov 25, 2020
by
Andrey Butirsky
Browse files
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
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
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