[applets/systemtray] 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: !1796 (merged)
Also there's a little fix for PlasmaCore.Units.devicePixelRatio
.