@@ -1,212 +0,0 @@
2−import Ubuntu.Components 1.3
3−import Unity.Screens 0.1
4−import Unity.Application 0.1
10− // Set the height. this preview will then automatically adjust the width, keeping aspect ratio of the screen
11− width: model.geometry.width * previewScale * 4
13− property string background
15− property int screenWidth: model.geometry.width
16− property int screenHeight: model.geometry.height
17− property real previewScale: (previewSpace.height - header.height) / previewSpace.screenHeight
21− anchors { left: parent.left; top: parent.top; right: parent.right }
26− anchors.margins: units.gu(1)
34− text: model.outputType === Screens.LVDS ? "Built-in" : "Clone"
40− text: model.geometry.width + "x" + model.geometry.height
50− anchors.topMargin: header.height
54− id: workspaceRepeater
58− x: index * previewSpace.screenWidth * previewScale
59− height: previewSpace.screenHeight * previewScale
60− width: previewSpace.screenWidth * previewScale
64− source: previewSpace.background
68− // id: topLevelSurfaceRepeater
69− // model: visible ? topLevelSurfaceList : null
70− // delegate: Rectangle {
71− // width: surfaceItem.width
72− // height: surfaceItem.height + decorationHeight * previewScale
73− // x: model.window.position.x * previewScale
74− // y: (model.window.position.y - decorationHeight) * previewScale
76− // z: topLevelSurfaceRepeater.count - index
78− // property int decorationHeight: units.gu(3)
80− // WindowDecoration {
81− // width: surfaceItem.implicitWidth
82− // height: parent.decorationHeight
83− // transform: Scale {
86− // xScale: previewScale
87− // yScale: previewScale
89− // title: model.window && model.window.surface ? model.window.surface.name : ""
95− // y: parent.decorationHeight * previewScale
96− // width: implicitWidth * previewScale
97− // height: implicitHeight * previewScale
100− // onImplicitHeightChanged: print("item", surfaceItem, "height changed", implicitHeight)
101− // surface: model.window.surface
111−// anchors.centerIn: parent
112−// anchors.verticalCenterOffset: header.height / 2
113−// width: units.gu(8)
115−// hoverEnabled: true
116−// opacity: containsMouse ? 1 : 0
119−// anchors.fill: parent
120−// color: "#80000000"
121−// radius: height / 2
126−// property: "progress"
128−// running: mouseArea.containsMouse
135−// height: parent.height
137−// anchors.centerIn: parent
139−// property real progress: 0.5
140−// property int lineWidth: units.dp(4)
141−// onProgressChanged: {
143−// if (progress == 1) {
144−// Screens.activateScreen(index);
151−// var ctx = canvas.getContext("2d");
155−// ctx.lineWidth = lineWidth;
157−// ctx.strokeStyle = "#3bffffff"
159−// ctx.arc(canvas.width/2,canvas.height/2, (canvas.height - ctx.lineWidth) / 2, 0, (Math.PI*2),false);
163−// ctx.strokeStyle = "white"
165−// ctx.arc(canvas.width/2,canvas.height/2, (canvas.height - ctx.lineWidth) / 2, 0, (Math.PI*2*(progress)),false);
174−// source: "graphics/multi-monitor_leave.png"
175−// height: units.gu(4)
177−// anchors.centerIn: parent
184− anchors.fill: parent
185− contentWidth: workspaceRepeater.count * previewSpace.screenWidth * previewScale
186− property real progress: contentX / contentWidth
187− onContentXChanged: print("contentX:", contentX, "progress:", progress)
191− anchors.fill: parent
193− property int scrollAreaWidth: width / 3
196− var margins = flickable.width * 0.05;
198− // do we need to scroll?
199− if (mouseX < scrollAreaWidth + margins) {
200− var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
201− var contentX = (1 - progress) * (flickable.contentWidth - flickable.width)
202− flickable.contentX = Math.max(0, Math.min(flickable.contentX, contentX))
204− if (mouseX > flickable.width - scrollAreaWidth) {
205− var progress = Math.min(1, (mouseX - (flickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
206− var contentX = progress * (flickable.contentWidth - flickable.width)
207− flickable.contentX = Math.min(flickable.contentWidth - flickable.width, Math.max(flickable.contentX, contentX))