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
Bluedevil
Commits
b62be918
Commit
b62be918
authored
Jan 11, 2022
by
Nate Graham
Browse files
applet: Toggle Bluetooth status on middle-click
BUG: 427816
FIXED-IN: 5.24
parent
8649e05e
Pipeline
#123032
passed with stage
in 50 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/applet/package/contents/ui/BluetoothApplet.qml
View file @
b62be918
...
...
@@ -30,6 +30,17 @@ Item {
Plasmoid.compactRepresentation
:
CompactRepresentation
{
}
Plasmoid.fullRepresentation
:
FullRepresentation
{
}
function
toggleBluetooth
()
{
var
enable
=
!
btManager
.
bluetoothOperational
;
btManager
.
bluetoothBlocked
=
!
enable
;
for
(
var
i
=
0
;
i
<
btManager
.
adapters
.
length
;
++
i
)
{
var
adapter
=
btManager
.
adapters
[
i
];
adapter
.
powered
=
enable
;
}
}
function
action_configure
()
{
KCMShell
.
openSystemSettings
(
"
kcm_bluetooth
"
);
}
...
...
src/applet/package/contents/ui/CompactRepresentation.qml
View file @
b62be918
...
...
@@ -19,7 +19,15 @@ MouseArea {
Layout.maximumWidth
:
inPanel
?
PlasmaCore
.
Units
.
iconSizeHints
.
panel
:
-
1
Layout.maximumHeight
:
inPanel
?
PlasmaCore
.
Units
.
iconSizeHints
.
panel
:
-
1
onClicked
:
plasmoid
.
expanded
=
!
plasmoid
.
expanded
acceptedButtons
:
Qt
.
LeftButton
|
Qt
.
MiddleButton
onClicked
:
{
if
(
mouse
.
button
===
Qt
.
MiddleButton
)
{
toggleBluetooth
();
}
else
{
plasmoid
.
expanded
=
!
plasmoid
.
expanded
;
}
}
hoverEnabled
:
true
...
...
src/applet/package/contents/ui/Toolbar.qml
View file @
b62be918
...
...
@@ -60,15 +60,4 @@ PlasmaExtras.PlasmoidHeading {
Accessible.name
:
plasmoid
.
action
(
"
configure
"
).
text
}
}
function
toggleBluetooth
()
{
var
enable
=
!
btManager
.
bluetoothOperational
;
btManager
.
bluetoothBlocked
=
!
enable
;
for
(
var
i
=
0
;
i
<
btManager
.
adapters
.
length
;
++
i
)
{
var
adapter
=
btManager
.
adapters
[
i
];
adapter
.
powered
=
enable
;
}
}
}
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