on xenial help sign in
Merge lp:~unity-team/unity8/new-scopes-clean-to-trunk
3f81874Michał Sawicz
debian/unity8.install−1
@@ -10,7 +10,6 @@ usr/share/unity8/Launcher
10usr/share/unity8/Notifications
10usr/share/unity8/Notifications
11usr/share/unity8/Panel
11usr/share/unity8/Panel
12usr/share/unity8/Shell.qml
12usr/share/unity8/Shell.qml
13−usr/share/unity8/ShellOrientator.qml
14usr/share/unity8/SideStage
13usr/share/unity8/SideStage
15usr/share/unity8/graphics
14usr/share/unity8/graphics
16data/unity8.conf usr/share/upstart/sessions/
15data/unity8.conf usr/share/upstart/sessions/
qml/Components/ApplicationManagerWrapper.qml−8
@@ -166,12 +166,4 @@ Item {
166 }
166 }
167 return desktopFile.substring(left+1, right);
167 return desktopFile.substring(left+1, right);
168 }
168 }
169−
170− function setMainStageAppRect(item) {
171− ApplicationManager.setMainStageAppRect(item);
172− }
173−
174− function setSideStageAppRect(item) {
175− ApplicationManager.setSideStageAppRect(item);
176− }
177}
169}
qml/Components/ApplicationScreenshot.qml+2−1
@@ -53,7 +53,8 @@ Item {
53 ApplicationImage {
53 ApplicationImage {
54 id: applicationImage
54 id: applicationImage
55 objectName: "screenshot image"
55 objectName: "screenshot image"
56− anchors.fill: parent
56+ width: applicationScreenshot.application ? parent.width : 0
57+ height: applicationScreenshot.application ? parent.height : 0
57 visible: applicationScreenshot.application != null && ready
58 visible: applicationScreenshot.application != null && ready
58 source: ApplicationManager.findApplication((application) ? application.appId : "")
59 source: ApplicationManager.findApplication((application) ? application.appId : "")
59 }
60 }
qml/Components/Showable.qml−8
@@ -107,9 +107,6 @@ Item {
107 if (!hideAnimation.running) {
107 if (!hideAnimation.running) {
108 hideAnimation.restart()
108 hideAnimation.restart()
109 }
109 }
110− if (__skipShowAnimation) {
111− hideAnimation.complete();
112− }
113 } else {
110 } else {
114 visible = false
111 visible = false
115 required = false
112 required = false
@@ -118,11 +115,6 @@ Item {
118 shown = false
115 shown = false
119 }
116 }
120
117
121− function hideNow() {
122− __skipShowAnimation = true;
123− hide();
124− }
125−
126 Connections {
118 Connections {
127 target: hideAnimation ? hideAnimation: null
119 target: hideAnimation ? hideAnimation: null
128 onRunningChanged: {
120 onRunningChanged: {
qml/Components/Stage.qml+5
@@ -86,6 +86,11 @@ Showable {
86 }
86 }
87 }
87 }
88
88
89+ Connections {
90+ target: applicationManager
91+ onFocusRequested: activateApplication(appId)
92+ }
93+
89 /* Keep a reference to the focused application so that we can safely
94 /* Keep a reference to the focused application so that we can safely
90 unfocus it when the stage is not fully shown and refocus it when the stage
95 unfocus it when the stage is not fully shown and refocus it when the stage
91 is fully shown again.
96 is fully shown again.
qml/Dash/Apps/RunningApplicationsGrid.qml−30
@@ -27,12 +27,6 @@ ResponsiveFlowView {
27 property alias enableHeightBehavior: heightBehaviour.enabled
27 property alias enableHeightBehavior: heightBehaviour.enabled
28 property bool enableHeightBehaviorOnNextCreation: firstModel.count + secondModel.count == 0
28 property bool enableHeightBehaviorOnNextCreation: firstModel.count + secondModel.count == 0
29
29
30− /// Whether this is the first item in the list
31− property bool firstItem: false
32−
33− /// Whether this is the last item in the list
34− property bool lastItem: false
35−
36 Connections {
30 Connections {
37 target: shell
31 target: shell
38 onDashShownChanged: if (shell.dashShown && shell.stageScreenshotsReady) updateScreenshots();
32 onDashShownChanged: if (shell.dashShown && shell.stageScreenshotsReady) updateScreenshots();
@@ -123,28 +117,4 @@ ResponsiveFlowView {
123 root.terminationModeEnabled = false;
117 root.terminationModeEnabled = false;
124 }
118 }
125 }
119 }
126−
127− Image {
128− visible: !firstItem
129− anchors {
130− top: parent.top
131− left: parent.left
132− right: parent.right
133− }
134− fillMode: Image.Stretch
135− source: "../graphics/dash_divider_top_lightgrad.png"
136− z: -1
137− }
138−
139− Image {
140− visible: !lastItem
141− anchors {
142− bottom: parent.bottom
143− left: parent.left
144− right: parent.right
145− }
146− fillMode: Image.Stretch
147− source: "../graphics/dash_divider_top_darkgrad.png"
148− z: -1
149− }
150}
120}
qml/Dash/DashFilterGrid.qml−2
@@ -31,8 +31,6 @@ DashRenderer {
31 property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing
31 property alias minimumHorizontalSpacing: filterGrid.minimumHorizontalSpacing
32 property alias collapsedRowCount: filterGrid.collapsedRowCount
32 property alias collapsedRowCount: filterGrid.collapsedRowCount
33
33
34− property FilterGrid grid: filterGrid
35−
36 collapsedHeight: filterGrid.collapsedHeight
34 collapsedHeight: filterGrid.collapsedHeight
37 columns: filterGrid.columns
35 columns: filterGrid.columns
38 rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount
36 rows: filter ? filterGrid.collapsedRowCount : filterGrid.uncollapsedRowCount
qml/Dash/DashRenderer.qml−30
@@ -68,34 +68,4 @@ Item {
68
68
69 /// Component mapping and configuration from the scope
69 /// Component mapping and configuration from the scope
70 property var components
70 property var components
71−
72− /// Whether this is the first item in the list
73− property bool firstItem: false
74−
75− /// Whether this is the last item in the list
76− property bool lastItem: false
77−
78− Image {
79− visible: !firstItem
80− anchors {
81− top: parent.top
82− left: parent.left
83− right: parent.right
84− }
85− fillMode: Image.Stretch
86− source: "graphics/dash_divider_top_lightgrad.png"
87− z: -1
88− }
89−
90− Image {
91− visible: !lastItem
92− anchors {
93− bottom: parent.bottom
94− left: parent.left
95− right: parent.right
96− }
97− fillMode: Image.Stretch
98− source: "graphics/dash_divider_top_darkgrad.png"
99− z: -1
100− }
101}
71}
qml/Dash/GenericScopeView.qml+25−3
@@ -144,9 +144,6 @@ FocusScope {
144 source: getRenderer(model.renderer, results)
144 source: getRenderer(model.renderer, results)
145
145
146 onLoaded: {
146 onLoaded: {
147− item.firstItem = Qt.binding(function() { return index === 0 });
148− // FIXME Should not rely on count field of model, SortfilterProxyModel in this case.
149− item.lastItem = Qt.binding(function() { return index === categoryView.model.count - 1 });
150 if (item.enableHeightBehavior !== undefined && item.enableHeightBehaviorOnNextCreation !== undefined) {
147 if (item.enableHeightBehavior !== undefined && item.enableHeightBehaviorOnNextCreation !== undefined) {
151 item.enableHeightBehavior = scopeView.enableHeightBehaviorOnNextCreation;
148 item.enableHeightBehavior = scopeView.enableHeightBehaviorOnNextCreation;
152 scopeView.enableHeightBehaviorOnNextCreation = false;
149 scopeView.enableHeightBehaviorOnNextCreation = false;
@@ -258,6 +255,31 @@ FocusScope {
258 }
255 }
259 }
256 }
260 }
257 }
258+
259+ Image {
260+ visible: index != 0
261+ anchors {
262+ top: parent.top
263+ left: parent.left
264+ right: parent.right
265+ }
266+ fillMode: Image.Stretch
267+ source: "graphics/dash_divider_top_lightgrad.png"
268+ z: -1
269+ }
270+
271+ Image {
272+ // FIXME Should not rely on count field of model, SortfilterProxyModel in this case.
273+ visible: index != categoryView.model.count - 1
274+ anchors {
275+ bottom: parent.bottom
276+ left: parent.left
277+ right: parent.right
278+ }
279+ fillMode: Image.Stretch
280+ source: "graphics/dash_divider_top_darkgrad.png"
281+ z: -1
282+ }
261 }
283 }
262
284
263 onHeightChanged: rendererLoader.updateDelegateCreationRange();
285 onHeightChanged: rendererLoader.updateDelegateCreationRange();
qml/Panel/MenuContent.qml−1
@@ -26,7 +26,6 @@ import "../Components"
26MainView {
26MainView {
27 id: content
27 id: content
28
28
29− nativeOrientationAngle: 0 // stop contents being re-rotated when shell in landscape
30 property QtObject indicatorsModel: null
29 property QtObject indicatorsModel: null
31 property bool __contentActive: false
30 property bool __contentActive: false
32 readonly property int currentMenuIndex: tabs.selectedTabIndex
31 readonly property int currentMenuIndex: tabs.selectedTabIndex
qml/Shell.qml+75−145
@@ -37,7 +37,6 @@ import Unity.Notifications 1.0 as NotificationBackend
37
37
38FocusScope {
38FocusScope {
39 id: shell
39 id: shell
40− objectName: "shell"
41
40
42 // this is only here to select the width / height of the window if not running fullscreen
41 // this is only here to select the width / height of the window if not running fullscreen
43 property bool tablet: false
42 property bool tablet: false
@@ -78,11 +77,10 @@ FocusScope {
78 // FIXME: if application focused before shell starts, shell draws on top of it only.
77 // FIXME: if application focused before shell starts, shell draws on top of it only.
79 // We should detect already running applications on shell start and bring them to the front.
78 // We should detect already running applications on shell start and bring them to the front.
80 applicationManager.unfocusCurrentApplication();
79 applicationManager.unfocusCurrentApplication();
81−
82− applicationManager.setMainStageAppRect(mainStageAppRect);
83− applicationManager.setSideStageAppRect(sideStageAppRect);
84 }
80 }
85
81
82+ readonly property bool applicationFocused: !!applicationManager.mainStageFocusedApplication
83+ || !!applicationManager.sideStageFocusedApplication
86 // Used for autopilot testing.
84 // Used for autopilot testing.
87 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
85 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
88
86
@@ -118,11 +116,6 @@ FocusScope {
118 }
116 }
119 }
117 }
120
118
121− Connections {
122− target: applicationManager
123− onFocusRequested: activateApplication(appId)
124− }
125−
126 GSettings {
119 GSettings {
127 id: backgroundSettings
120 id: backgroundSettings
128 schema.id: "org.gnome.desktop.background"
121 schema.id: "org.gnome.desktop.background"
@@ -147,94 +140,66 @@ FocusScope {
147 // Whether the underlay is fully covered by opaque UI elements.
140 // Whether the underlay is fully covered by opaque UI elements.
148 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
141 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
149
142
150− readonly property bool mainStageApplicationRunning: mainStage.applications && mainStage.applications.count > 0
143+ readonly property bool applicationRunning: ((mainStage.applications && mainStage.applications.count > 0)
151− readonly property bool sideStageApplicationRunning: sideStage.applications && sideStage.applications.count > 0
144+ || (sideStage.applications && sideStage.applications.count > 0))
152
145
153 // Whether the user should see the topmost application surface (if there's one at all).
146 // Whether the user should see the topmost application surface (if there's one at all).
154− readonly property bool mainStageApplicationShown: mainStageApplicationRunning && !stages.fullyHidden
147+ readonly property bool applicationSurfaceShouldBeSeen: applicationRunning && !stages.fullyHidden
155 && !mainStage.usingScreenshots // but want sideStage animating over app surface
148 && !mainStage.usingScreenshots // but want sideStage animating over app surface
156
149
157
150
158
151
159 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
152 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
160 // through the translucent parts of the shell surface.
153 // through the translucent parts of the shell surface.
161− visible: !fullyCovered && !mainStageApplicationShown
154+ visible: !fullyCovered && !applicationSurfaceShouldBeSeen
162−
163− Item {
164− id: underlayClipper
165− clip: !parent.mainStageApplicationShown && parent.sideStageApplicationRunning && stagesOuterContainer.showProgress > 0
166− width: {
167− if (clip) {
168− var w = parent.width - sideStage.width
169− w += stagesOuterContainer.x + stages.x + (sideStage.x - sideStageRevealer.openedValue)
170− return Math.min(w, parent.width);
171− } else {
172− return parent.width;
173− }
174− }
175− height: parent.height
176
155
177− Image {
156+ Rectangle {
178− anchors.fill: dash
157+ anchors.fill: parent
179− source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
158+ color: "black"
180− fillMode: Image.PreserveAspectCrop
181− horizontalAlignment: Image.AlignRight
182− verticalAlignment: Image.AlignTop
183− }
184−
185− Dash {
186− id: dash
187− objectName: "dash"
188−
189− available: !greeter.shown && !lockscreen.shown
190− hides: [stages, launcher, panel.indicators]
191− shown: disappearingAnimationProgress !== 1.0
159+ opacity: dash.disappearingAnimationProgress
192− enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
193− // FIXME: unfocus all applications when going back to the dash
194− onEnabledChanged: {
195− if (enabled) {
196− shell.applicationManager.unfocusCurrentApplication()
197− }
198− }
160+ }
199
161
200− width: underlay.width
162+ Image {
201− height: underlay.height - y
163+ anchors.fill: dash
202− y: panel.panelHeight
164+ source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
203−
165+ fillMode: Image.PreserveAspectCrop
204− contentScale: 1.0 - 0.2 * disappearingAnimationProgress
166+ horizontalAlignment: Image.AlignRight
205− opacity: 1.0 - disappearingAnimationProgress
167+ verticalAlignment: Image.AlignTop
206− property real disappearingAnimationProgress: {
207− if (greeter.shown) {
208− return greeter.showProgress;
209− } else {
210− if (underlayClipper.clip)
211− return 0;
212− else
213− return stagesOuterContainer.showProgress;
214− }
215− }
168+ }
216
169
217− // FIXME: only necessary because stagesOuterContainer.showProgress and
170+ Dash {
218− // greeterRevealer.animatedProgress are not animated
171+ id: dash
219− Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
172+ objectName: "dash"
173+
174+ available: !greeter.shown && !lockscreen.shown
175+ hides: [stages, launcher, panel.indicators]
176+ shown: disappearingAnimationProgress !== 1.0
177+ enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
178+ // FIXME: unfocus all applications when going back to the dash
179+ onEnabledChanged: {
180+ if (enabled) {
181+ shell.applicationManager.unfocusCurrentApplication()
182+ }
220 }
183 }
221
184
222− Rectangle {
185+ anchors {
223− width: underlay.width
186+ fill: parent
224− height: underlay.height
187+ topMargin: panel.panelHeight
225− color: "black"
226− opacity: 0.5 * ((sideStage.x - sideStageRevealer.closedValue) / (sideStageRevealer.openedValue - sideStageRevealer.closedValue))
227− visible: sideStageHideButton.enabled
228 }
188 }
229
189
230− AbstractButton {
190+ contentScale: 1.0 - 0.2 * disappearingAnimationProgress
231− id: sideStageHideButton
191+ opacity: 1.0 - disappearingAnimationProgress
232− enabled: mainStage.applications.count == 0 && sideStage.shown
192+ property real disappearingAnimationProgress: {
233− anchors.fill: parent
193+ if (greeter.shown) {
234− onClicked: {
194+ return greeter.showProgress;
235− sideStage.hide();
195+ } else {
196+ return stagesOuterContainer.showProgress;
236 }
197 }
237 }
198 }
199+
200+ // FIXME: only necessary because stagesOuterContainer.showProgress and
201+ // greeterRevealer.animatedProgress are not animated
202+ Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
238 }
203 }
239 }
204 }
240
205
@@ -243,7 +208,7 @@ FocusScope {
243
208
244 width: parent.width
209 width: parent.width
245 height: parent.height
210 height: parent.height
246− x: mainStage.applications.count > 0 ? launcher.progress : 0
211+ x: launcher.progress
247 Behavior on x {SmoothedAnimation{velocity: 600}}
212 Behavior on x {SmoothedAnimation{velocity: 600}}
248
213
249 property real showProgress:
214 property real showProgress:
@@ -255,16 +220,6 @@ FocusScope {
255
220
256 x: width
221 x: width
257
222
258− function doLauncherHide() {
259− if (mainStage.applications.count > 0) {
260− hide();
261− } else {
262− if (sideStage.shown) {
263− sideStage.hide();
264− }
265− }
266− }
267−
268 property bool fullyShown: shown && x == 0 && parent.x == 0
223 property bool fullyShown: shown && x == 0 && parent.x == 0
269 property bool fullyHidden: !shown && x == width
224 property bool fullyHidden: !shown && x == width
270 available: !greeter.shown
225 available: !greeter.shown
@@ -349,6 +304,11 @@ FocusScope {
349 rightEdgeDraggingAreaWidth: shell.edgeSize
304 rightEdgeDraggingAreaWidth: shell.edgeSize
350 normalApplicationY: shell.panelHeight
305 normalApplicationY: shell.panelHeight
351
306
307+ onShownChanged: {
308+ if (!shown && mainStage.applications.count == 0) {
309+ stages.hide();
310+ }
311+ }
352 // FIXME: when hiding the side stage, refocus the main stage
312 // FIXME: when hiding the side stage, refocus the main stage
353 // application so that it goes in front of the side stage
313 // application so that it goes in front of the side stage
354 // application and hides it
314 // application and hides it
@@ -373,29 +333,12 @@ FocusScope {
373 width: units.gu(40)
333 width: units.gu(40)
374 height: stages.height
334 height: stages.height
375 handleExpanded: sideStageRevealer.pressed
335 handleExpanded: sideStageRevealer.pressed
376−
377− Connections {
378− target: sideStage.applications
379− onCountChanged: {
380− if (sideStage.applications.count == 0) {
381− if (sideStage.shown) { // if all SS app closed, hide side stage
382− sideStage.hide();
383− } else {
384− // Sidestage is hidden and there is no main app, make sure the
385− // stages is totally hidden too
386− if (mainStage.applications.count == 0) {
387− stages.hideNow();
388− }
389− }
390− }
391− }
392− }
393 }
336 }
394
337
395 Revealer {
338 Revealer {
396 id: sideStageRevealer
339 id: sideStageRevealer
397
340
398− enabled: sideStage.applications.count > 0
341+ enabled: mainStage.applications.count > 0 && sideStage.applications.count > 0
399 && sideStage.available
342 && sideStage.available
400 direction: Qt.RightToLeft
343 direction: Qt.RightToLeft
401 openedValue: parent.width - sideStage.width
344 openedValue: parent.width - sideStage.width
@@ -413,26 +356,6 @@ FocusScope {
413 orientation: Qt.Horizontal
356 orientation: Qt.Horizontal
414 }
357 }
415
358
416− // Defines the rectangle occupied by an application on the main or side stage.
417− // Used only to inform the ApplicationManager. Can be removed when the proper
418− // architecture is in place (unity8 as mir compositor).
419− Item {
420− id: mainStageAppRect
421− x: mainStage.x
422− y: mainStage.y + mainStage.normalApplicationY
423− width: mainStage.width
424− height: mainStage.height
425− visible: false; enabled: false
426− }
427− Item {
428− id: sideStageAppRect
429− x: sideStageRevealer.openedValue
430− y: sideStage.y + sideStage.normalApplicationY
431− width: sideStage.width
432− height: sideStage.height
433− visible: false; enabled: false
434− }
435−
436 DragHandle {
359 DragHandle {
437 id: stagesDragHandle
360 id: stagesDragHandle
438
361
@@ -516,7 +439,7 @@ FocusScope {
516 hides: [launcher, panel.indicators, hud]
439 hides: [launcher, panel.indicators, hud]
517 shown: true
440 shown: true
518
441
519− defaultBackground: shell.defaultBackground
442+ defaultBackground: shell.background
520
443
521 y: panel.panelHeight
444 y: panel.panelHeight
522 width: parent.width
445 width: parent.width
@@ -529,9 +452,7 @@ FocusScope {
529
452
530 function removeApplicationFocus() {
453 function removeApplicationFocus() {
531 greeter.previousMainApp = applicationManager.mainStageFocusedApplication;
454 greeter.previousMainApp = applicationManager.mainStageFocusedApplication;
532− if (sideStage.fullyShown) { // if side stage hidden, don't focus it on restore
533− greeter.previousSideApp = applicationManager.sideStageFocusedApplication;
455+ greeter.previousSideApp = applicationManager.sideStageFocusedApplication;
534− }
535 applicationManager.unfocusCurrentApplication();
456 applicationManager.unfocusCurrentApplication();
536 }
457 }
537
458
@@ -600,14 +521,8 @@ FocusScope {
600 }
521 }
601
522
602 InputFilterArea {
523 InputFilterArea {
603− width: {
524+ anchors.fill: parent
604− if (applicationManager.sideStageFocusedApplication && sideStage.shown)
605− return parent.width - sideStage.width;
606− else
607− return parent.width;
608− }
609− height: parent.height
610− blockInput: !applicationManager.mainStageFocusedApplication || greeter.shown || lockscreen.shown || launcher.shown
525+ blockInput: !applicationFocused || greeter.shown || lockscreen.shown || launcher.shown
611 || panel.indicators.shown || hud.shown
526 || panel.indicators.shown || hud.shown
612 }
527 }
613
528
@@ -709,7 +624,7 @@ FocusScope {
709 theHud: hud
624 theHud: hud
710 anchors.fill: parent
625 anchors.fill: parent
711 enabled: hud.available
626 enabled: hud.available
712− applicationIsOnForeground: (stages.shown && mainStage.applications.count > 0) || (stages.shown && sideStage.shown)
627+ applicationIsOnForeground: applicationFocused
713 }
628 }
714
629
715 InputFilterArea {
630 InputFilterArea {
@@ -731,7 +646,7 @@ FocusScope {
731 anchors.bottom: parent.bottom
646 anchors.bottom: parent.bottom
732 width: parent.width
647 width: parent.width
733 dragAreaWidth: shell.edgeSize
648 dragAreaWidth: shell.edgeSize
734− available: !greeter.locked && edgeDemo.launcherEnabled
649+ available: (!greeter.shown || greeter.narrowMode) && edgeDemo.launcherEnabled
735
650
736 onShowDashHome: {
651 onShowDashHome: {
737 if (edgeDemo.running)
652 if (edgeDemo.running)
@@ -741,7 +656,7 @@ FocusScope {
741 }
656 }
742 onDash: {
657 onDash: {
743 if (stages.shown) {
658 if (stages.shown) {
744− stages.doLauncherHide();
659+ stages.hide();
745 launcher.hide();
660 launcher.hide();
746 }
661 }
747 }
662 }
@@ -825,6 +740,21 @@ FocusScope {
825 value: "unity8"
740 value: "unity8"
826 }
741 }
827
742
743+ OSKController {
744+ anchors.topMargin: panel.panelHeight
745+ anchors.fill: parent // as needs to know the geometry of the shell
746+ }
747+
748+ //FIXME: This should be handled in the input stack, keyboard shouldnt propagate
749+ MouseArea {
750+ anchors.bottom: parent.bottom
751+ anchors.left: parent.left
752+ anchors.right: parent.right
753+ height: shell.applicationManager ? shell.applicationManager.keyboardHeight : 0
754+
755+ enabled: shell.applicationManager && shell.applicationManager.keyboardVisible
756+ }
757+
828 Label {
758 Label {
829 anchors.centerIn: parent
759 anchors.centerIn: parent
830 visible: applicationManager.fake
760 visible: applicationManager.fake
@@ -845,7 +775,7 @@ FocusScope {
845 launcher: launcher
775 launcher: launcher
846 dash: dash
776 dash: dash
847 indicators: panel.indicators
777 indicators: panel.indicators
848− underlay: underlayClipper
778+ underlay: underlay
849 }
779 }
850
780
851 Connections {
781 Connections {
qml/ShellOrientator.qmldeleted−43
@@ -1,43 +0,0 @@
1−/*
2− * Copyright (C) 2014 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.0
18−import QtQuick.Window 2.0
19−import Unity.Application 0.1
20−
21−Item {
22− id: orientator
23−
24− // this is only here to select the width / height of the window if not running fullscreen
25− property bool tablet: false
26− width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
27− height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
28−
29− Item {
30− anchors.fill: parent
31− rotation: Screen.angleBetween(nativeOrientation, Screen.primaryOrientation)
32− Shell {
33− x: (parent.rotation == 0) ? 0 : (parent.width - parent.height) / 2
34− y: (parent.rotation == 0) ? 0 : -(parent.width - parent.height) / 2
35− width: (parent.rotation == 0) ? parent.width : parent.height
36− height: (parent.rotation == 0) ? parent.height : parent.width
37− }
38− }
39−
40− OSKController {
41− anchors.fill: parent // as needs to know the geometry of the shell
42− }
43−}
src/main.cpp+1−11
@@ -98,16 +98,6 @@ int startShell(int argc, const char** argv, void* server)
98 view->setFlags(Qt::FramelessWindowHint);
98 view->setFlags(Qt::FramelessWindowHint);
99 }
99 }
100
100
101− const QByteArray orientation = qgetenv("NATIVE_ORIENTATION");
102− Qt::ScreenOrientation orientationAngle = Qt::PrimaryOrientation;
103− if (orientation == "landscape") {
104− orientationAngle = Qt::LandscapeOrientation;
105− } else if (!orientation.isEmpty() && orientation != "portrait") {
106− qDebug() << "Unknown NATIVE_ORIENTATION setting, ignoring";
107− }
108−
109− view->rootContext()->setContextProperty("nativeOrientation", orientationAngle);
110−
111 // You will need this if you want to interact with touch-only components using a mouse
101 // You will need this if you want to interact with touch-only components using a mouse
112 // Needed only when manually testing on a desktop.
102 // Needed only when manually testing on a desktop.
113 MouseTouchAdaptor *mouseTouchAdaptor = 0;
103 MouseTouchAdaptor *mouseTouchAdaptor = 0;
@@ -125,7 +115,7 @@ int startShell(int argc, const char** argv, void* server)
125 nativeInterface->setProperty("ubuntuSessionType", 1);
115 nativeInterface->setProperty("ubuntuSessionType", 1);
126 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
116 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
127
117
128− QUrl source(::qmlDirectory()+"ShellOrientator.qml");
118+ QUrl source(::qmlDirectory()+"Shell.qml");
129 prependImportPaths(view->engine(), ::overrideImportPaths());
119 prependImportPaths(view->engine(), ::overrideImportPaths());
130 appendImportPaths(view->engine(), ::fallbackImportPaths());
120 appendImportPaths(view->engine(), ::fallbackImportPaths());
131
121