on xenial help sign in
Work so far
37457f2Gerry Boland
qml/Components/Dot.qmlnew file+25
@@ -0,0 +1,25 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+
20+Rectangle {
21+ radius: width
22+ width: units.dp(6)
23+ height: width
24+ color: UbuntuColors.orange
25+}
qml/Components/WaitingDots.qmlnew file+76
@@ -0,0 +1,76 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.2
18+import Ubuntu.Components 0.1
19+
20+Item {
21+ id: waitingDots
22+
23+ // center in parent; waitingDots has no size therefore anchors.centerIn cannot be used
24+ x: parent.width / 2
25+ y: parent.height / 2
26+
27+ property var dots: [dot1, dot2, dot3]
28+ property var vertices: [[-units.gu(1), -units.gu(1)],
29+ [units.gu(1), -units.gu(1)],
30+ [0, units.gu(1)]]
31+ property int shift: 0
32+
33+ function cycle () {
34+ var n = vertices.length;
35+ shift = (shift + 1) % n;
36+
37+ for (var i = 0; i < n; i++) {
38+ dots[i].x = vertices[(i+shift) % n][0];
39+ dots[i].y = vertices[(i+shift) % n][1];
40+ }
41+ }
42+
43+ Timer {
44+ interval: 800
45+ running: waitingDots.visible
46+ repeat: true
47+ triggeredOnStart: true
48+ onTriggered: waitingDots.cycle()
49+ }
50+
51+
52+ Dot {
53+ id: dot1
54+ x: vertices[0][0]
55+ y: vertices[0][1]
56+ Behavior on x {XAnimator {duration: UbuntuAnimation.BriskDuration; easing: UbuntuAnimation.StandardEasing}}
57+ Behavior on y {YAnimator {duration: UbuntuAnimation.BriskDuration; easing: UbuntuAnimation.StandardEasing}}
58+ }
59+
60+ Dot {
61+ id: dot2
62+ x: vertices[1][0]
63+ y: vertices[1][1]
64+ Behavior on x {XAnimator {duration: UbuntuAnimation.BriskDuration; easing: UbuntuAnimation.StandardEasing}}
65+ Behavior on y {YAnimator {duration: UbuntuAnimation.BriskDuration; easing: UbuntuAnimation.StandardEasing}}
66+
67+ }
68+
69+ Dot {
70+ id: dot3
71+ x: vertices[2][0]
72+ y: vertices[2][1]
73+ Behavior on x {XAnimator {duration: UbuntuAnimation.BriskDuration; easing: UbuntuAnimation.StandardEasing}}
74+ Behavior on y {YAnimator {duration: UbuntuAnimation.BriskDuration; easing: UbuntuAnimation.StandardEasing}}
75+ }
76+}
qml/Shell.qml+11−1
@@ -180,7 +180,7 @@ FocusScope {
180 visible: !fullyHidden
180 visible: !fullyHidden
181
181
182 x: shown ? launcher.progress : stagesDragArea.progress
182 x: shown ? launcher.progress : stagesDragArea.progress
183− //Behavior on x { SmoothedAnimation { velocity: 600; duration: UbuntuAnimation.FastDuration } }
183+ Behavior on x { SmoothedAnimation { velocity: 600; duration: UbuntuAnimation.FastDuration } }
184
184
185 property bool shown: false
185 property bool shown: false
186 onShownChanged: {
186 onShownChanged: {
@@ -225,17 +225,22 @@ FocusScope {
225 anchors.fill: parent
225 anchors.fill: parent
226
226
227 source: shell.sideStageEnabled ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
227 source: shell.sideStageEnabled ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
228+ asynchronous: true
229+ visible: status == Loader.Ready
228
230
229 Binding {
231 Binding {
230 target: applicationsDisplayLoader.item
232 target: applicationsDisplayLoader.item
231 property: "dragAreaWidth"
233 property: "dragAreaWidth"
232 value: shell.edgeSize
234 value: shell.edgeSize
235+ when: applicationsDisplayLoader.status === Loader.Ready
233 }
236 }
234 Binding {
237 Binding {
235 target: applicationsDisplayLoader.item
238 target: applicationsDisplayLoader.item
236 property: "maximizedAppTopMargin"
239 property: "maximizedAppTopMargin"
237 value: panel.panelHeight
240 value: panel.panelHeight
241+ when: applicationsDisplayLoader.status === Loader.Ready
238 }
242 }
243+ onLoaded: {print("!!!!!!!!!LOADED", source); gc();}
239 }
244 }
240 }
245 }
241
246
@@ -533,6 +538,11 @@ FocusScope {
533 }
538 }
534 }
539 }
535
540
541+ InputMethod {
542+ id: inputMethod
543+ anchors.fill: parent
544+ }
545+
536 focus: true
546 focus: true
537 onFocusChanged: if (!focus) forceActiveFocus();
547 onFocusChanged: if (!focus) forceActiveFocus();
538
548
qml/Stages/PhoneStage.qml+4−3
@@ -36,7 +36,8 @@ Rectangle {
36 function select(appId) {
36 function select(appId) {
37 spreadView.snapTo(priv.indexOf(appId))
37 spreadView.snapTo(priv.indexOf(appId))
38 }
38 }
39−
39+Component.onCompleted: print("PhoneStage created", root)
40+Component.onDestruction: print("PhoneStage destroyed", root)
40 onWidthChanged: {
41 onWidthChanged: {
41 spreadView.selectedIndex = -1;
42 spreadView.selectedIndex = -1;
42 spreadView.phase = 0;
43 spreadView.phase = 0;
@@ -57,7 +58,7 @@ Rectangle {
57 onFocusedApplicationIdChanged: {
58 onFocusedApplicationIdChanged: {
58 if (ApplicationManager.focusedApplicationId.length > 0) {
59 if (ApplicationManager.focusedApplicationId.length > 0) {
59 if (priv.secondApplicationStarting || priv.applicationStarting) {
60 if (priv.secondApplicationStarting || priv.applicationStarting) {
60− appSplashTimer.restart();
61+ //appSplashTimer.restart(); REMOVEME
61 } else {
62 } else {
62 var application = priv.focusedApplication;
63 var application = priv.focusedApplication;
63 root.fullscreen = application.fullscreen;
64 root.fullscreen = application.fullscreen;
@@ -109,7 +110,7 @@ Rectangle {
109 Rectangle {
110 Rectangle {
110 id: coverFlipBackground
111 id: coverFlipBackground
111 anchors.fill: parent
112 anchors.fill: parent
112− color: "black"
113+ color: "blue"
113 visible: spreadView.visible
114 visible: spreadView.visible
114 }
115 }
115
116
qml/Stages/Splash.qmlnew file+59
@@ -0,0 +1,59 @@
1+/*
2+ * Copyright 2014 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU Lesser General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU Lesser General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU Lesser General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+*/
16+
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+import "../Components"
20+
21+Rectangle {
22+ id: root
23+ color: "black"
24+
25+ property string name: ""
26+ property url image: ""
27+
28+ UbuntuShape {
29+ id: iconShape
30+ anchors.horizontalCenter: parent.horizontalCenter
31+ anchors.verticalCenter: parent.verticalCenter
32+ anchors.verticalCenterOffset: -units.gu(4)
33+
34+ radius: "medium"
35+ borderSource: "none"
36+
37+ image: Image {
38+ id: iconImage
39+ sourceSize.width: iconShape.width
40+ sourceSize.height: iconShape.height
41+ source: root.image
42+ }
43+ }
44+
45+ Label {
46+ text: root.name
47+ anchors.horizontalCenter: parent.horizontalCenter
48+ anchors.top: iconShape.bottom
49+ anchors.topMargin: units.gu(2)
50+ fontSize: "large"
51+ }
52+
53+ WaitingDots {
54+ anchors.horizontalCenter: parent.horizontalCenter
55+ anchors.bottom: parent.bottom
56+ anchors.bottomMargin: units.gu(12)
57+ }
58+
59+}
qml/Stages/SpreadDelegate.qml+52−37
@@ -32,9 +32,21 @@ Item {
32 // e.g. Create a SurfaceItem {} in C++ which we just use without any imperative hacks.
32 // e.g. Create a SurfaceItem {} in C++ which we just use without any imperative hacks.
33 property var surface: application ? application.surface : null
33 property var surface: application ? application.surface : null
34 onSurfaceChanged: {
34 onSurfaceChanged: {
35− if (surface) {
35+ if (surface && !priv.appHasCreatedASurface) {
36− surface.parent = root;
36+ priv.appHasCreatedASurface = true;
37− surface.z = 1;
37+ }
38+ }
39+
40+ QtObject {
41+ id: priv
42+ property bool appHasCreatedASurface: false
43+
44+ function checkFullscreen(surface) {
45+ if (surface.state === MirSurfaceItem.Fullscreen) {
46+ surface.anchors.topMargin = 0;
47+ } else {
48+ surface.anchors.topMargin = maximizedAppTopMargin;
49+ }
38 }
50 }
39 }
51 }
40
52
@@ -44,42 +56,42 @@ Item {
44 value: root.interactive
56 value: root.interactive
45 }
57 }
46
58
47− state: {
59+ Connections {
48− if (surface) {
60+ target: surface
49− if (surface.state === MirSurfaceItem.Fullscreen) {
61+ onStateChanged: priv.checkFullScreen(surface);
50− "fullscreen";
51− } else {
52− "maximized";
53− }
54− } else {
55− return "empty"
56− }
57 }
62 }
63+
64+ StateGroup {
65+ id: appSurfaceState
58− states: [
66+ states: [
59− State {
67+ State {
60− name: "fullscreen"
68+ name: "noSurfaceYet"
61− PropertyChanges {
69+ when: !priv.appHasCreatedASurface
62− target: surface
70+ StateChangeScript {
63− x: 0
71+ script: {splashLoader.setSource("Splash.qml", { "name": application.name, "image": application.icon }); print("SPLASH!!")}
64− y: 0
65− width: root.width
66− height: root.height
67− }
72+ }
68− },
73+ },
69− State {
74+ State {
70− name: "maximized"
75+ name: "hasSurface"
71− PropertyChanges {
76+ when: priv.appHasCreatedASurface && (root.surface !== null)
72− target: surface
77+ PropertyChanges { target: root.surface; parent: root; anchors.fill: parent; z: 1 }
73− x: 0
78+ StateChangeScript { script: priv.checkFullscreen(root.surface); }
74− y: maximizedAppTopMargin
79+ PropertyChanges { target: splashLoader; source: "" }
75− width: root.width
80+ },
76− height: root.height - y
81+ State {
82+ name: "surfaceLostButAppStillAlive"
83+ when: priv.appHasCreatedASurface && (root.surface === null)
84+ // TODO - use app snapshot
77 }
85 }
78− },
79− State {
80− name: "empty"
81− }
82− ]
86+ ]
87+ state: "noSurfaceYet"
88+ }
89+
90+ Loader {
91+ id: splashLoader
92+ anchors.fill: parent
93+ onLoaded: print("Splash loaded!!")
94+ }
83
95
84 BorderImage {
96 BorderImage {
85 id: dropShadow
97 id: dropShadow
@@ -100,4 +112,7 @@ Item {
100 root.clicked()
112 root.clicked()
101 }
113 }
102 }
114 }
115+
116+ Component.onCompleted: print("SpreadDelegate created", root, application)
117+ Component.onDestruction: print("SpreadDelegate destroyed", root, application)
103}
118}
qml/Stages/StageWithSideStage.qml+1−1
@@ -17,7 +17,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import "../Components"
19import "../Components"
20−import Unity.Application 0.1
20+import Mir.Application 0.1
21import Ubuntu.Gestures 0.1
21import Ubuntu.Gestures 0.1
22
22
23Item {
23Item {
qml/Stages/TabletStage.qml+5−1
@@ -30,6 +30,7 @@ Item {
30 property bool shown: false
30 property bool shown: false
31 property bool moving: false
31 property bool moving: false
32 property int dragAreaWidth
32 property int dragAreaWidth
33+ property real maximizedAppTopMargin
33
34
34 // State information propagated to the outside
35 // State information propagated to the outside
35 readonly property bool painting: true
36 readonly property bool painting: true
@@ -319,11 +320,13 @@ Item {
319
320
320 Rectangle {
321 Rectangle {
321 id: spreadRow
322 id: spreadRow
322− color: "black"
323+ //color: "black"
323 x: spreadView.contentX
324 x: spreadView.contentX
324 height: root.height
325 height: root.height
325 width: spreadView.width + Math.max(spreadView.width, ApplicationManager.count * spreadView.tileDistance)
326 width: spreadView.width + Math.max(spreadView.width, ApplicationManager.count * spreadView.tileDistance)
326
327
328+ color: "transparent"
329+
327 Repeater {
330 Repeater {
328 id: spreadRepeater
331 id: spreadRepeater
329 model: ApplicationManager
332 model: ApplicationManager
@@ -343,6 +346,7 @@ Item {
343 otherSelected: spreadView.selectedIndex >= 0 && !selected
346 otherSelected: spreadView.selectedIndex >= 0 && !selected
344 isInSideStage: priv.sideStageAppId == model.appId
347 isInSideStage: priv.sideStageAppId == model.appId
345 interactive: !spreadView.interactive
348 interactive: !spreadView.interactive
349+ maximizedAppTopMargin: root.maximizedAppTopMargin
346
350
347 progress: {
351 progress: {
348 var tileProgress = (spreadView.contentX - zIndex * spreadView.tileDistance) / spreadView.width;
352 var tileProgress = (spreadView.contentX - zIndex * spreadView.tileDistance) / spreadView.width;