on xenial help sign in
Visual updates for the windowed spread Fixes: #1488148

Approved by: Unity8 CI Bot, Lukáš Tinkl

commit5ffa1eaa6d5d923752516e4766a23d353f2f14bc authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 10 Mar 2016, 22:37 (11 years ago) parent2584355d7dce84
6 files changed+98−44
qml/Components/EdgeBarrier.qml+1−1 qml/Launcher/Launcher.qml+2−2 qml/Stages/DesktopSpread.qml+59−16 qml/Stages/DesktopSpreadDelegate.qml+15−1 qml/Stages/DesktopStage.qml+19−23 tests/qmltests/Stages/tst_DesktopStage.qml+2−1
qml/Components/EdgeBarrier.qml+1−1
@@ -105,7 +105,7 @@ Item {
105105 },
106106 Transition {
107107 from: "resisting"; to: "passed"
108− UbuntuNumberAnimation { target: materialContainer; property: "opacity" }
108+ UbuntuNumberAnimation { duration: UbuntuAnimation.BriskDuration; target: materialContainer; property: "opacity" }
109109 }
110110 ]
111111}
qml/Launcher/Launcher.qml+2−2
@@ -329,8 +329,8 @@ FocusScope {
329329 rotation: -90
330330 anchors.centerIn: parent
331331 gradient: Gradient {
332− GradientStop { position: 0.0; color: panel.color}
333− GradientStop { position: 1.0; color: Qt.rgba(panel.r,panel.g,panel.b,0)}
332+ GradientStop { position: 0.0; color: Qt.rgba(panel.color.r, panel.color.g, panel.color.b, .5)}
333+ GradientStop { position: 1.0; color: Qt.rgba(panel.color.r,panel.color.g,panel.color.b,0)}
334334 }
335335 }
336336 }
qml/Stages/DesktopSpread.qml+59−16
@@ -19,6 +19,7 @@ import QtQuick.Layouts 1.1
1919import Ubuntu.Components 1.3
2020import Ubuntu.Gestures 0.1
2121import Unity.Application 0.1
22+import "../Components"
2223
2324FocusScope {
2425 id: root
@@ -26,8 +27,11 @@ FocusScope {
2627 property bool altTabPressed: false
2728 property Item workspace: null
2829
30+ readonly property alias ready: blurLayer.ready
2931 readonly property alias highlightedIndex: spreadRepeater.highlightedIndex
3032
33+ signal playFocusAnimation(int index)
34+
3135 function show() {
3236 spreadContainer.animateIn = true;
3337 root.state = "altTab";
@@ -91,6 +95,9 @@ FocusScope {
9195
9296 function focusSelected() {
9397 if (spreadRepeater.highlightedIndex != -1) {
98+ if (spreadContainer.visible) {
99+ root.playFocusAnimation(spreadRepeater.highlightedIndex)
100+ }
94101 var application = ApplicationManager.get(spreadRepeater.highlightedIndex);
95102 ApplicationManager.requestFocusApplication(application.appId);
96103 }
@@ -101,6 +108,31 @@ FocusScope {
101108 state = ""
102109 }
103110
111+ BlurLayer {
112+ id: blurLayer
113+ anchors.fill: parent
114+ source: root.workspace
115+ visible: false
116+ }
117+
118+ Rectangle {
119+ id: spreadBackground
120+ anchors.fill: parent
121+ color: "#B2000000"
122+ visible: false
123+ opacity: visible ? 1 : 0
124+ Behavior on opacity {
125+ UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
126+ }
127+ }
128+
129+ MouseArea {
130+ id: eventEater
131+ anchors.fill: parent
132+ visible: spreadBackground.visible
133+ enabled: visible
134+ }
135+
104136 Item {
105137 id: spreadContainer
106138 objectName: "spreadContainer"
@@ -226,13 +258,20 @@ FocusScope {
226258 Transition {
227259 from: ""
228260 to: "altTab"
229− PropertyAction { target: spreadDelegate; properties: "y,height,width,angle,z,itemScale,itemScaleOriginY,visible" }
230− PropertyAction { target: clippedSpreadDelegate; properties: "anchors.topMargin" }
231− PropertyAnimation {
232− target: spreadDelegate; properties: "x"
233− from: root.width
234− duration: spreadContainer.animateIn ? UbuntuAnimation.FastDuration :0
235− easing: UbuntuAnimation.StandardEasing
261+ SequentialAnimation {
262+ ParallelAnimation {
263+ PropertyAction { target: spreadDelegate; properties: "y,height,width,angle,z,itemScale,itemScaleOriginY,visible" }
264+ PropertyAction { target: clippedSpreadDelegate; properties: "anchors.topMargin" }
265+ PropertyAnimation {
266+ target: spreadDelegate; properties: "x"
267+ from: root.width
268+ duration: spreadContainer.animateIn ? UbuntuAnimation.FastDuration :0
269+ easing: UbuntuAnimation.StandardEasing
270+ }
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 }
273+ }
274+ PropertyAction { target: spreadSelectArea; property: "enabled" }
236275 }
237276 }
238277 ]
@@ -262,12 +301,20 @@ FocusScope {
262301 anchors { left: parent.left; top: parent.top; right: parent.right }
263302 spacing: units.gu(1)
264303
265− UbuntuShape {
304+ UbuntuShapeForItem {
266305 Layout.preferredHeight: Math.min(units.gu(6), root.height * .05)
267306 Layout.preferredWidth: height * 8 / 7.6
268307 image: Image {
269308 anchors.fill: parent
270309 source: model.icon
310+ Rectangle {
311+ anchors.fill: parent
312+ color: "black"
313+ opacity: clippedSpreadDelegate.highlightShown ? 0 : .1
314+ Behavior on opacity {
315+ UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
316+ }
317+ }
271318 }
272319 }
273320 Label {
@@ -420,7 +467,7 @@ FocusScope {
420467
421468 property var source: ShaderEffectSource {
422469 id: shaderEffectSource
423− sourceItem: appContainer
470+ sourceItem: root.workspace
424471 }
425472
426473 fragmentShader: "
@@ -494,20 +541,17 @@ FocusScope {
494541 from: "*"
495542 to: "altTab"
496543 SequentialAnimation {
497− PropertyAction { target: hoverMouseArea; property: "progressiveScrollingEnabled"; value: false }
498544 PropertyAction { target: spreadRepeater; property: "highlightedIndex"; value: Math.min(ApplicationManager.count - 1, 1) }
499− PauseAnimation { duration: 140 }
545+ PauseAnimation { duration: spreadContainer.animateIn ? 0 : 140 }
500546 PropertyAction { target: workspaceSelector; property: "visible" }
501547 PropertyAction { target: spreadContainer; property: "visible" }
502548 ParallelAnimation {
503− UbuntuNumberAnimation {
504− target: blurLayer; properties: "saturation,blurRadius";
505− duration: spreadContainer.animateIn ? UbuntuAnimation.FastDuration : 0
506− }
549+ UbuntuNumberAnimation { target: blurLayer; properties: "saturation,blurRadius"; duration: UbuntuAnimation.SnapDuration }
507550 PropertyAction { target: spreadFlickable; property: "visible" }
508551 PropertyAction { targets: [currentSelectedLabel,spreadBackground]; property: "visible" }
509552 PropertyAction { target: spreadFlickable; property: "contentX"; value: 0 }
510553 }
554+ PropertyAction { target: hoverMouseArea; properties: "enabled,progressiveScrollingEnabled"; value: false }
511555 }
512556 },
513557 Transition {
@@ -518,6 +562,5 @@ FocusScope {
518562 PropertyAction { target: spreadRepeater; property: "highlightedIndex"; value: -1 }
519563 PropertyAction { target: spreadContainer; property: "animateIn"; value: false }
520564 }
521−
522565 ]
523566}
qml/Stages/DesktopSpreadDelegate.qml+15−1
@@ -56,6 +56,11 @@ Item {
5656 }
5757 ]
5858
59+ scale: highlightShown ? 1.025 : 1
60+ Behavior on scale {
61+ UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
62+ }
63+
5964 BorderImage {
6065 anchors {
6166 fill: root
@@ -70,7 +75,7 @@ Item {
7075 anchors.fill: parent
7176 anchors.margins: -units.gu(1)
7277 color: "white"
73− opacity: highlightShown ? 0.15 : 0
78+ opacity: highlightShown ? 0.55 : 0
7479 antialiasing: true
7580 }
7681
@@ -108,4 +113,13 @@ Item {
108113 ]
109114 }
110115 }
116+
117+ Rectangle {
118+ anchors.fill: parent
119+ color: "black"
120+ opacity: root.highlightShown ? 0 : .1
121+ Behavior on opacity {
122+ UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
123+ }
124+ }
111125}
qml/Stages/DesktopStage.qml+19−23
@@ -350,6 +350,19 @@ AbstractStage {
350350 ApplicationManager.focusApplication(appId);
351351 }
352352
353+ function playFocusAnimation() {
354+ focusAnimation.start()
355+ }
356+
357+ UbuntuNumberAnimation {
358+ id: focusAnimation
359+ target: appDelegate
360+ property: "scale"
361+ from: 0.98
362+ to: 1
363+ duration: UbuntuAnimation.SnapDuration
364+ }
365+
353366 states: [
354367 State {
355368 name: "fullscreen"; when: decoratedWindow.fullscreen
@@ -440,7 +453,7 @@ AbstractStage {
440453 target: appDelegate
441454 property: "z"
442455 value: ApplicationManager.count + 1
443− when: index == spread.highlightedIndex && blurLayer.ready
456+ when: index == spread.highlightedIndex && spread.ready
444457 }
445458
446459 WindowResizeArea {
@@ -476,27 +489,6 @@ AbstractStage {
476489 }
477490 }
478491
479− BlurLayer {
480− id: blurLayer
481− anchors.fill: appContainer
482− source: appContainer
483− visible: false
484− }
485−
486− Rectangle {
487− id: spreadBackground
488− anchors.fill: parent
489− color: "#55000000"
490− visible: false
491− }
492−
493− MouseArea {
494− id: eventEater
495− anchors.fill: parent
496− visible: spreadBackground.visible
497− enabled: visible
498− }
499−
500492 EdgeBarrier {
501493 id: edgeBarrier
502494
@@ -512,7 +504,7 @@ AbstractStage {
512504 rotation: 90
513505 anchors.centerIn: parent
514506 gradient: Gradient {
515− GradientStop { position: 0.0; color: Qt.rgba(0.16,0.16,0.16,0.7)}
507+ GradientStop { position: 0.0; color: Qt.rgba(0.16,0.16,0.16,0.5)}
516508 GradientStop { position: 1.0; color: Qt.rgba(0.16,0.16,0.16,0)}
517509 }
518510 }
@@ -534,5 +526,9 @@ AbstractStage {
534526 workspace: appContainer
535527 focus: state == "altTab"
536528 altTabPressed: root.altTabPressed
529+
530+ onPlayFocusAnimation: {
531+ appRepeater.itemAt(index).playFocusAnimation();
532+ }
537533 }
538534}
tests/qmltests/Stages/tst_DesktopStage.qml+2−1
@@ -65,8 +65,9 @@ Item {
6565 property bool itemDestroyed: false
6666 sourceComponent: Component {
6767 DesktopStage {
68− color: "darkblue"
68+ color: "white"
6969 anchors.fill: parent
70+ background: "../../../qml/graphics/tablet_background.jpg"
7071
7172 Component.onCompleted: {
7273 edgeBarrierControls.target = testCase.findChild(this, "edgeBarrierController");