@@ -63,7 +63,7 @@ Item {
6363 anchors.fill: parent
6464 anchors.leftMargin: -itemWidth
6565 anchors.rightMargin: -itemWidth
66−// interactive: false
66+ boundsBehavior: Flickable.StopAtBounds
6767
6868 orientation: ListView.Horizontal
6969 spacing: units.gu(1)
@@ -93,6 +93,7 @@ Item {
9393 displaced: Transition { UbuntuNumberAnimation { properties: "x" } }
9494
9595 delegate: Item {
96+ id: workspaceDelegate
9697 objectName: "delegate" + index
9798 height: parent.height
9899 width: listView.itemWidth
@@ -173,7 +174,7 @@ Item {
173174 Rotation {
174175 angle: itemAngle
175176 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 }
177178 },
178179 Translate {
179180 x: itemOffset
@@ -186,18 +187,49 @@ Item {
186187 background: root.background
187188 screenHeight: root.screen.physicalSize.height
188189 containsDrag: listView.hoveredWorkspaceIndex == index
190+ }
191+ MouseArea {
192+ anchors.fill: parent
193+ onClicked: {
194+ screenWindow.screen.currentWorkspace = model.workspace
195+ }
196+ }
197+
198+ MouseArea {
199+ id: closeMouseArea
200+ objectName: "closeMouseArea"
201+ anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 }
202+ hoverEnabled: true
203+ height: units.gu(4)
204+ width: height
205+
206+ onClicked: {
207+ model.workspace.unassign();
208+ root.commitScreenSetup();
209+ }
210+ Image {
211+ id: closeImage
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 } }
189226
190− Label {
191− anchors.centerIn: parent
192− text: model.text
193− color: "red"
194− fontSize: "large"
195227 }
196228 }
197229 }
198230
199231 MouseArea {
200− id: mouseArea
232+ id: hoverMouseArea
201233 anchors.fill: parent
202234 hoverEnabled: true
203235 propagateComposedEvents: true
@@ -262,10 +294,6 @@ Item {
262294 drag.target = fakeDragItem;
263295 }
264296
265− onClicked: {
266− screenWindow.screen.currentWorkspace = fakeDragItem.workspace
267− }
268−
269297 WorkspacePreview {
270298 id: fakeDragItem
271299 height: listView.height
@@ -274,7 +302,7 @@ Item {
274302 screenHeight: root.screen.physicalSize.height
275303 visible: Drag.active
276304
277− Drag.active: mouseArea.drag.active
305+ Drag.active: hoverMouseArea.drag.active
278306 Drag.keys: ['workspace']
279307
280308 property var workspace