on xenial help sign in
use an opacity animation to show/hide the overlay
commit5ee50b043b2130ccdf60732a87622d502d70e1dd authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 30 Mar 2016, 17:11 (11 years ago) parentdce2835
1 file changed+22−9
qml/Stages/WindowControlsOverlay.qml+22−9
qml/Stages/WindowControlsOverlay.qml+22−9
@@ -45,24 +45,23 @@ Item {
4545 onDropped: print("Dropped")
4646 }
4747
48− Timer { // dismiss timer
48+
49+ // dismiss timer
50+ Timer {
4951 id: overlayTimer
5052 interval: 2000
5153 repeat: priv.dragging || root.resizeTarget.dragging
5254 }
5355
54− InverseMouseArea { // dismiss area
56+
57+ // dismiss area
58+ InverseMouseArea {
5559 anchors.fill: overlay
5660 onClicked: overlayTimer.stop()
5761 }
5862
59− QtObject {
60− id: priv
61− property real distanceX
62− property real distanceY
63− property bool dragging
64− }
6563
64+ // move handler
6665 MouseArea {
6766 anchors.fill: overlay
6867 visible: overlay.visible
@@ -88,12 +87,26 @@ Item {
8887 }
8988 }
9089
90+ QtObject {
91+ id: priv
92+ property real distanceX
93+ property real distanceY
94+ property bool dragging
95+ }
96+
97+
98+ // the visual overlay
9199 Item {
92100 id: overlay
93101 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
95104 enabled: visible
96105
106+ Behavior on opacity {
107+ OpacityAnimator { duration: UbuntuNumberAnimation.duration; easing: UbuntuNumberAnimation.easing }
108+ }
109+
97110 Image {
98111 source: "graphics/arrows-centre.png"
99112 width: units.gu(6)