on xenial help sign in
fixes for the tablet stages
0c779a6Michael Zanetti
qml/Stages/SpreadDelegate.qml+5−4
@@ -48,7 +48,7 @@ Item {
48
48
49 surface.parent = surfaceContainer;
49 surface.parent = surfaceContainer;
50 surface.anchors.fill = surfaceContainer;
50 surface.anchors.fill = surfaceContainer;
51− checkFullscreen(surface);
51+ surfaceContainer.checkFullscreen(surface);
52 surface.z = 1;
52 surface.z = 1;
53 }
53 }
54 }
54 }
@@ -80,7 +80,7 @@ Item {
80
80
81 Connections {
81 Connections {
82 target: surface
82 target: surface
83− onStateChanged: checkFullscreen(surface);
83+ onStateChanged: surfaceContainer.checkFullscreen(surface);
84 }
84 }
85
85
86 BorderImage {
86 BorderImage {
@@ -147,12 +147,13 @@ Item {
147 }
147 }
148 }
148 }
149
149
150− onDragEnd: {
150+ onClicked: {
151 if (!moving) {
151 if (!moving) {
152 root.clicked();
152 root.clicked();
153− return;
154 }
153 }
154+ }
155
155
156+ onDragEnd: {
156 if ((dragVelocity < -600 && distance < -units.gu(4)) || distance < -root.height / 2) {
157 if ((dragVelocity < -600 && distance < -units.gu(4)) || distance < -root.height / 2) {
157 animation.animate("up")
158 animation.animate("up")
158 } else if ((dragVelocity > 600 && distance > units.gu(4)) || distance > root.height / 2) {
159 } else if ((dragVelocity > 600 && distance > units.gu(4)) || distance > root.height / 2) {
qml/Stages/TabletStage.qml+22−8
@@ -54,11 +54,13 @@ Item {
54
54
55 onFocusedAppIdChanged: {
55 onFocusedAppIdChanged: {
56 print("focused appid changed", priv.focusedAppId)
56 print("focused appid changed", priv.focusedAppId)
57+ if (priv.focusedAppId.length > 0) {
57− var focusedApp = ApplicationManager.findApplication(focusedAppId);
58+ var focusedApp = ApplicationManager.findApplication(focusedAppId);
58− if (focusedApp.stage == ApplicationInfoInterface.SideStage) {
59+ if (focusedApp.stage == ApplicationInfoInterface.SideStage) {
59− priv.sideStageAppId = focusedAppId;
60+ priv.sideStageAppId = focusedAppId;
60− } else {
61+ } else {
61− priv.mainStageAppId = focusedAppId;
62+ priv.mainStageAppId = focusedAppId;
63+ }
62 }
64 }
63
65
64 appId0 = ApplicationManager.count >= 1 ? ApplicationManager.get(0).appId : "";
66 appId0 = ApplicationManager.count >= 1 ? ApplicationManager.get(0).appId : "";
@@ -156,7 +158,6 @@ Item {
156 property real snapPosition: 0.75
158 property real snapPosition: 0.75
157
159
158 property int selectedIndex: -1
160 property int selectedIndex: -1
159− onSelectedIndexChanged: print("selected index changed", selectedIndex)
160 property int draggedIndex: -1
161 property int draggedIndex: -1
161 property int closingIndex: -1
162 property int closingIndex: -1
162
163
@@ -198,7 +199,6 @@ Item {
198
199
199 }
200 }
200 property int nextZInStack: indexToZIndex(nextInStack)
201 property int nextZInStack: indexToZIndex(nextInStack)
201− onNextInStackChanged: print("next in stack is", nextInStack)
202
202
203 states: [
203 states: [
204 State {
204 State {
@@ -272,7 +272,9 @@ Item {
272 }
272 }
273
273
274 var isActive = app.appId == priv.mainStageAppId || app.appId == priv.sideStageAppId;
274 var isActive = app.appId == priv.mainStageAppId || app.appId == priv.sideStageAppId;
275− if (isActive && app.stage == ApplicationInfoInterface.MainStage) return 0;
275+ if (isActive && app.stage == ApplicationInfoInterface.MainStage) {
276+ return 0;
277+ }
276 if (isActive && app.stage == ApplicationInfoInterface.SideStage) {
278 if (isActive && app.stage == ApplicationInfoInterface.SideStage) {
277 if (!priv.mainStageAppId) {
279 if (!priv.mainStageAppId) {
278 // only have SS apps running
280 // only have SS apps running
@@ -438,6 +440,18 @@ Item {
438 UbuntuNumberAnimation {}
440 UbuntuNumberAnimation {}
439 }
441 }
440
442
443+ // This is required because none of the bindings are triggered in some cases:
444+ // When an app is closed, it might happen that ApplicationManager.get(nextInStack)
445+ // returns a different app even though the nextInStackIndex and all the related
446+ // bindings (index, mainStageApp, sideStageApp, etc) don't change. Let's force a
447+ // binding update in that case.
448+ Connections {
449+ target: ApplicationManager
450+ onApplicationRemoved: spreadTile.z = Qt.binding(function() {
451+ return spreadView.indexToZIndex(index)
452+ })
453+ }
454+
441 progress: {
455 progress: {
442 var tileProgress = (spreadView.contentX - behavioredZIndex * spreadView.tileDistance) / spreadView.width;
456 var tileProgress = (spreadView.contentX - behavioredZIndex * spreadView.tileDistance) / spreadView.width;
443 // Some tiles (nextInStack, active) need to move directly from the beginning, normalize progress to immediately start at 0
457 // Some tiles (nextInStack, active) need to move directly from the beginning, normalize progress to immediately start at 0
qml/Stages/TransformedTabletSpreadDelegate.qml+2
@@ -78,7 +78,9 @@ SpreadDelegate {
78 Item {
78 Item {
79 id: priv
79 id: priv
80
80
81+ // true if this is the next tile on the stack that comes in when dragging from the right
81 property bool nextInStack: spreadView.nextZInStack == zIndex
82 property bool nextInStack: spreadView.nextZInStack == zIndex
83+ // true if the next tile in the stack is the nextInStack one. This one will be moved a bit to the left
82 property bool movedActive: spreadView.nextZInStack == zIndex + 1
84 property bool movedActive: spreadView.nextZInStack == zIndex + 1
83 property real animatedEndDistance: linearAnimation(0, 2, root.endDistance, 0, root.progress)
85 property real animatedEndDistance: linearAnimation(0, 2, root.endDistance, 0, root.progress)
84
86