[applets/notes] 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.
todo: this idiom needs to be documented at Plasmoid.expanded
property's documentation