2 import Ubuntu.Components 1.3
3 import Unity.Application 0.1
4 import WindowManager 1.0
6 import "../../Components"
12 property var workspace
14 property string background
15 property int screenHeight
17 property real previewScale: previewSpace.height / previewSpace.screenHeight
19 property bool containsDragLeft: false
20 property bool containsDragRight: false
21 property bool isActive: false
22 property bool isSelected: false
25 source: previewSpace.background
27 sourceSize.width: width
28 sourceSize.height: height
31 id: topLevelSurfaceRepeater
32 model: visible ? workspace.windowModel : null
34 width: surfaceItem.width
35 height: surfaceItem.height + decorationHeight * previewScale
36 x: model.window.position.x * previewScale
37 y: (model.window.position.y - decorationHeight) * previewScale
38 z: topLevelSurfaceRepeater.count - index
39 visible: model.window.state !== Mir.MinimizedState && model.window.state !== Mir.HiddenState
41 property int decorationHeight: units.gu(3)
44 width: surfaceItem.implicitWidth
45 height: parent.decorationHeight
52 title: model.window && model.window.surface ? model.window.surface.name : ""
58 y: parent.decorationHeight * previewScale
59 width: implicitWidth * previewScale
60 height: implicitHeight * previewScale
63 surface: model.window.surface
72 border.color: UbuntuColors.ash
73 border.width: units.gu(.5)
75 visible: previewSpace.isActive
80 border.color: UbuntuColors.blue
81 border.width: units.gu(.5)
83 visible: previewSpace.isSelected
88 anchors.rightMargin: parent.width / 2
90 visible: previewSpace.containsDragLeft
93 anchors.centerIn: parent
96 source: "../graphics/multi-monitor_drop-here.png"
99 anchors.horizontalCenter: parent.horizontalCenter
102 text: qsTr("Drop here")
109 anchors.leftMargin: parent.width / 2
111 visible: previewSpace.containsDragRight
114 anchors.centerIn: parent
117 source: "../graphics/multi-monitor_leave.png"
120 anchors.horizontalCenter: parent.horizontalCenter
123 text: qsTr("Drop and go")