@@ -18,8 +18,9 @@ import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19import Unity.Application 0.1
19import Unity.Application 0.1
23+ objectName: "childWindow"
24 // Set from outside.
25 // Set from outside.
25 property var surface
26 property var surface
@@ -43,6 +44,7 @@ Item {
43 readonly property bool decorated: surface ? surface.type === Mir.UtilityType
44 readonly property bool decorated: surface ? surface.type === Mir.UtilityType
44 || surface.type === Mir.DialogType
45 || surface.type === Mir.DialogType
45 || surface.type === Mir.NormalType
46 || surface.type === Mir.NormalType
47+ || surface.type === Mir.SatelliteType
48 readonly property bool moveable: decorated
50 readonly property bool moveable: decorated
@@ -100,7 +102,10 @@ Item {
100 height: units.gu(3)
102 height: units.gu(3)
101 title: root.surface ? root.surface.name : ""
103 title: root.surface ? root.surface.name : ""
102 active: root.surface ? root.surface.focused : false
104 active: root.surface ? root.surface.focused : false
103− closeButtonVisible: false
105+ closeButtonVisible: root.surface ? root.surface.type === Mir.SatelliteType
106+ || root.surface.type === Mir.NormalType
107+ || root.surface.type === Mir.UtilityType
104 minimizeButtonVisible: false
109 minimizeButtonVisible: false
105 maximizeButtonShown: false
110 maximizeButtonShown: false
106 onPressed: root.surface.activate();
111 onPressed: root.surface.activate();
@@ -109,6 +114,7 @@ Item {
109 d.moveHandler.handlePositionChanged(mouse);
114 d.moveHandler.handlePositionChanged(mouse);
111 onReleased: if (d.moveHandler) { d.moveHandler.handleReleased(); }
116 onReleased: if (d.moveHandler) { d.moveHandler.handleReleased(); }
117+ onCloseClicked: root.surface.close();
@@ -141,6 +147,8 @@ Item {
141 // TODO ChildWindow parent will probably want to control those
147 // TODO ChildWindow parent will probably want to control those
142 interactive: true
148 interactive: true
143 consumesInput: true
149 consumesInput: true