Verified Commit 335ee5ba authored by ivan tkachenko's avatar ivan tkachenko
Browse files

[applet/{analog,digital}-clock] 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.

See also: 79bcefdd
FIXED-IN: 5.24.7 5.25.4 5.26
parent 950a7db4
......@@ -74,7 +74,11 @@ Item {
MouseArea {
anchors.fill: parent
onClicked: Plasmoid.expanded = !Plasmoid.expanded
property bool wasExpanded
onPressed: wasExpanded = Plasmoid.expanded
onClicked: Plasmoid.expanded = !wasExpanded
}
......
......@@ -436,10 +436,11 @@ Item {
MouseArea {
anchors.fill: parent
property bool wasExpanded
property int wheelDelta: 0
onClicked: Plasmoid.expanded = !Plasmoid.expanded
onPressed: wasExpanded = Plasmoid.expanded
onClicked: Plasmoid.expanded = !wasExpanded
onWheel: {
if (!Plasmoid.configuration.wheelChangesTimezone) {
return;
......
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