on xenial help sign in
add focus animation
commit0dff68f2fe92f6b5d077ed78a9c6da17aa7b67bd authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 15 Feb 2016, 18:05 (11 years ago) parent6cc0a40
2 files changed+22
qml/Stages/DesktopSpread.qml+5 qml/Stages/DesktopStage.qml+17
qml/Stages/DesktopSpread.qml+5
@@ -30,6 +30,8 @@ FocusScope {
3030 readonly property alias ready: blurLayer.ready
3131 readonly property alias highlightedIndex: spreadRepeater.highlightedIndex
3232
33+ signal playFocusAnimation(int index)
34+
3335 function show() {
3436 spreadContainer.animateIn = true;
3537 root.state = "altTab";
@@ -93,6 +95,9 @@ FocusScope {
9395
9496 function focusSelected() {
9597 if (spreadRepeater.highlightedIndex != -1) {
98+ if (spreadContainer.visible) {
99+ root.playFocusAnimation(spreadRepeater.highlightedIndex)
100+ }
96101 var application = ApplicationManager.get(spreadRepeater.highlightedIndex);
97102 ApplicationManager.requestFocusApplication(application.appId);
98103 }
qml/Stages/DesktopStage.qml+17
@@ -333,6 +333,19 @@ AbstractStage {
333333 ApplicationManager.focusApplication(appId);
334334 }
335335
336+ function playFocusAnimation() {
337+ focusAnimation.start()
338+ }
339+
340+ UbuntuNumberAnimation {
341+ id: focusAnimation
342+ target: appDelegate
343+ property: "scale"
344+ from: 0.98
345+ to: 1
346+ duration: UbuntuAnimation.SnapDuration
347+ }
348+
336349 states: [
337350 State {
338351 name: "fullscreen"; when: decoratedWindow.fullscreen
@@ -495,5 +508,9 @@ AbstractStage {
495508 workspace: appContainer
496509 focus: state == "altTab"
497510 altTabPressed: root.altTabPressed
511+
512+ onPlayFocusAnimation: {
513+ appRepeater.itemAt(index).playFocusAnimation();
514+ }
498515 }
499516}