@@ -19,6 +19,7 @@ import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.3
19import Ubuntu.Components 1.3
20import Ubuntu.Gestures 0.1
20import Ubuntu.Gestures 0.1
21import Unity.Application 0.1
21import Unity.Application 0.1
22+import "../Components"
23FocusScope {
24FocusScope {
@@ -26,8 +27,11 @@ FocusScope {
26 property bool altTabPressed: false
27 property bool altTabPressed: false
27 property Item workspace: null
28 property Item workspace: null
30+ readonly property alias ready: blurLayer.ready
29 readonly property alias highlightedIndex: spreadRepeater.highlightedIndex
31 readonly property alias highlightedIndex: spreadRepeater.highlightedIndex
33+ signal playFocusAnimation(int index)
31 function show() {
35 function show() {
32 spreadContainer.animateIn = true;
36 spreadContainer.animateIn = true;
33 root.state = "altTab";
37 root.state = "altTab";
@@ -91,6 +95,9 @@ FocusScope {
92 function focusSelected() {
96 function focusSelected() {
93 if (spreadRepeater.highlightedIndex != -1) {
97 if (spreadRepeater.highlightedIndex != -1) {
98+ if (spreadContainer.visible) {
99+ root.playFocusAnimation(spreadRepeater.highlightedIndex)
94 var application = ApplicationManager.get(spreadRepeater.highlightedIndex);
101 var application = ApplicationManager.get(spreadRepeater.highlightedIndex);
95 ApplicationManager.requestFocusApplication(application.appId);
102 ApplicationManager.requestFocusApplication(application.appId);
@@ -101,6 +108,31 @@ FocusScope {
101 state = ""
108 state = ""
113+ anchors.fill: parent
114+ source: root.workspace
119+ id: spreadBackground
120+ anchors.fill: parent
123+ opacity: visible ? 1 : 0
124+ Behavior on opacity {
125+ UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
131+ anchors.fill: parent
132+ visible: spreadBackground.visible
105 id: spreadContainer
137 id: spreadContainer
106 objectName: "spreadContainer"
138 objectName: "spreadContainer"
@@ -226,13 +258,20 @@ FocusScope {
226 Transition {
258 Transition {
228 to: "altTab"
260 to: "altTab"
261+ SequentialAnimation {
229− PropertyAction { target: spreadDelegate; properties: "y,height,width,angle,z,itemScale,itemScaleOriginY,visible" }
263+ PropertyAction { target: spreadDelegate; properties: "y,height,width,angle,z,itemScale,itemScaleOriginY,visible" }
230− PropertyAction { target: clippedSpreadDelegate; properties: "anchors.topMargin" }
264+ PropertyAction { target: clippedSpreadDelegate; properties: "anchors.topMargin" }
231− PropertyAnimation {
265+ PropertyAnimation {
232− target: spreadDelegate; properties: "x"
266+ target: spreadDelegate; properties: "x"
233− from: root.width
267+ from: root.width
234− duration: spreadContainer.animateIn ? UbuntuAnimation.FastDuration :0
268+ duration: spreadContainer.animateIn ? UbuntuAnimation.FastDuration :0
235− easing: UbuntuAnimation.StandardEasing
269+ easing: UbuntuAnimation.StandardEasing
271+ UbuntuNumberAnimation { target: clippedSpreadDelegate; property: "shadowOpacity"; from: 0; to: spreadMaths.shadowOpacity; duration: spreadContainer.animateIn ? UbuntuAnimation.FastDuration : 0 }
272+ UbuntuNumberAnimation { target: tileInfo; property: "opacity"; from: 0; to: spreadMaths.tileInfoOpacity; duration: spreadContainer.animateIn ? UbuntuAnimation.FastDuration : 0 }
274+ PropertyAction { target: spreadSelectArea; property: "enabled" }
@@ -262,12 +301,20 @@ FocusScope {
262 anchors { left: parent.left; top: parent.top; right: parent.right }
301 anchors { left: parent.left; top: parent.top; right: parent.right }
263 spacing: units.gu(1)
302 spacing: units.gu(1)
265− UbuntuShape {
304+ UbuntuShapeForItem {
266 Layout.preferredHeight: Math.min(units.gu(6), root.height * .05)
305 Layout.preferredHeight: Math.min(units.gu(6), root.height * .05)
267 Layout.preferredWidth: height * 8 / 7.6
306 Layout.preferredWidth: height * 8 / 7.6
268 image: Image {
307 image: Image {
269 anchors.fill: parent
308 anchors.fill: parent
270 source: model.icon
309 source: model.icon
311+ anchors.fill: parent
313+ opacity: clippedSpreadDelegate.highlightShown ? 0 : .1
314+ Behavior on opacity {
315+ UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
@@ -420,7 +467,7 @@ FocusScope {
421 property var source: ShaderEffectSource {
468 property var source: ShaderEffectSource {
422 id: shaderEffectSource
469 id: shaderEffectSource
423− sourceItem: appContainer
470+ sourceItem: root.workspace
426 fragmentShader: "
473 fragmentShader: "
@@ -494,20 +541,17 @@ FocusScope {
494 from: "*"
541 from: "*"
495 to: "altTab"
542 to: "altTab"
496 SequentialAnimation {
543 SequentialAnimation {
497− PropertyAction { target: hoverMouseArea; property: "progressiveScrollingEnabled"; value: false }
498 PropertyAction { target: spreadRepeater; property: "highlightedIndex"; value: Math.min(ApplicationManager.count - 1, 1) }
544 PropertyAction { target: spreadRepeater; property: "highlightedIndex"; value: Math.min(ApplicationManager.count - 1, 1) }
499− PauseAnimation { duration: 140 }
545+ PauseAnimation { duration: spreadContainer.animateIn ? 0 : 140 }
500 PropertyAction { target: workspaceSelector; property: "visible" }
546 PropertyAction { target: workspaceSelector; property: "visible" }
501 PropertyAction { target: spreadContainer; property: "visible" }
547 PropertyAction { target: spreadContainer; property: "visible" }
502 ParallelAnimation {
548 ParallelAnimation {
503− UbuntuNumberAnimation {
504− target: blurLayer; properties: "saturation,blurRadius";
549+ UbuntuNumberAnimation { target: blurLayer; properties: "saturation,blurRadius"; duration: UbuntuAnimation.SnapDuration }
505− duration: spreadContainer.animateIn ? UbuntuAnimation.FastDuration : 0
507 PropertyAction { target: spreadFlickable; property: "visible" }
550 PropertyAction { target: spreadFlickable; property: "visible" }
508 PropertyAction { targets: [currentSelectedLabel,spreadBackground]; property: "visible" }
551 PropertyAction { targets: [currentSelectedLabel,spreadBackground]; property: "visible" }
509 PropertyAction { target: spreadFlickable; property: "contentX"; value: 0 }
552 PropertyAction { target: spreadFlickable; property: "contentX"; value: 0 }
554+ PropertyAction { target: hoverMouseArea; properties: "enabled,progressiveScrollingEnabled"; value: false }
513 Transition {
557 Transition {
@@ -518,6 +562,5 @@ FocusScope {
518 PropertyAction { target: spreadRepeater; property: "highlightedIndex"; value: -1 }
562 PropertyAction { target: spreadRepeater; property: "highlightedIndex"; value: -1 }
519 PropertyAction { target: spreadContainer; property: "animateIn"; value: false }
563 PropertyAction { target: spreadContainer; property: "animateIn"; value: false }