@@ -63,7 +63,7 @@ Item {
63 anchors.fill: parent
63 anchors.fill: parent
64 anchors.leftMargin: -itemWidth
64 anchors.leftMargin: -itemWidth
65 anchors.rightMargin: -itemWidth
65 anchors.rightMargin: -itemWidth
66−// interactive: false
66+ boundsBehavior: Flickable.StopAtBounds
68 orientation: ListView.Horizontal
68 orientation: ListView.Horizontal
69 spacing: units.gu(1)
69 spacing: units.gu(1)
@@ -93,6 +93,7 @@ Item {
93 displaced: Transition { UbuntuNumberAnimation { properties: "x" } }
93 displaced: Transition { UbuntuNumberAnimation { properties: "x" } }
95 delegate: Item {
95 delegate: Item {
96+ id: workspaceDelegate
96 objectName: "delegate" + index
97 objectName: "delegate" + index
97 height: parent.height
98 height: parent.height
98 width: listView.itemWidth
99 width: listView.itemWidth
@@ -173,7 +174,7 @@ Item {
173 Rotation {
174 Rotation {
174 angle: itemAngle
175 angle: itemAngle
175 axis { x: 0; y: 1; z: 0 }
176 axis { x: 0; y: 1; z: 0 }
176− origin { x: listView.itemWidth / 2; y: height / 2 }
177+ origin { x: itemAngle < 0 ? listView.itemWidth : 0; y: height / 2 }
178 Translate {
179 Translate {
179 x: itemOffset
180 x: itemOffset
@@ -186,18 +187,49 @@ Item {
186 background: root.background
187 background: root.background
187 screenHeight: root.screen.physicalSize.height
188 screenHeight: root.screen.physicalSize.height
188 containsDrag: listView.hoveredWorkspaceIndex == index
189 containsDrag: listView.hoveredWorkspaceIndex == index
192+ anchors.fill: parent
194+ screenWindow.screen.currentWorkspace = model.workspace
200+ objectName: "closeMouseArea"
201+ anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 }
207+ model.workspace.unassign();
208+ root.commitScreenSetup();
212+ source: "../graphics/window-close.svg"
213+ anchors.fill: closeMouseArea
214+ anchors.margins: units.gu(1)
215+ sourceSize.width: width
216+ sourceSize.height: height
217+ readonly property var mousePos: hoverMouseArea.mapToItem(workspaceDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
218+ readonly property bool shown: (hoverMouseArea.containsMouse || parent.containsMouse)
219+ && mousePos.y < workspaceDelegate.width / 4
220+ && mousePos.y > -units.gu(2)
221+ && mousePos.x > -units.gu(2)
222+ && mousePos.x < workspaceDelegate.height / 4
223+ opacity: shown ? 1 : 0
224+ visible: opacity > 0
225+ Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
191− anchors.centerIn: parent
199 MouseArea {
231 MouseArea {
200− id: mouseArea
232+ id: hoverMouseArea
201 anchors.fill: parent
233 anchors.fill: parent
202 hoverEnabled: true
234 hoverEnabled: true
203 propagateComposedEvents: true
235 propagateComposedEvents: true
@@ -262,10 +294,6 @@ Item {
262 drag.target = fakeDragItem;
294 drag.target = fakeDragItem;
266− screenWindow.screen.currentWorkspace = fakeDragItem.workspace
269 WorkspacePreview {
297 WorkspacePreview {
270 id: fakeDragItem
298 id: fakeDragItem
271 height: listView.height
299 height: listView.height
@@ -274,7 +302,7 @@ Item {
274 screenHeight: root.screen.physicalSize.height
302 screenHeight: root.screen.physicalSize.height
275 visible: Drag.active
303 visible: Drag.active
277− Drag.active: mouseArea.drag.active
305+ Drag.active: hoverMouseArea.drag.active
278 Drag.keys: ['workspace']
306 Drag.keys: ['workspace']
280 property var workspace
308 property var workspace