@@ -25,10 +25,104 @@ UbuntuShape {
26 backgroundColor: "#F2111111"
26 backgroundColor: "#F2111111"
27 width: screensRow.childrenRect.width + units.gu(4)
27 width: screensRow.childrenRect.width + units.gu(4)
28+ opacity: d.shown ? 1 : 0
30+ Behavior on opacity { UbuntuNumberAnimation {} }
29 property var screensProxy: Screens.createProxy();
32 property var screensProxy: Screens.createProxy();
30 property string background
33 property string background
35+ readonly property alias active: d.active
37+ function showLeft() {
39+ d.decreaseHighlight();
41+ function showRight() {
43+ d.increaseHighlight();
49+ d.ctrlPressed = true;
54+ d.highlightedScreenIndex = screensProxy.activeScreen;
55+ var activeScreen = screensProxy.get(screensProxy.activeScreen);
56+ d.highlightedWorkspaceIndex = activeScreen.workspaces.indexOf(activeScreen.currentWorkspace)
62+ property bool active: false
63+ property bool shown: false
64+ property bool altPressed: false
65+ property bool ctrlPressed: false
67+ property int highlightedScreenIndex: -1
68+ property int highlightedWorkspaceIndex: -1
70+ function increaseHighlight() {
71+ var screen = screensProxy.get(highlightedScreenIndex);
72+ highlightedWorkspaceIndex++
73+ if (highlightedWorkspaceIndex >= screen.workspaces.count) {
74+ highlightedScreenIndex = (highlightedScreenIndex + 1) % screensProxy.count;
75+ highlightedWorkspaceIndex = 0;
78+ function decreaseHighlight() {
79+ highlightedWorkspaceIndex--;
80+ if (highlightedWorkspaceIndex < 0) {
81+ highlightedScreenIndex--;
82+ if (highlightedScreenIndex < 0) {
83+ highlightedScreenIndex = screensProxy.count - 1
85+ var screen = screensProxy.get(highlightedScreenIndex);
86+ highlightedWorkspaceIndex = screen.workspaces.count -1;
94+ onTriggered: d.shown = false;
101+ d.decreaseHighlight();
104+ d.increaseHighlight();
109+ switch (event.key) {
111+ d.altPressed = false;
113+ case Qt.Key_Control:
114+ d.ctrlPressed = false;
117+ if (!d.altPressed && !d.ctrlPressed) {
118+ print("starting hidetimer")
122+ screensProxy.get(d.highlightedScreenIndex).workspaces.get(d.highlightedWorkspaceIndex).activate();
33 id: screensRow
127 id: screensRow
34 anchors {
128 anchors {
@@ -75,6 +169,7 @@ UbuntuShape {
75 anchors.horizontalCenter: parent.horizontalCenter
169 anchors.horizontalCenter: parent.horizontalCenter
76 screen: model.screen
170 screen: model.screen
77 background: root.background
171 background: root.background
172+ selectedIndex: d.highlightedScreenIndex == index ? d.highlightedWorkspaceIndex : -1
79 workspaceModel: model.screen.workspaces
174 workspaceModel: model.screen.workspaces