on xenial help sign in
short right edge gesture for staged mode
abdb078Michael Zanetti
po/unity8.pot+1−1
@@ -8,7 +8,7 @@ msgid ""
8msgstr ""
8msgstr ""
9"Project-Id-Version: unity8\n"
9"Project-Id-Version: unity8\n"
10"Report-Msgid-Bugs-To: \n"
10"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2016-07-14 17:51+0200\n"
11+"POT-Creation-Date: 2016-07-16 01:28+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
qml/Stages/DecoratedWindow.qml+13−3
@@ -35,8 +35,9 @@ FocusScope {
35 property bool hasDecoration: true
35 property bool hasDecoration: true
36 // This will temporarily show/hide the decoration without actually changing the surface's dimensions
36 // This will temporarily show/hide the decoration without actually changing the surface's dimensions
37 property bool showDecoration: true
37 property bool showDecoration: true
38+ property bool animateDecoration: false
38 property bool showHighlight: false
39 property bool showHighlight: false
39− property real shadowOpacity: 1
40+ property real shadowOpacity: 0
40
41
41 property real requestedWidth
42 property real requestedWidth
42 property real requestedHeight
43 property real requestedHeight
@@ -67,10 +68,10 @@ FocusScope {
67 QtObject {
68 QtObject {
68 id: d
69 id: d
69 property int requestedDecorationHeight: root.hasDecoration && root.hasDecoration ? decoration.height : 0
70 property int requestedDecorationHeight: root.hasDecoration && root.hasDecoration ? decoration.height : 0
70− Behavior on requestedDecorationHeight { UbuntuNumberAnimation { duration: priv.animationDuration } }
71+ Behavior on requestedDecorationHeight { enabled: root.animateDecoration; UbuntuNumberAnimation { duration: priv.animationDuration } }
71
72
72 property int visibleDecorationHeight: root.showDecoration && root.hasDecoration ? decoration.height : 0
73 property int visibleDecorationHeight: root.showDecoration && root.hasDecoration ? decoration.height : 0
73− Behavior on visibleDecorationHeight { UbuntuNumberAnimation { duration: priv.animationDuration } }
74+ Behavior on visibleDecorationHeight { enabled: root.animateDecoration; UbuntuNumberAnimation { duration: priv.animationDuration } }
74 }
75 }
75
76
76 Rectangle {
77 Rectangle {
@@ -88,6 +89,15 @@ FocusScope {
88 visible: showHighlight
89 visible: showHighlight
89 }
90 }
90
91
92+ BorderImage {
93+ anchors {
94+ fill: decoratedWindow
95+ margins: active ? -units.gu(2) : -units.gu(1.5)
96+ }
97+ source: "graphics/dropshadow2gu.sci"
98+ opacity: root.shadowOpacity
99+ }
100+
91 WindowDecoration {
101 WindowDecoration {
92 id: decoration
102 id: decoration
93 target: root.parent
103 target: root.parent
qml/Stages/DesktopStage.qml+29−19
@@ -129,7 +129,8 @@ AbstractStage {
129 property var foregroundMaximizedAppDelegate: null // for stuff like drop shadow and focusing maximized app by clicking panel
129 property var foregroundMaximizedAppDelegate: null // for stuff like drop shadow and focusing maximized app by clicking panel
130
130
131 property bool goneToSpread: false
131 property bool goneToSpread: false
132+// property int animationDuration: 4000
132− property int animationDuration: UbuntuAnimation.FastDuration //4000//UbuntuAnimation.SleepyDuration
133+ property int animationDuration: UbuntuAnimation.FastDuration
133
134
134 function updateForegroundMaximizedApp() {
135 function updateForegroundMaximizedApp() {
135 var found = false;
136 var found = false;
@@ -490,7 +491,7 @@ AbstractStage {
490 readonly property bool maximizedHorizontally: windowState & WindowStateStorage.WindowStateMaximizedHorizontally
491 readonly property bool maximizedHorizontally: windowState & WindowStateStorage.WindowStateMaximizedHorizontally
491 readonly property bool maximizedVertically: windowState & WindowStateStorage.WindowStateMaximizedVertically
492 readonly property bool maximizedVertically: windowState & WindowStateStorage.WindowStateMaximizedVertically
492 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
493 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
493− readonly property bool fullscreen: state == "fullscreen"
494+ readonly property bool fullscreen: surface.state === Mir.FullscreenState;
494
495
495 property int windowState: WindowStateStorage.WindowStateNormal
496 property int windowState: WindowStateStorage.WindowStateNormal
496 property bool animationsEnabled: true
497 property bool animationsEnabled: true
@@ -687,6 +688,7 @@ AbstractStage {
687 id: rightEdgeFocusAnimation
688 id: rightEdgeFocusAnimation
688 UbuntuNumberAnimation { target: appDelegate; properties: "x"; to: 0; duration: priv.animationDuration }
689 UbuntuNumberAnimation { target: appDelegate; properties: "x"; to: 0; duration: priv.animationDuration }
689 UbuntuNumberAnimation { target: decoratedWindow; properties: "angle"; to: 0; duration: priv.animationDuration }
690 UbuntuNumberAnimation { target: decoratedWindow; properties: "angle"; to: 0; duration: priv.animationDuration }
691+ UbuntuNumberAnimation { target: decoratedWindow; properties: "itemScale"; to: 1; duration: priv.animationDuration }
690 onStopped: appDelegate.focus = true
692 onStopped: appDelegate.focus = true
691 }
693 }
692 ParallelAnimation {
694 ParallelAnimation {
@@ -720,7 +722,9 @@ AbstractStage {
720 progress: 0
722 progress: 0
721 targetHeight: spreadMaths.stackHeight
723 targetHeight: spreadMaths.stackHeight
722 targetX: spreadMaths.targetX
724 targetX: spreadMaths.targetX
725+ targetY: spreadMaths.targetY
723 targetAngle: spreadMaths.targetAngle
726 targetAngle: spreadMaths.targetAngle
727+ targetScale: spreadMaths.targetScale
724 }
728 }
725
729
726// onXChanged: if (model.application.appId == "unity8-dash") print("dash moved to", x)
730// onXChanged: if (model.application.appId == "unity8-dash") print("dash moved to", x)
@@ -733,10 +737,11 @@ AbstractStage {
733 target: decoratedWindow;
737 target: decoratedWindow;
734 showDecoration: false;
738 showDecoration: false;
735 angle: spreadMaths.targetAngle
739 angle: spreadMaths.targetAngle
736− itemScale: spreadMaths.scale
740+ itemScale: spreadMaths.targetScale
737 scaleToPreviewSize: spreadItem.stackHeight
741 scaleToPreviewSize: spreadItem.stackHeight
738 scaleToPreviewProgress: 1
742 scaleToPreviewProgress: 1
739 hasDecoration: root.mode === "windowed"
743 hasDecoration: root.mode === "windowed"
744+ shadowOpacity: .3
740 }
745 }
741 PropertyChanges {
746 PropertyChanges {
742 target: appDelegate
747 target: appDelegate
@@ -756,10 +761,11 @@ AbstractStage {
756 PropertyChanges {
761 PropertyChanges {
757 target: stagedRightEdgeMaths
762 target: stagedRightEdgeMaths
758 progress: rightEdgeDragArea.progress
763 progress: rightEdgeDragArea.progress
764+ startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
759 }
765 }
760 PropertyChanges {
766 PropertyChanges {
761 target: appDelegate
767 target: appDelegate
762− y: PanelState.panelHeight
768+ y: stagedRightEdgeMaths.animatedY
763 x: stagedRightEdgeMaths.animatedX
769 x: stagedRightEdgeMaths.animatedX
764 z: index +1
770 z: index +1
765 height: stagedRightEdgeMaths.animatedHeight
771 height: stagedRightEdgeMaths.animatedHeight
@@ -770,8 +776,10 @@ AbstractStage {
770 target: decoratedWindow;
776 target: decoratedWindow;
771 hasDecoration: false
777 hasDecoration: false
772 angle: stagedRightEdgeMaths.animatedAngle
778 angle: stagedRightEdgeMaths.animatedAngle
779+ itemScale: stagedRightEdgeMaths.animatedScale
773 scaleToPreviewSize: spreadItem.stackHeight
780 scaleToPreviewSize: spreadItem.stackHeight
774− scaleToPreviewProgress: stagedRightEdgeMaths.progress
781+ scaleToPreviewProgress: stagedRightEdgeMaths.scaleToPreviewProgress
782+ shadowOpacity: 0.3
775 }
783 }
776 },
784 },
777 State {
785 State {
@@ -781,7 +789,7 @@ AbstractStage {
781 x: appDelegate.focus ? 0 : root.width
789 x: appDelegate.focus ? 0 : root.width
782 y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
790 y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
783 requestedWidth: appContainer.width
791 requestedWidth: appContainer.width
784− requestedHeight: appContainer.height - PanelState.panelHeight
792+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
785 visuallyMaximized: true
793 visuallyMaximized: true
786 }
794 }
787 PropertyChanges {
795 PropertyChanges {
@@ -854,6 +862,7 @@ AbstractStage {
854 }
862 }
855 PropertyChanges { target: touchControls; enabled: true }
863 PropertyChanges { target: touchControls; enabled: true }
856 PropertyChanges { target: resizeArea; enabled: true }
864 PropertyChanges { target: resizeArea; enabled: true }
865+ PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
857 },
866 },
858 State {
867 State {
859 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
868 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
@@ -866,6 +875,7 @@ AbstractStage {
866 target: decoratedWindow
875 target: decoratedWindow
867 requestedWidth: (appContainer.width - root.leftMargin)/2
876 requestedWidth: (appContainer.width - root.leftMargin)/2
868 requestedHeight: appContainer.height - PanelState.panelHeight
877 requestedHeight: appContainer.height - PanelState.panelHeight
878+ shadowOpacity: .3
869 }
879 }
870 },
880 },
871 State {
881 State {
@@ -879,17 +889,26 @@ AbstractStage {
879 target: decoratedWindow
889 target: decoratedWindow
880 requestedWidth: (appContainer.width - root.leftMargin)/2
890 requestedWidth: (appContainer.width - root.leftMargin)/2
881 requestedHeight: appContainer.height - PanelState.panelHeight
891 requestedHeight: appContainer.height - PanelState.panelHeight
892+ shadowOpacity: .3
882 }
893 }
883 },
894 },
884 State {
895 State {
885 name: "maximizedHorizontally"; when: appDelegate.maximizedHorizontally && !appDelegate.minimized
896 name: "maximizedHorizontally"; when: appDelegate.maximizedHorizontally && !appDelegate.minimized
886 PropertyChanges { target: appDelegate; x: root.leftMargin }
897 PropertyChanges { target: appDelegate; x: root.leftMargin }
898+ PropertyChanges {
899+ target: decoratedWindow;
887− PropertyChanges { target: decoratedWindow; requestedWidth: appContainer.width - root.leftMargin }
900+ requestedWidth: appContainer.width - root.leftMargin
901+ shadowOpacity: .3
902+ }
888 },
903 },
889 State {
904 State {
890 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
905 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
891 PropertyChanges { target: appDelegate; y: PanelState.panelHeight }
906 PropertyChanges { target: appDelegate; y: PanelState.panelHeight }
907+ PropertyChanges {
908+ target: decoratedWindow;
892− PropertyChanges { target: decoratedWindow; requestedHeight: appContainer.height - PanelState.panelHeight }
909+ requestedHeight: appContainer.height - PanelState.panelHeight
910+ shadowOpacity: .3
911+ }
893 },
912 },
894 State {
913 State {
895 name: "minimized"; when: appDelegate.minimized
914 name: "minimized"; when: appDelegate.minimized
@@ -912,7 +931,7 @@ AbstractStage {
912 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: priv.animationDuration }
931 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: priv.animationDuration }
913 },
932 },
914 Transition {
933 Transition {
915− from: "spread"; to: "staged,normal"
934+ from: "spread"; to: "*"
916// UbuntuNumberAnimation { target: appDelegate; properties: "x,y,height"; duration: priv.animationDuration }
935// UbuntuNumberAnimation { target: appDelegate; properties: "x,y,height"; duration: priv.animationDuration }
917// UbuntuNumberAnimation { target: decoratedWindow; properties: "width,height,itemScale,angle"; duration: priv.animationDuration }
936// UbuntuNumberAnimation { target: decoratedWindow; properties: "width,height,itemScale,angle"; duration: priv.animationDuration }
918 ScriptAction { script: if (appDelegate.focus) appDelegate.playFocusAnimation() }
937 ScriptAction { script: if (appDelegate.focus) appDelegate.playFocusAnimation() }
@@ -1068,15 +1087,6 @@ AbstractStage {
1068 }
1087 }
1069 ]
1088 ]
1070 }
1089 }
1071− BorderImage {
1072− anchors {
1073− fill: decoratedWindow
1074− margins: /*active ? -units.gu(2) : */-units.gu(1.5)
1075− }
1076− source: "graphics/dropshadow2gu.sci"
1077− opacity: root.shadowOpacity * .3
1078− visible: false
1079− }
1080
1090
1081
1091
1082 WindowControlsOverlay {
1092 WindowControlsOverlay {
@@ -1199,7 +1209,7 @@ AbstractStage {
1199 // A potential edge-drag gesture has started. Start recording it
1209 // A potential edge-drag gesture has started. Start recording it
1200 gesturePoints = [];
1210 gesturePoints = [];
1201 } else {
1211 } else {
1202− if (gesturePoints[gesturePoints.length - 1] < -root.width / 2) {
1212+ if (gesturePoints[gesturePoints.length - 1] < -root.width * 0.4 ) {
1203 priv.goneToSpread = true;
1213 priv.goneToSpread = true;
1204 } else {
1214 } else {
1205 if (appRepeater.count > 1) {
1215 if (appRepeater.count > 1) {
qml/Stages/Spread/SpreadMaths.qml+1−1
@@ -49,7 +49,7 @@ Item {
49 Math.min(spread.dynamicLeftRotationAngle, spread.dynamicRightRotationAngle), Math.max(spread.dynamicLeftRotationAngle, spread.dynamicRightRotationAngle))
49 Math.min(spread.dynamicLeftRotationAngle, spread.dynamicRightRotationAngle), Math.max(spread.dynamicLeftRotationAngle, spread.dynamicRightRotationAngle))
50
50
51
51
52− readonly property real scale: MathUtils.clamp(
52+ readonly property real targetScale: MathUtils.clamp(
53 MathUtils.map(spreadPosition, 0, 1, spread.leftStackScale, spread.rightStackScale),
53 MathUtils.map(spreadPosition, 0, 1, spread.leftStackScale, spread.rightStackScale),
54 spread.leftStackScale, spread.rightStackScale)
54 spread.leftStackScale, spread.rightStackScale)
55
55
qml/Stages/Spread/StagedRightEdgeMaths.qml+35−12
@@ -11,34 +11,57 @@ QtObject {
11 property int sceneWidth: 0
11 property int sceneWidth: 0
12 property int sceneHeight: 0
12 property int sceneHeight: 0
13 property int targetX: 0
13 property int targetX: 0
14− property int targetAngle: 0
14+ property int startY: 0
15+ property int targetY: 0
16+ property real startAngle: 40
17+ property real targetAngle: 0
15 property int targetHeight: 0
18 property int targetHeight: 0
19+ property real startScale: 1.3
20+ property real targetScale: 0
21+
16
22
17 onProgressChanged: if (itemIndex == 0) { print("progress", progress) }
23 onProgressChanged: if (itemIndex == 0) { print("progress", progress) }
18
24
25+ // Config
26+ property real breakPoint: 0.4
27+ property int tileDistance: units.gu(10)
28+
19 // Output
29 // Output
20
30
31+ readonly property real scaleToPreviewProgress: {
32+ print("scaleProg:", progress < breakPoint ? 0 : MathUtils.linearAnimation(breakPoint, 1.0, 0.0, 1.0, progress))
33+ return progress < breakPoint ? 0 : MathUtils.linearAnimation(0.5, 1.0, 0.0, 1.0, progress)
34+ }
21 readonly property int animatedWidth: {
35 readonly property int animatedWidth: {
22− return MathUtils.linearAnimation(0, 1, root.sceneWidth, targetHeight, progress)
36+ return progress < breakPoint ? root.sceneHeight : MathUtils.linearAnimation(breakPoint, 1, root.sceneWidth, targetHeight, progress)
23 }
37 }
24
38
25 readonly property int animatedHeight: {
39 readonly property int animatedHeight: {
26− print("animatedHeight:", progress < 0.5 ? root.sceneHeight : MathUtils.linearAnimation(0.5, 1, root.sceneHeight, targetHeight, progress))
27− return progress < 0.5 ? root.sceneHeight : MathUtils.linearAnimation(0.5, 1, root.sceneHeight, targetHeight, progress)
40+ return progress < breakPoint ? root.sceneHeight : MathUtils.linearAnimation(breakPoint, 1, root.sceneHeight, targetHeight, progress)
28 }
41 }
29
42
30 readonly property int animatedX: {
43 readonly property int animatedX: {
31 if (itemIndex == 0) {
44 if (itemIndex == 0) {
32− // aX : tX = p : 1
33 return root.targetX * root.progress
45 return root.targetX * root.progress
34 }
46 }
35− var startX = sceneWidth + (root.itemIndex - 1) * units.gu(10)
47+ var startX = sceneWidth //+ (itemIndex - 1) * tileDistance
36− var distance = startX - root.targetX
48+ if (itemIndex == 1) {
37− return startX - distance * root.progress;
49+ if (root.progress < breakPoint) {
50+ return MathUtils.linearAnimation(0, breakPoint, startX, startX / 2 + (itemIndex - 1) * tileDistance, progress)
51+ }
52+ return MathUtils.linearAnimation(breakPoint, 1, startX / 2 + (itemIndex - 1) * tileDistance, targetX, progress)
53+ }
54+ if (progress < breakPoint) {
55+ return startX
56+ }
57+ return MathUtils.linearAnimation(breakPoint, 1, startX, targetX, progress)
38 }
58 }
39
59
40− readonly property real animatedAngle: {
60+ readonly property int animatedY: progress < breakPoint ? startY : MathUtils.linearAnimation(breakPoint, 1, startY, targetY, progress)
41− // a : tA = p : 1
61+
42− return root.targetAngle * root.progress
62+ readonly property real animatedAngle: itemIndex == 0 ? MathUtils.linearAnimation(0, 1, 0, targetAngle, progress)
43− }
63+ : Math.max(MathUtils.linearAnimation(0, breakPoint, startAngle, targetAngle, progress), targetAngle)
64+
65+ readonly property real animatedScale: itemIndex == 0 ? MathUtils.linearAnimation(0, 1, 1, targetScale, progress)
66+ : MathUtils.linearAnimation(0, 1, startScale, targetScale, progress)
44}
67}