on xenial help sign in
more work on side stage mode
commit6c15ac49cf5295e31592954db1a9a6316276ed5e authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 11 Jul 2016, 14:49 (10 years ago) parentfd4d1c9
4 files changed+53−8
debian/changelog+6 po/unity8.pot+2−2 qml/Stages/DesktopStage.qml+35−2 qml/Stages/StageMaths.qml+10−4
debian/changelog+6
@@ -1,3 +1,9 @@
1+unity8 (8.12+16.10.20160627.5-0ubuntu1local~1468240753) UNRELEASED; urgency=medium
2+
3+ * ''
4+
5+ -- Michael Zanetti <michael.zanetti@canonical.com> Mon, 11 Jul 2016 14:39:14 +0200
6+
17unity8 (8.12+16.10.20160627.5-0ubuntu1) yakkety; urgency=medium
28
39 [ Albert Astals Cid ]
po/unity8.pot+2−2
@@ -1,6 +1,6 @@
11# SOME DESCRIPTIVE TITLE.
22# Copyright (C) YEAR Canonical Ltd.
3−# This file is distributed under the same license as the PACKAGE package.
3+# This file is distributed under the same license as the unity8 package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
66#, fuzzy
@@ -8,7 +8,7 @@ msgid ""
88msgstr ""
99"Project-Id-Version: unity8\n"
1010"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2016-06-27 18:49+0000\n"
11+"POT-Creation-Date: 2016-07-11 14:39+0200\n"
1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414"Language-Team: LANGUAGE <LL@li.org>\n"
qml/Stages/DesktopStage.qml+35−2
@@ -208,6 +208,8 @@ AbstractStage {
208208
209209 print("*** updated! MainStage:", priv.mainStageAppId, "SideStage:", priv.sideStageAppId)
210210 }
211+
212+ property int nextInStack: 1
211213 }
212214
213215 Connections {
@@ -302,6 +304,7 @@ AbstractStage {
302304 State {
303305 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
304306 PropertyChanges { target: triGestureArea; enabled: true }
307+ PropertyChanges { target: priv; nextInStack: priv.sideStageDelegate ? 3 : 2 }
305308 },
306309 State {
307310 name: "windowed"; when: root.mode === "windowed"
@@ -353,6 +356,21 @@ AbstractStage {
353356 shown: false
354357 height: appContainer.height
355358 x: appContainer.width - width
359+ z: {
360+ if (!priv.mainStageItemId) return 0;
361+
362+ if (priv.sideStageItemId && priv.nextInStack > 0) {
363+ var nextDelegateInStack = appRepeater.itemAt(priv.nextInStack);
364+
365+ if (nextDelegateInStack.stage === ApplicationInfoInterface.MainStage) {
366+ // if the next app in stack is a main stage app, put the sidestage on top of it.
367+ return 2;
368+ }
369+ return 1;
370+ }
371+
372+ return 2;
373+ }
356374
357375 DropArea {
358376 id: sideStageDropArea
@@ -469,9 +487,10 @@ AbstractStage {
469487 property bool visuallyMinimized: false
470488
471489 property int stage: ApplicationInfoInterface.MainStage
472− function saveStage(stage) {
473− appDelegate.stage = stage;
490+ function saveStage(newStage) {
491+ appDelegate.stage = newStage;
474492 WindowStateStorage.saveStage(application.appId, newStage);
493+ priv.updateMainAndSideStageIndexes()
475494 }
476495
477496 readonly property var surface: model.surface
@@ -568,6 +587,12 @@ AbstractStage {
568587
569588 onVisuallyMaximizedChanged: priv.updateForegroundMaximizedApp()
570589
590+ onStageChanged: {
591+ if (!_constructing) {
592+ priv.updateMainAndSideStageIndexes();
593+ }
594+ }
595+
571596// visible: (
572597// !visuallyMinimized
573598// && !greeter.fullyShown
@@ -670,6 +695,8 @@ AbstractStage {
670695 thisDelegate: appDelegate
671696 mainStageDelegate: priv.mainStageDelegate
672697 sideStageDelegate: priv.sideStageDelegate
698+ sideStageWidth: sideStage.panelWidth
699+ sideStageX: sideStage.x
673700 }
674701
675702 StagedRightEdgeMaths {
@@ -758,6 +785,7 @@ AbstractStage {
758785 target: appDelegate
759786 x: stageMaths.itemX
760787 y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
788+ z: stageMaths.itemZ
761789 requestedWidth: stageMaths.itemWidth
762790 requestedHeight: appContainer.height - PanelState.panelHeight
763791 visuallyMaximized: true
@@ -1251,4 +1279,9 @@ AbstractStage {
12511279 }
12521280 }
12531281 }
1282+
1283+ Label {
1284+ anchors { left: parent.left; top: parent.top; margins: units.gu(4) }
1285+ text: "sidestage z: " + sideStage.z
1286+ }
12541287}
qml/Stages/StageMaths.qml+10−4
@@ -7,7 +7,8 @@ QtObject {
77 // input
88 property int itemIndex: 0
99 property int sceneWidth: 0
10− property int sideStageWidth: units.gu(40)
10+ property int sideStageWidth: 0
11+ property int sideStageX: sceneWidth
1112
1213 property int stage: ApplicationInfoInterface.MainStage
1314 property var thisDelegate: null
@@ -15,10 +16,15 @@ QtObject {
1516 property var sideStageDelegate: null
1617
1718 // output
18− readonly property int itemX: stage == ApplicationInfoInterface.MainStage ? 0 :
19− stage == ApplicationInfoInterface.SideStage ? sceneWidth - sideStageWidth :
19+ readonly property int itemZ: stage == ApplicationInfoInterface.MainStage ? 0 :
20+ stage == ApplicationInfoInterface.SideStage ? 2 :
21+ itemIndex + 2
22+
23+ readonly property int itemX: mainStageDelegate == thisDelegate ? 0 :
24+ sideStageDelegate == thisDelegate ? sideStageX :
2025 sceneWidth
2126
22− readonly property int itemWidth: stage == ApplicationInfoInterface.MainStage ? sceneWidth - sideStageWidth :
27+ readonly property int itemWidth: stage == ApplicationInfoInterface.MainStage ?
28+ sideStageDelegate != null ? sideStageX : sceneWidth :
2329 stage == ApplicationInfoInterface.SideStage ? sideStageWidth : sceneWidth
2430}