on xenial help sign in
more fixes and cleanup
05e451dMichael Zanetti
qml/Dash/Apps/RunningApplicationTile.qml+1−27
@@ -50,9 +50,7 @@ AbstractButton {
50 }
50 }
51 }
51 }
52
52
53− Component.onCompleted: print("---------------created apptile", application, application.source)
53+ UbuntuShape {
54−
55− UbuntuShapeForItem {
56 id: shapedApplicationImage
54 id: shapedApplicationImage
57 anchors { top: parent.top; horizontalCenter: parent.horizontalCenter }
55 anchors { top: parent.top; horizontalCenter: parent.horizontalCenter }
58
56
@@ -72,30 +70,6 @@ AbstractButton {
72
70
73 }
71 }
74
72
75−// // FIXME: should use UbuntuShape from SDK
76−// UbuntuShapeForItem {
77−// id: shapedApplicationImage
78−// anchors {
79−// top: parent.top
80−// horizontalCenter: parent.horizontalCenter
81−// }
82−
83−// // FIXME: width and height should be defined according to the
84−// // application window's aspect ratio.
85−// width: (application.stage === ApplicationInfo.MainStage && __sideStageEnabled) ?
86−// units.gu(22) : units.gu(11)
87−// height: (__sideStageEnabled) ? units.gu(22) : units.gu(19)
88−// radius: "medium"
89−// image: applicationImage
90−// }
91−
92−// ApplicationImage {
93−// id: applicationImage
94−// source: ApplicationManager.findApplication((application) ? application.appId : "")
95−// width: shapedApplicationImage.width
96−// height: shapedApplicationImage.height
97−// }
98−
99 UbuntuShape {
73 UbuntuShape {
100 id: borderPressed
74 id: borderPressed
101
75
qml/Dash/Apps/RunningApplicationsGrid.qml−10
@@ -28,12 +28,6 @@ ResponsiveFlowView {
28 property alias enableHeightBehavior: heightBehaviour.enabled
28 property alias enableHeightBehavior: heightBehaviour.enabled
29 property bool enableHeightBehaviorOnNextCreation: model.count === 0
29 property bool enableHeightBehaviorOnNextCreation: model.count === 0
30
30
31− Connections {
32− target: shell
33− onDashShownChanged: if (shell.dashShown && shell.stageScreenshotsReady) updateScreenshots();
34− onStageScreenshotsReadyChanged: if (shell.dashShown && shell.stageScreenshotsReady) updateScreenshots();
35− }
36−
37 Behavior on height {
31 Behavior on height {
38 id: heightBehaviour
32 id: heightBehaviour
39 enabled: false
33 enabled: false
@@ -87,10 +81,6 @@ ResponsiveFlowView {
87 }
81 }
88
82
89 terminationModeEnabled: root.terminationModeEnabled
83 terminationModeEnabled: root.terminationModeEnabled
90−
91− Component.onCompleted: {
92− root.updateScreenshots.connect(updateScreenshotFromCache);
93− }
94 }
84 }
95 }
85 }
96
86
qml/Shell.qml+25−8
@@ -208,17 +208,19 @@ FocusScope {
208 width: parent.width
208 width: parent.width
209 height: parent.height
209 height: parent.height
210
210
211+ property string lastFocusedAppId
211 onShownChanged: {
212 onShownChanged: {
212 print("stages shown", shown)
213 print("stages shown", shown)
213− if (!shown) {
214+ if (shown) {
215+ if (!ApplicationManager.focusedApplicationId && lastFocusedAppId) {
216+ ApplicationManager.focusApplication(lastFocusedAppId);
217+ }
218+ } else {
219+ lastFocusedAppId = ApplicationManager.focusedApplicationId;
214 ApplicationManager.unfocusCurrentApplication();
220 ApplicationManager.unfocusCurrentApplication();
215 }
221 }
216 }
222 }
217
223
218− onFullyShownChanged: {
219− print("kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk", fullyShown)
220− }
221−
222 Connections {
224 Connections {
223 target: ApplicationManager
225 target: ApplicationManager
224 onFocusedApplicationIdChanged: {
226 onFocusedApplicationIdChanged: {
@@ -240,8 +242,6 @@ FocusScope {
240// source: "Stages/StageWithSideStage.qml"
242// source: "Stages/StageWithSideStage.qml"
241 source: "Stages/PhoneStage.qml"
243 source: "Stages/PhoneStage.qml"
242
244
243−// Rectangle { anchors.fill: parent; color: "blue"; opacity: .5 }
244−
245 Binding {
245 Binding {
246 target: applicationsDisplayLoader.item
246 target: applicationsDisplayLoader.item
247 property: "moving"
247 property: "moving"
@@ -253,6 +253,23 @@ FocusScope {
253 value: stages.shown
253 value: stages.shown
254 }
254 }
255 }
255 }
256+
257+ DragHandle {
258+ id: stagesDragHandle
259+
260+ anchors.top: parent.top
261+ anchors.bottom: parent.bottom
262+ anchors.right: parent.left
263+
264+ width: shell.edgeSize
265+ direction: Direction.Leftwards
266+ enabled: greeter.showProgress == 0 && edgeDemo.dashEnabled
267+ property bool haveApps: ApplicationManager.count > 0
268+
269+ maxTotalDragDistance: haveApps ? parent.width : parent.width * 0.7
270+ // Make autocompletion impossible when !haveApps
271+ edgeDragEvaluator.minDragDistance: haveApps ? maxTotalDragDistance * 0.1 : Number.MAX_VALUE
272+ }
256 }
273 }
257 }
274 }
258
275
@@ -413,7 +430,7 @@ FocusScope {
413 }
430 }
414 property string focusedAppId: ApplicationManager.focusedApplicationId
431 property string focusedAppId: ApplicationManager.focusedApplicationId
415 property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
432 property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
416− fullscreenMode: focusedApplication && focusedApplication.fullscreen
433+ fullscreenMode: focusedApplication && focusedApplication.fullscreen && !greeter.shown && !lockscreen.shown
417 searchVisible: !greeter.shown && !lockscreen.shown && dash.shown
434 searchVisible: !greeter.shown && !lockscreen.shown && dash.shown
418
435
419 InputFilterArea {
436 InputFilterArea {
Stages/PhoneStage.qml → qml/Stages/PhoneStage.qmlrenamed+34−11
@@ -15,7 +15,7 @@ Item {
15 property bool moving: false
15 property bool moving: false
16
16
17 // State information propagated to the outside
17 // State information propagated to the outside
18− readonly property bool painting: mainScreenshotImage.visible || fadeInScreenshotImage.visible
18+ readonly property bool painting: mainScreenshotImage.visible || fadeInScreenshotImage.visible || appSplash.visible
19
19
20 onMovingChanged: {
20 onMovingChanged: {
21 if (moving) {
21 if (moving) {
@@ -34,18 +34,24 @@ Item {
34
34
35 onFocusedApplicationIdChanged: {
35 onFocusedApplicationIdChanged: {
36 if (ApplicationManager.focusedApplicationId.length > 0) {
36 if (ApplicationManager.focusedApplicationId.length > 0) {
37− priv.applicationStarting = false;
37+ if (priv.secondApplicationStarting || priv.applicationStarting) {
38− priv.secondApplicationStarting = false;
38+ appSplashTimer.start();
39+ } else {
40+ mainScreenshotImage.src = ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).screenshot
41+ }
39 }
42 }
40 }
43 }
41
44
42 onApplicationAdded: {
45 onApplicationAdded: {
43 if (!priv.focusedApplication) {
46 if (!priv.focusedApplication) {
44− print("*** applicationStarting")
47+ mainScreenshotImage.src = "";
48+ mainScreenshotImage.visible = false;
45 priv.applicationStarting = true;
49 priv.applicationStarting = true;
46 } else {
50 } else {
47− print("*** SECONDapplicationStarting")
51+ mainScreenshotImage.src = "foobar";
52+ priv.newFocusedAppId = appId;
48 priv.secondApplicationStarting = true;
53 priv.secondApplicationStarting = true;
54+ priv.requestNewScreenshot();
49 }
55 }
50 }
56 }
51 }
57 }
@@ -65,12 +71,14 @@ Item {
65 property string newFocusedAppId
71 property string newFocusedAppId
66
72
67 onFocusedScreenshotChanged: {
73 onFocusedScreenshotChanged: {
68− waitingForScreenshot = false;
69− if (root.moving) {
74+ if (root.moving && priv.waitingForScreenshot) {
70 mainScreenshotImage.anchors.leftMargin = 0;
75 mainScreenshotImage.anchors.leftMargin = 0;
71 mainScreenshotImage.src = ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).screenshot;
76 mainScreenshotImage.src = ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).screenshot;
72 mainScreenshotImage.visible = true;
77 mainScreenshotImage.visible = true;
78+ } else if (priv.secondApplicationStarting && priv.waitingForScreenshot) {
79+ applicationSwitchingAnimation.start();
73 }
80 }
81+ waitingForScreenshot = false;
74 }
82 }
75
83
76 function requestNewScreenshot() {
84 function requestNewScreenshot() {
@@ -98,11 +106,26 @@ Item {
98 }
106 }
99 }
107 }
100
108
109+ Timer {
110+ id: appSplashTimer
111+ // This is to show the splash screen a bit longer.
112+ // Mir signals us that the newly started app has gotten focus before it paints something on the screen
113+ // This would result in the old app surface becoming visible for a bit.
114+ // FIXME: change appManager to only change the focusedApplicationId when the surface is ready to be shown.
115+ interval: 1500
116+ repeat: false
117+ onTriggered: {
118+ priv.applicationStarting = false;
119+ priv.secondApplicationStarting = false;
120+ }
121+ }
122+
101 SequentialAnimation {
123 SequentialAnimation {
102 id: applicationSwitchingAnimation
124 id: applicationSwitchingAnimation
103 // setup
125 // setup
104 PropertyAction { target: mainScreenshotImage; property: "anchors.leftMargin"; value: 0 }
126 PropertyAction { target: mainScreenshotImage; property: "anchors.leftMargin"; value: 0 }
127+ // PropertyAction seems to fail when secondApplicationStarting and we didn't have another screenshot before
105− PropertyAction { target: mainScreenshotImage; property: "src"; value: priv.focusedScreenshot }
128+ ScriptAction { script: mainScreenshotImage.src = priv.focusedScreenshot }
106 PropertyAction { target: mainScreenshotImage; property: "visible"; value: true }
129 PropertyAction { target: mainScreenshotImage; property: "visible"; value: true }
107 PropertyAction { target: fadeInScreenshotImage; property: "source"; value: ApplicationManager.findApplication(priv.newFocusedAppId).screenshot }
130 PropertyAction { target: fadeInScreenshotImage; property: "source"; value: ApplicationManager.findApplication(priv.newFocusedAppId).screenshot }
108 PropertyAction { target: fadeInScreenshotImage; property: "visible"; value: true }
131 PropertyAction { target: fadeInScreenshotImage; property: "visible"; value: true }
@@ -124,7 +147,7 @@ Item {
124
147
125 // FIXME: Drop this and make the imageprovider show a splashscreen instead
148 // FIXME: Drop this and make the imageprovider show a splashscreen instead
126 Rectangle {
149 Rectangle {
127− id: appSplash
150+ id: appSplash2
128 anchors.fill: parent
151 anchors.fill: parent
129 color: "white"
152 color: "white"
130 visible: priv.secondApplicationStarting
153 visible: priv.secondApplicationStarting
@@ -138,9 +161,9 @@ Item {
138 }
161 }
139
162
140 Rectangle {
163 Rectangle {
141− id: appSplash2
164+ id: appSplash
142 anchors.fill: parent
165 anchors.fill: parent
143− color: "red"
166+ color: "white"
144 visible: priv.applicationStarting
167 visible: priv.applicationStarting
145 }
168 }
146 Image {
169 Image {