@@ -12,8 +12,8 @@ Item {
13 property var screensProxy: Screens.createProxy();
13 property var screensProxy: Screens.createProxy();
15− property var lastClickedWorkspace: null
15+ property QtObject lastClickedWorkspace: null
16− property var activeWorkspace: null
16+ property QtObject activeWorkspace: null
17 onActiveWorkspaceChanged: print("********************* active workspace changed:", activeWorkspace)
17 onActiveWorkspaceChanged: print("********************* active workspace changed:", activeWorkspace)
19 signal closeSpread();
19 signal closeSpread();
@@ -23,9 +23,9 @@ Item {
23 anchors.bottom: parent.bottom
23 anchors.bottom: parent.bottom
24 anchors.horizontalCenter: parent.horizontalCenter
24 anchors.horizontalCenter: parent.horizontalCenter
25 Behavior on anchors.horizontalCenterOffset { NumberAnimation { duration: UbuntuAnimation.SlowDuration } }
25 Behavior on anchors.horizontalCenterOffset { NumberAnimation { duration: UbuntuAnimation.SlowDuration } }
26−// anchors.left: parent.left
27 spacing: units.gu(1)
26 spacing: units.gu(1)
28+ property var selectedIndex: undefined
30 Repeater {
30 Repeater {
31 model: screensProxy
31 model: screensProxy
@@ -34,13 +34,39 @@ Item {
34 height: root.height - units.gu(6)
34 height: root.height - units.gu(6)
35 width: workspaces.width
35 width: workspaces.width
37− UbuntuShape {
37+ Item {
38 id: header
38 id: header
39 anchors { left: parent.left; top: parent.top; right: parent.right }
39 anchors { left: parent.left; top: parent.top; right: parent.right }
40 height: units.gu(7)
40 height: units.gu(7)
41− backgroundColor: "white"
43+ property bool isCurrent: {
44+ // another screen is selected.
45+ if (row.selectedIndex != undefined && row.selectedIndex != index) return false;
47+ // this screen is active.
48+ if (WMScreen.active && WMScreen.isSameAs(model.screen) && WMScreen.currentWorkspace.isSameAs(activeWorkspace)) return true;
49+ if (model.screen.workspaces.indexOf(activeWorkspace) >= 0) return true;
55+ property bool isSelected: screenMA.containsMouse
56+ onIsSelectedChanged: {
58+ row.selectedIndex = Qt.binding(function() { return index; });
59+ } else if (row.selectedIndex === index) {
60+ row.selectedIndex = undefined;
66+ backgroundColor: "white"
67+ opacity: header.isCurrent || header.isSelected ? 1.0 : 0.5
44 DropArea {
70 DropArea {
45 anchors.fill: parent
71 anchors.fill: parent
46 keys: ["workspace"]
72 keys: ["workspace"]
@@ -66,23 +92,38 @@ Item {
68 text: model.screen.name
94 text: model.screen.name
69− color: "black"
95+ color: header.isCurrent || header.isSelected ? "black" : "white"
73 text: model.screen.outputTypeName
99 text: model.screen.outputTypeName
74− color: "black"
100+ color: header.isCurrent || header.isSelected ? "black" : "white"
75 fontSize: "x-small"
101 fontSize: "x-small"
79 text: screen.availableModes[screen.currentModeIndex].size.width + "x" + screen.availableModes[screen.currentModeIndex].size.height
105 text: screen.availableModes[screen.currentModeIndex].size.width + "x" + screen.availableModes[screen.currentModeIndex].size.height
80− color: "black"
106+ color: header.isCurrent || header.isSelected ? "black" : "white"
81 fontSize: "x-small"
107 fontSize: "x-small"
115+ margins: units.gu(1)
119+ source: "image://theme/select"
120+ color: header.isCurrent || header.isSelected ? "black" : "white"
121+ visible: model.screen.active
85 MouseArea {
124 MouseArea {
86 anchors.fill: parent
127 anchors.fill: parent
88 onClicked: {
129 onClicked: {