Encountered the following problem with rendering in QML. I have implemented the 'minimize' button on the frameless window:

Qt Code:
  1. Image {
  2. source: "minimize.png"
  3. scale: mouse.pressed ? 0.8 : 1.0
  4. smooth: mouse.pressed
  5.  
  6. MouseArea {
  7. id: mouse
  8. anchors.fill: parent
  9. anchors.margins: -5
  10. onClicked: {
  11. console.log("MinimizeButton clicked");
  12. viewer.showMinimized();
  13. }
  14. }
  15. }
To copy to clipboard, switch view to plain text mode 

where 'viewer' is the object inherited from QDeclarativeView which represents the main application window. The button shrinks when user clicks the mouse onto it and window has been minimized. But button stays shrinked when window is restored. Tried to add the timer which prints 'mouse.pressed' every 1 sec:

Qt Code:
  1. Timer {
  2. repeat: true
  3. interval: 1000
  4. running: true
  5. onTriggered: {
  6. console.log("mouse.pressed =",mouse.pressed);
  7. }
  8. }
To copy to clipboard, switch view to plain text mode 

It always prints mouse not pressed. But button is scaled to 0.8, not 1.0. "viewer.showMinimized()" appears to be guilty: button is rendered OK if it is commented out.

Any suggestions to solve the problem?