on xenial help sign in
Revert shell rotation.
commit00b6d215da7b2990413ac81474fac292bf46ea23 authorMichał Sawicz <michal.sawicz@canonical.com> dateWed 5 Mar 2014, 13:52 (13 years ago) parent2c28049
7 files changed+18−89
debian/unity8.install−1 qml/Components/ApplicationManagerWrapper.qml−8 qml/Components/ApplicationScreenshot.qml+2−1 qml/Panel/MenuContent.qml−1 qml/Shell.qml+15−24 qml/ShellOrientator.qml−43 src/main.cpp+1−11
debian/unity8.install−1
@@ -10,7 +10,6 @@ usr/share/unity8/Launcher
1010usr/share/unity8/Notifications
1111usr/share/unity8/Panel
1212usr/share/unity8/Shell.qml
13−usr/share/unity8/ShellOrientator.qml
1413usr/share/unity8/SideStage
1514usr/share/unity8/graphics
1615data/unity8.conf usr/share/upstart/sessions/
qml/Components/ApplicationManagerWrapper.qml−8
@@ -166,12 +166,4 @@ Item {
166166 }
167167 return desktopFile.substring(left+1, right);
168168 }
169−
170− function setMainStageAppRect(item) {
171− ApplicationManager.setMainStageAppRect(item);
172− }
173−
174− function setSideStageAppRect(item) {
175− ApplicationManager.setSideStageAppRect(item);
176− }
177169}
qml/Components/ApplicationScreenshot.qml+2−1
@@ -53,7 +53,8 @@ Item {
5353 ApplicationImage {
5454 id: applicationImage
5555 objectName: "screenshot image"
56− anchors.fill: parent
56+ width: applicationScreenshot.application ? parent.width : 0
57+ height: applicationScreenshot.application ? parent.height : 0
5758 visible: applicationScreenshot.application != null && ready
5859 source: ApplicationManager.findApplication((application) ? application.appId : "")
5960 }
qml/Panel/MenuContent.qml−1
@@ -26,7 +26,6 @@ import "../Components"
2626MainView {
2727 id: content
2828
29− nativeOrientationAngle: 0 // stop contents being re-rotated when shell in landscape
3029 property QtObject indicatorsModel: null
3130 property bool __contentActive: false
3231 readonly property int currentMenuIndex: tabs.selectedTabIndex
qml/Shell.qml+15−24
@@ -37,7 +37,6 @@ import Unity.Notifications 1.0 as NotificationBackend
3737
3838FocusScope {
3939 id: shell
40− objectName: "shell"
4140
4241 // this is only here to select the width / height of the window if not running fullscreen
4342 property bool tablet: false
@@ -78,9 +77,6 @@ FocusScope {
7877 // FIXME: if application focused before shell starts, shell draws on top of it only.
7978 // We should detect already running applications on shell start and bring them to the front.
8079 applicationManager.unfocusCurrentApplication();
81−
82− applicationManager.setMainStageAppRect(mainStageAppRect);
83− applicationManager.setSideStageAppRect(sideStageAppRect);
8480 }
8581
8682 // Used for autopilot testing.
@@ -413,26 +409,6 @@ FocusScope {
413409 orientation: Qt.Horizontal
414410 }
415411
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−
436412 DragHandle {
437413 id: stagesDragHandle
438414
@@ -825,6 +801,21 @@ FocusScope {
825801 value: "unity8"
826802 }
827803
804+ OSKController {
805+ anchors.topMargin: panel.panelHeight
806+ anchors.fill: parent // as needs to know the geometry of the shell
807+ }
808+
809+ //FIXME: This should be handled in the input stack, keyboard shouldnt propagate
810+ MouseArea {
811+ anchors.bottom: parent.bottom
812+ anchors.left: parent.left
813+ anchors.right: parent.right
814+ height: shell.applicationManager ? shell.applicationManager.keyboardHeight : 0
815+
816+ enabled: shell.applicationManager && shell.applicationManager.keyboardVisible
817+ }
818+
828819 Label {
829820 anchors.centerIn: parent
830821 visible: applicationManager.fake
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)
9898 view->setFlags(Qt::FramelessWindowHint);
9999 }
100100
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−
111101 // You will need this if you want to interact with touch-only components using a mouse
112102 // Needed only when manually testing on a desktop.
113103 MouseTouchAdaptor *mouseTouchAdaptor = 0;
@@ -125,7 +115,7 @@ int startShell(int argc, const char** argv, void* server)
125115 nativeInterface->setProperty("ubuntuSessionType", 1);
126116 view->setProperty("role", 2); // INDICATOR_ACTOR_ROLE
127117
128− QUrl source(::qmlDirectory()+"ShellOrientator.qml");
118+ QUrl source(::qmlDirectory()+"Shell.qml");
129119 prependImportPaths(view->engine(), ::overrideImportPaths());
130120 appendImportPaths(view->engine(), ::fallbackImportPaths());
131121