@@ -44,6 +44,33 @@ AbstractStage {
47+ onAltTabPressedChanged: {
48+ if (!spreadEnabled || !altTabEnabled) {
52+ spreadView.snapToSpread();
53+ priv.highlightIndex = Math.min(spreadRepeater.count - 1, 1);
55+ spreadView.snapTo(priv.highlightIndex)
60+ focus: root.altTabPressed
65+ priv.highlightIndex = (priv.highlightIndex + 1) % spreadRepeater.count
68+ priv.highlightIndex = (priv.highlightIndex + spreadRepeater.count - 1) % spreadRepeater.count
47 // Functions to be called from outside
74 // Functions to be called from outside
48 function updateFocusedAppOrientation() {
75 function updateFocusedAppOrientation() {
49 if (spreadRepeater.count > 0) {
76 if (spreadRepeater.count > 0) {
@@ -186,6 +213,7 @@ AbstractStage {
187 property real oldInverseProgress: 0
214 property real oldInverseProgress: 0
188 property bool animateX: false
215 property bool animateX: false
216+ property int highlightIndex: 0
190 onFocusedAppDelegateChanged: {
218 onFocusedAppDelegateChanged: {
191 if (focusedAppDelegate) {
219 if (focusedAppDelegate) {
@@ -220,6 +248,10 @@ AbstractStage {
220 spreadView.phase = 0;
248 spreadView.phase = 0;
221 spreadView.contentX = -spreadView.shift;
249 spreadView.contentX = -spreadView.shift;
252+ onHighlightIndexChanged: {
253+ spreadView.contentX = highlightIndex * spreadView.contentWidth / (spreadRepeater.count + 2)
225 id: fullyShowingFocusedAppUpdateTimer
257 id: fullyShowingFocusedAppUpdateTimer
@@ -287,6 +319,11 @@ AbstractStage {
322+ Behavior on contentX {
323+ enabled: root.altTabPressed
324+ UbuntuNumberAnimation {}
290 onShiftedContentXChanged: {
327 onShiftedContentXChanged: {
291 if (root.beingResized) {
328 if (root.beingResized) {
292 // Flickabe.contentX wiggles during resizes. Don't react to it.
329 // Flickabe.contentX wiggles during resizes. Don't react to it.
@@ -325,12 +362,17 @@ AbstractStage {
325 } else if (shiftedContentX < positionMarker3 * width) {
362 } else if (shiftedContentX < positionMarker3 * width) {
326 snapTo(1);
363 snapTo(1);
327 } else if (phase < 2){
364 } else if (phase < 2){
328− // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
365+ snapToSpread();
329− snapAnimation.targetContentX = width * positionMarker4 + 1 - shift;
330− snapAnimation.start();
331 root.opened();
366 root.opened();
370+ function snapToSpread() {
371+ // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
372+ snapAnimation.targetContentX = (root.width * spreadView.positionMarker4) + 1 - spreadView.shift;
373+ snapAnimation.start();
334 function snapTo(index) {
376 function snapTo(index) {
335 if (!root.altTabEnabled) {
377 if (!root.altTabEnabled) {
336 // Reset to start instead
378 // Reset to start instead
@@ -433,6 +475,7 @@ AbstractStage {
433 maximizedAppTopMargin: root.maximizedAppTopMargin
475 maximizedAppTopMargin: root.maximizedAppTopMargin
434 dropShadow: spreadView.active || priv.focusedAppDelegateIsDislocated
476 dropShadow: spreadView.active || priv.focusedAppDelegateIsDislocated
435 focusFirstApp: root.focusFirstApp
477 focusFirstApp: root.focusFirstApp
478+ highlightShown: root.altTabPressed && index === priv.highlightIndex
437 readonly property bool isDash: model.appId == "unity8-dash"
480 readonly property bool isDash: model.appId == "unity8-dash"
@@ -665,9 +708,7 @@ AbstractStage {
665 edge: Qt.RightEdge
708 edge: Qt.RightEdge
667 onPassed: {
710 onPassed: {
668− // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
711+ spreadView.snapToSpread();
669− snapAnimation.targetContentX = (root.width * spreadView.positionMarker4) + 1 - spreadView.shift;
670− snapAnimation.start();
672 material: Component {
713 material: Component {