on xenial help sign in
dropped AbstractStage
commit1930962582c283e936810857b4f452c38ea76545 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 20 Sep 2016, 13:59 (10 years ago) parentee3e29d
2 files changed+36−65
qml/Stage/AbstractStage.qml−61 qml/Stage/Stage.qml+36−4
qml/Stage/AbstractStage.qmldeleted−61
@@ -1,61 +0,0 @@
1−/*
2− * Copyright (C) 2015-2016 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.4
18−import Ubuntu.Components 1.3
19−import GlobalShortcut 1.0
20−import GSettings 1.0
21−
22−FocusScope {
23− id: root
24−
25− // Controls to be set from outside
26− property QtObject applicationManager
27− property QtObject topLevelSurfaceList
28− property bool altTabPressed
29− property url background
30− property bool beingResized
31− property int dragAreaWidth
32− property bool interactive
33− property bool keepDashRunning: true
34− property real maximizedAppTopMargin
35− property real nativeHeight
36− property real nativeWidth
37− property QtObject orientations
38− property int shellOrientation
39− property int shellOrientationAngle
40− property bool spreadEnabled: true // If false, animations and right edge will be disabled
41− property bool suspended
42−
43− property int leftMargin: 0
44− property bool oskEnabled: false
45−
46− // Shared code for use in stage implementations
47− GSettings {
48− id: lifecycleExceptions
49− schema.id: "com.canonical.qtmir"
50− }
51−
52− function isExemptFromLifecycle(appId) {
53− var shortAppId = appId.split('_')[0];
54− for (var i = 0; i < lifecycleExceptions.lifecycleExemptAppids.length; i++) {
55− if (shortAppId === lifecycleExceptions.lifecycleExemptAppids[i]) {
56− return true;
57− }
58− }
59− return false;
60− }
61−}
qml/Stage/Stage.qml+36−4
@@ -22,13 +22,33 @@ import "../Components"
2222import Utils 0.1
2323import Ubuntu.Gestures 0.1
2424import GlobalShortcut 1.0
25+import GSettings 1.0
2526import "Spread"
2627import "Spread/MathUtils.js" as MathUtils
2728
28−AbstractStage {
29+FocusScope {
2930 id: root
3031 anchors.fill: parent
3132
33+ property QtObject applicationManager
34+ property QtObject topLevelSurfaceList
35+ property bool altTabPressed
36+ property url background
37+ property bool beingResized
38+ property int dragAreaWidth
39+ property bool interactive
40+ property bool keepDashRunning: true
41+ property real maximizedAppTopMargin
42+ property real nativeHeight
43+ property real nativeWidth
44+ property QtObject orientations
45+ property int shellOrientation
46+ property int shellOrientationAngle
47+ property bool spreadEnabled: true // If false, animations and right edge will be disabled
48+ property bool suspended
49+ property int leftMargin: 0
50+ property bool oskEnabled: false
51+
3252 // Congifuration
3353 property string mode: "staged"
3454 property real leftEdgeDragProgress: 0
@@ -91,6 +111,21 @@ AbstractStage {
91111 }
92112 }
93113
114+ GSettings {
115+ id: lifecycleExceptions
116+ schema.id: "com.canonical.qtmir"
117+ }
118+
119+ function isExemptFromLifecycle(appId) {
120+ var shortAppId = appId.split('_')[0];
121+ for (var i = 0; i < lifecycleExceptions.lifecycleExemptAppids.length; i++) {
122+ if (shortAppId === lifecycleExceptions.lifecycleExemptAppids[i]) {
123+ return true;
124+ }
125+ }
126+ return false;
127+ }
128+
94129 GlobalShortcut {
95130 id: closeFocusedShortcut
96131 shortcut: Qt.AltModifier|Qt.Key_F4
@@ -412,12 +447,9 @@ AbstractStage {
412447 script: {
413448 var item = appRepeater.itemAt(Math.max(0, spreadItem.highlightedIndex));
414449 if (item.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
415− print("showing sidestage")
416450 sideStage.show();
417451 }
418−
419452 item.playFocusAnimation();
420− print("playing focus animation for item", item.appId, "stage:", item.stage, "shown", sideStage.shown)
421453 }
422454 }
423455 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }