on xenial help sign in
Property focus the foreground application surface
commiteb21682a27397db78b7a489a20a44fed02218a0b authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateTue 1 Jul 2014, 18:28 (12 years ago) parent5bc004e
3 files changed+16−2
qml/Shell.qml+5 qml/Stages/PhoneStage.qml+4−1 qml/Stages/SpreadDelegate.qml+7−1
qml/Shell.qml+5
@@ -275,6 +275,11 @@ FocusScope {
275275 property: "maximizedAppTopMargin"
276276 value: panel.panelHeight
277277 }
278+ Binding {
279+ target: applicationsDisplayLoader.item
280+ property: "interactive"
281+ value: stages.roughlyFullyShown
282+ }
278283 }
279284 }
280285
qml/Stages/PhoneStage.qml+4−1
@@ -27,6 +27,7 @@ Item {
2727 // Controls to be set from outside
2828 property int dragAreaWidth
2929 property real maximizedAppTopMargin
30+ property bool interactive
3031
3132 // State information propagated to the outside
3233 property bool fullscreen: priv.focusedApplication ? priv.focusedApplication.fullscreen : false
@@ -247,7 +248,9 @@ Item {
247248 height: spreadView.height
248249 selected: spreadView.selectedIndex == index
249250 otherSelected: spreadView.selectedIndex >= 0 && !selected
250− interactive: !spreadView.interactive
251+ interactive: !spreadView.interactive && spreadView.phase === 0
252+ && spreadView.shiftedContentX === 0 && root.interactive && index === 0
253+ swipeToCloseEnabled: spreadView.interactive
251254 maximizedAppTopMargin: root.maximizedAppTopMargin
252255 dropShadow: spreadView.shiftedContentX > 0 || spreadDragArea.status == DirectionalDragArea.Undecided
253256
qml/Stages/SpreadDelegate.qml+7−1
@@ -24,9 +24,11 @@ import "../Components"
2424Item {
2525 id: root
2626
27+ // to be set from outside
2728 property bool interactive: true
2829 property bool dropShadow: true
2930 property real maximizedAppTopMargin
31+ property alias swipeToCloseEnabled: dragArea.enabled
3032
3133 readonly property bool isFullscreen: surface !== null && surfaceContainer.surface.anchors.topMargin == 0
3234
@@ -71,6 +73,11 @@ Item {
7173 property: "enabled"
7274 value: root.interactive
7375 }
76+ Binding {
77+ target: surface
78+ property: "focus"
79+ value: root.interactive
80+ }
7481
7582 Timer { //FIXME - need to delay removing splash screen to allow surface resize to complete
7683 id: surfaceRevealDelay
@@ -136,7 +143,6 @@ Item {
136143 DraggingArea {
137144 id: dragArea
138145 anchors.fill: parent
139− enabled: !root.interactive
140146
141147 property bool moving: false
142148 property real distance: 0