on xenial help sign in
start dropping AbstractStage
275578bMichael Zanetti
qml/Stage/AbstractStage.qml−28
@@ -46,20 +46,6 @@ FocusScope {
46 property alias paintBackground: background.visible
46 property alias paintBackground: background.visible
47 property bool oskEnabled: false
47 property bool oskEnabled: false
48
48
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)
63
49
64 // Shared code for use in stage implementations
50 // Shared code for use in stage implementations
65 GSettings {
51 GSettings {
@@ -76,18 +62,4 @@ FocusScope {
76 }
62 }
77 return false;
63 return false;
78 }
64 }
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− }
93}
65}
qml/Stage/Stage.qml+13−5
@@ -50,14 +50,14 @@ AbstractStage {
50 // used by the snap windows (edge maximize) feature
50 // used by the snap windows (edge maximize) feature
51 readonly property alias previewRectangle: fakeRectangle
51 readonly property alias previewRectangle: fakeRectangle
52
52
53− mainApp: priv.focusedAppDelegate ? priv.focusedAppDelegate.application : null
53+ property var mainApp: priv.focusedAppDelegate ? priv.focusedAppDelegate.application : null
54
54
55 // application windows never rotate independently
55 // application windows never rotate independently
56− mainAppWindowOrientationAngle: shellOrientationAngle
56+ property int mainAppWindowOrientationAngle: shellOrientationAngle
57
57
58− orientationChangesEnabled: true
58+ property bool orientationChangesEnabled: true
59
59
60− supportedOrientations: {
60+ property int supportedOrientations: {
61 if (mainApp) {
61 if (mainApp) {
62 switch (mode) {
62 switch (mode) {
63 case "staged":
63 case "staged":
@@ -83,10 +83,18 @@ AbstractStage {
83
83
84 onAltTabPressedChanged: priv.goneToSpread = altTabPressed
84 onAltTabPressedChanged: priv.goneToSpread = altTabPressed
85
85
86− itemConfiningMouseCursor: !spreadShown && priv.focusedAppDelegate && priv.focusedAppDelegate.surface &&
86+ property Item itemConfiningMouseCursor: !spreadShown && priv.focusedAppDelegate && priv.focusedAppDelegate.surface &&
87 priv.focusedAppDelegate.surface.confinesMousePointer ?
87 priv.focusedAppDelegate.surface.confinesMousePointer ?
88 priv.focusedAppDelegate.clientAreaItem : null;
88 priv.focusedAppDelegate.clientAreaItem : null;
89
89
90+ signal itemSnapshotRequested(Item item)
91+
92+ GlobalShortcut {
93+ id: closeFocusedShortcut
94+ shortcut: Qt.AltModifier|Qt.Key_F4
95+ onTriggered: closeFocusedDelegate()
96+ }
97+
90 GlobalShortcut {
98 GlobalShortcut {
91 id: showSpreadShortcut
99 id: showSpreadShortcut
92 shortcut: Qt.MetaModifier|Qt.Key_W
100 shortcut: Qt.MetaModifier|Qt.Key_W
qml/Stage/StageMaths.qml−3
@@ -19,9 +19,6 @@ QtObject {
19 property var sideStageDelegate: null
19 property var sideStageDelegate: null
20
20
21 // output
21 // output
22−// readonly property int itemZ: stage == ApplicationInfoInterface.MainStage ? 0 :
23−// stage == ApplicationInfoInterface.SideStage ? 2 :
24−// itemIndex + 2
25
22
26 // We need to shuffle z ordering a bit in order to keep side stage apps above main stage apps.
23 // We need to shuffle z ordering a bit in order to keep side stage apps above main stage apps.
27 // We don't want to really reorder them in the model because that allows us to keep track
24 // We don't want to really reorder them in the model because that allows us to keep track