on xenial help sign in
use an opacity animation to show/hide the overlay
5ee50b0Lukáš Tinkl
qml/Stages/WindowControlsOverlay.qml+22−9
@@ -45,24 +45,23 @@ Item {
45 onDropped: print("Dropped")
45 onDropped: print("Dropped")
46 }
46 }
47
47
48+
48− Timer { // dismiss timer
49+ // dismiss timer
50+ Timer {
49 id: overlayTimer
51 id: overlayTimer
50 interval: 2000
52 interval: 2000
51 repeat: priv.dragging || root.resizeTarget.dragging
53 repeat: priv.dragging || root.resizeTarget.dragging
52 }
54 }
53
55
56+
54− InverseMouseArea { // dismiss area
57+ // dismiss area
58+ InverseMouseArea {
55 anchors.fill: overlay
59 anchors.fill: overlay
56 onClicked: overlayTimer.stop()
60 onClicked: overlayTimer.stop()
57 }
61 }
58
62
59− QtObject {
60− id: priv
61− property real distanceX
62− property real distanceY
63− property bool dragging
64− }
65
63
64+ // move handler
66 MouseArea {
65 MouseArea {
67 anchors.fill: overlay
66 anchors.fill: overlay
68 visible: overlay.visible
67 visible: overlay.visible
@@ -88,12 +87,26 @@ Item {
88 }
87 }
89 }
88 }
90
89
90+ QtObject {
91+ id: priv
92+ property real distanceX
93+ property real distanceY
94+ property bool dragging
95+ }
96+
97+
98+ // the visual overlay
91 Item {
99 Item {
92 id: overlay
100 id: overlay
93 anchors.fill: parent
101 anchors.fill: parent
94− visible: overlayTimer.running && target && !target.maximized && !target.fullscreen
102+ opacity: overlayTimer.running && target && !target.maximized && !target.fullscreen ? 1 : 0
103+ visible: opacity == 1
95 enabled: visible
104 enabled: visible
96
105
106+ Behavior on opacity {
107+ OpacityAnimator { duration: UbuntuNumberAnimation.duration; easing: UbuntuNumberAnimation.easing }
108+ }
109+
97 Image {
110 Image {
98 source: "graphics/arrows-centre.png"
111 source: "graphics/arrows-centre.png"
99 width: units.gu(6)
112 width: units.gu(6)