@@ -41,6 +41,8 @@ MouseArea {
4141 property real distanceX
4242 property real distanceY
4343 property bool dragging
44+
45+ readonly property bool overlayShown: TouchControlsState.overlayShown && target && target.surface === TouchControlsState.surface
4446 }
4547
4648 onPressedChanged: {
@@ -74,11 +76,15 @@ MouseArea {
7476 Row {
7577 anchors {
7678 fill: parent
77− leftMargin: TouchControlsState.overlayShown ? units.gu(5) : units.gu(1)
79+ leftMargin: priv.overlayShown ? units.gu(5) : units.gu(1)
7880 rightMargin: units.gu(1)
7981 topMargin: units.gu(0.5)
8082 bottomMargin: units.gu(0.5)
8183 }
84+ Behavior on anchors.leftMargin {
85+ UbuntuNumberAnimation {}
86+ }
87+
8288 spacing: units.gu(3)
8389
8490 WindowControlButtons {
@@ -86,6 +92,7 @@ MouseArea {
8692 height: parent.height
8793 active: root.active
8894 closeButtonShown: root.target.application.appId !== "unity8-dash"
95+ target: root.target
8996 onClose: root.close();
9097 onMinimize: root.minimize();
9198 onMaximize: root.maximize();
@@ -101,7 +108,7 @@ MouseArea {
101108 fontSize: "medium"
102109 font.weight: root.active ? Font.Light : Font.Medium
103110 elide: Text.ElideRight
104− opacity: TouchControlsState.overlayShown ? 0 : 1
111+ opacity: priv.overlayShown ? 0 : 1
105112 visible: opacity == 1
106113 Behavior on opacity {
107114 OpacityAnimator { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }