@@ -0,0 +1,84 @@
1+/*
2+ * Copyright (C) 2014-2016 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import "Spread"
20+import WindowManager 1.0
21+import Unity.Application 0.1
22+
23+UbuntuShape {
24+ id: root
25+
26+ backgroundColor: "#F2111111"
27+ width: screensRow.childrenRect.width + units.gu(4)
28+
29+ property var screensProxy: Screens.createProxy();
30+ property string background
31+
32+ Row {
33+ id: screensRow
34+ anchors {
35+ top: parent.top; topMargin: units.gu(2)
36+ left: parent.left; leftMargin: units.gu(2)
37+ }
38+
39+ Repeater {
40+ model: screensProxy
41+
42+ delegate: Item {
43+ height: root.height - units.gu(4)
44+ width: workspaces.width
45+
46+ UbuntuShape {
47+ id: header
48+ anchors { left: parent.left; top: parent.top; right: parent.right }
49+ height: units.gu(4)
50+ backgroundColor: "white"
51+
52+ Label {
53+ anchors { left: parent.left; top: parent.top; right: parent.right; margins: units.gu(1) }
54+ text: model.screen.name
55+ color: UbuntuColors.ash
56+ }
57+ }
58+
59+ Workspaces {
60+ id: workspaces
61+ height: parent.height - header.height - units.gu(2)
62+ width: {
63+ var width = 0;
64+ if (screensProxy.count == 1) {
65+ width = Math.min(implicitWidth, root.width - units.gu(8));
66+ } else {
67+ width = Math.min(implicitWidth, model.screen.active ? root.width - units.gu(48) : units.gu(40))
68+ }
69+ return Math.max(workspaces.minimumWidth, width);
70+ }
71+
72+ Behavior on width { UbuntuNumberAnimation {} }
73+ anchors.bottom: parent.bottom
74+ anchors.bottomMargin: units.gu(1)
75+ anchors.horizontalCenter: parent.horizontalCenter
76+ screen: model.screen
77+ background: root.background
78+
79+ workspaceModel: model.screen.workspaces
80+ }
81+ }
82+ }
83+ }
84+}