Verified Commit 79bcefdd authored by ivan tkachenko's avatar ivan tkachenko
Browse files

[applets/batterymonitor] Use `onPressed: wasExpanded = ...` idiom

This is a common snippet of code in applets. It prevents applet from
re-expanding again when user clicks on the compact representation when
the applet is already expanded and located on a desktop containment.
parent 16bf436f
Pipeline #184518 passed with stage
in 8 minutes and 2 seconds
......@@ -24,7 +24,10 @@ MouseArea {
hoverEnabled: true
onClicked: Plasmoid.expanded = !Plasmoid.expanded
property bool wasExpanded
onPressed: wasExpanded = Plasmoid.expanded
onClicked: Plasmoid.expanded = !wasExpanded
// "No Batteries" case
PlasmaCore.IconItem {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment