on xenial help sign in
start dropping AbstractStage
commit275578b002bceb177e5344c823897c3a34c11ae6 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 13 Sep 2016, 14:02 (10 years ago) parent3846937
3 files changed+13−36
qml/Stage/AbstractStage.qml−28 qml/Stage/Stage.qml+13−5 qml/Stage/StageMaths.qml−3
qml/Stage/AbstractStage.qml−28
@@ -46,20 +46,6 @@ FocusScope {
4646 property alias paintBackground: background.visible
4747 property bool oskEnabled: false
4848
49− // To be read from outside
50− property var mainApp: null
51− property int mainAppWindowOrientationAngle: 0
52− property bool orientationChangesEnabled
53− property int supportedOrientations: Qt.PortraitOrientation
54− | Qt.LandscapeOrientation
55− | Qt.InvertedPortraitOrientation
56− | Qt.InvertedLandscapeOrientation
57−
58− property Item itemConfiningMouseCursor: null
59−
60−
61− signal stageAboutToBeUnloaded
62− signal itemSnapshotRequested(Item item)
6349
6450 // Shared code for use in stage implementations
6551 GSettings {
@@ -76,18 +62,4 @@ FocusScope {
7662 }
7763 return false;
7864 }
79−
80− Rectangle {
81− id: background
82− color: "#060606"
83− anchors.fill: parent
84− }
85−
86− // shared Alt+F4 functionality
87− function closeFocusedDelegate() {} // to be implemented by stages
88−
89− GlobalShortcut {
90− shortcut: Qt.AltModifier|Qt.Key_F4
91− onTriggered: closeFocusedDelegate()
92− }
9365}
qml/Stage/Stage.qml+13−5
@@ -50,14 +50,14 @@ AbstractStage {
5050 // used by the snap windows (edge maximize) feature
5151 readonly property alias previewRectangle: fakeRectangle
5252
53− mainApp: priv.focusedAppDelegate ? priv.focusedAppDelegate.application : null
53+ property var mainApp: priv.focusedAppDelegate ? priv.focusedAppDelegate.application : null
5454
5555 // application windows never rotate independently
56− mainAppWindowOrientationAngle: shellOrientationAngle
56+ property int mainAppWindowOrientationAngle: shellOrientationAngle
5757
58− orientationChangesEnabled: true
58+ property bool orientationChangesEnabled: true
5959
60− supportedOrientations: {
60+ property int supportedOrientations: {
6161 if (mainApp) {
6262 switch (mode) {
6363 case "staged":
@@ -83,10 +83,18 @@ AbstractStage {
8383
8484 onAltTabPressedChanged: priv.goneToSpread = altTabPressed
8585
86− itemConfiningMouseCursor: !spreadShown && priv.focusedAppDelegate && priv.focusedAppDelegate.surface &&
86+ property Item itemConfiningMouseCursor: !spreadShown && priv.focusedAppDelegate && priv.focusedAppDelegate.surface &&
8787 priv.focusedAppDelegate.surface.confinesMousePointer ?
8888 priv.focusedAppDelegate.clientAreaItem : null;
8989
90+ signal itemSnapshotRequested(Item item)
91+
92+ GlobalShortcut {
93+ id: closeFocusedShortcut
94+ shortcut: Qt.AltModifier|Qt.Key_F4
95+ onTriggered: closeFocusedDelegate()
96+ }
97+
9098 GlobalShortcut {
9199 id: showSpreadShortcut
92100 shortcut: Qt.MetaModifier|Qt.Key_W
qml/Stage/StageMaths.qml−3
@@ -19,9 +19,6 @@ QtObject {
1919 property var sideStageDelegate: null
2020
2121 // output
22−// readonly property int itemZ: stage == ApplicationInfoInterface.MainStage ? 0 :
23−// stage == ApplicationInfoInterface.SideStage ? 2 :
24−// itemIndex + 2
2522
2623 // We need to shuffle z ordering a bit in order to keep side stage apps above main stage apps.
2724 // We don't want to really reorder them in the model because that allows us to keep track