on xenial help sign in
restructure a bit, uninvert the launcher in desktop mode
commit5d1dfec8cab53d3afaa036ec709b9c64baf6155e authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 20 Nov 2014, 16:58 (12 years ago) parentac3de11
5 files changed+78−31
qml/Launcher/Launcher.qml+1 qml/Launcher/LauncherPanel.qml+1−1 qml/Shell.qml+8−6 qml/Stages/DecoratedWindow.qml+60 qml/Stages/DesktopStage.qml+8−24
qml/Launcher/Launcher.qml+1
@@ -24,6 +24,7 @@ Item {
2424 id: root
2525
2626 property bool available: true // can be used to disable all interactions
27+ property alias inverted: panel.inverted
2728
2829 property int panelWidth: units.gu(8)
2930 property int dragAreaWidth: units.gu(1)
qml/Launcher/LauncherPanel.qml+1−1
@@ -29,7 +29,7 @@ Rectangle {
2929 rotation: inverted ? 180 : 0
3030
3131 property var model
32− property bool inverted: true
32+ property bool inverted: false
3333 property bool dragging: false
3434 property bool moving: launcherListView.moving || launcherListView.flicking
3535 property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed
qml/Shell.qml+8−6
@@ -45,7 +45,7 @@ Item {
4545 id: shell
4646
4747 // this is only here to select the width / height of the window if not running fullscreen
48− property bool tablet: false
48+ property bool tablet: true
4949 width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
5050 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
5151
@@ -124,6 +124,11 @@ Item {
124124 sourceSize.width: 0
125125 }
126126
127+ GSettings {
128+ id: usageModeSettings
129+ schema.id: "com.canonical.Unity8"
130+ }
131+
127132 Binding {
128133 target: LauncherModel
129134 property: "applicationManager"
@@ -257,11 +262,6 @@ Item {
257262 source: usageModeSettings.usageMode === "Windowed" ? "Stages/DesktopStage.qml"
258263 : tabletMode ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
259264
260− GSettings {
261− id: usageModeSettings
262− schema.id: "com.canonical.Unity8"
263− }
264−
265265 Binding {
266266 target: applicationsDisplayLoader.item
267267 property: "objectName"
@@ -724,10 +724,12 @@ Item {
724724 readonly property bool dashSwipe: progress > 0
725725
726726 anchors.top: parent.top
727+ anchors.topMargin: inverted ? 0 : panel.panelHeight
727728 anchors.bottom: parent.bottom
728729 width: parent.width
729730 dragAreaWidth: shell.edgeSize
730731 available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.enableLauncherWhileLocked) && !greeter.hasLockedApp
732+ inverted: usageModeSettings.usageMode === "Staged"
731733
732734 onShowDashHome: showHome()
733735 onDash: showDash()
qml/Stages/DecoratedWindow.qmlnew file+60
@@ -0,0 +1,60 @@
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+ * Authors: Michael Zanetti <michael.zanetti@canonical.com>
17+ */
18+
19+import QtQuick 2.3
20+import Ubuntu.Components 1.1
21+import Unity.Application 0.1
22+
23+Item {
24+ id: root
25+
26+ property alias application: applicationWindow.application
27+ property alias active: decoration.active
28+
29+ signal requestFocus();
30+ signal close();
31+ signal maximize();
32+ signal minimize();
33+
34+ BorderImage {
35+ anchors {
36+ fill: root
37+ margins: -units.gu(2)
38+ }
39+ source: "graphics/dropshadow2gu.sci"
40+ opacity: .3
41+ Behavior on opacity { UbuntuNumberAnimation {} }
42+ }
43+
44+ WindowDecoration {
45+ id: decoration
46+ anchors { left: parent.left; top: parent.top; right: parent.right }
47+ height: units.gu(3)
48+ title: model.name
49+ onClose: root.close();
50+ onMaximize: root.maximize();
51+ onMinimize: root.minimize();
52+ }
53+
54+ ApplicationWindow {
55+ id: applicationWindow
56+ anchors.fill: parent
57+ anchors.topMargin: units.gu(3)
58+ interactive: index == 0
59+ }
60+}
qml/Stages/DesktopStage.qml+8−24
@@ -61,9 +61,10 @@ Item {
6161
6262 delegate: Item {
6363 id: appDelegate
64− height: units.gu(30)
65− width: units.gu(30)
6664 z: ApplicationManager.count - index
65+ width: units.gu(60)
66+ height: units.gu(50)
67+
6768
6869 states: [
6970 State {
@@ -84,16 +85,6 @@ Item {
8485 }
8586 ]
8687
87− BorderImage {
88− anchors {
89− fill: appDelegate
90− margins: -units.gu(2)
91− }
92− source: "graphics/dropshadow2gu.sci"
93− opacity: .3
94− Behavior on opacity { UbuntuNumberAnimation {} }
95− }
96−
9788 MouseArea {
9889 anchors.fill: parent
9990 anchors.margins: -units.gu(0.5)
@@ -141,21 +132,14 @@ Item {
141132 }
142133 }
143134
144− WindowDecoration {
145− anchors { left: parent.left; top: parent.top; right: parent.right }
146− height: units.gu(3)
147− title: model.name
135+ DecoratedWindow {
136+ anchors.fill: parent
137+ application: ApplicationManager.get(index)
138+ active: ApplicationManager.focusedApplicationId === model.appId
139+
148140 onClose: ApplicationManager.stopApplication(model.appId)
149141 onMaximize: appDelegate.state = (appDelegate.state == "maximized" ? "normal" : "maximized")
150142 onMinimize: appDelegate.state = "minimized"
151− active: ApplicationManager.focusedApplicationId == model.appId
152− }
153−
154− ApplicationWindow {
155− anchors.fill: parent
156− anchors.topMargin: units.gu(3)
157− application: ApplicationManager.get(index)
158− interactive: index == 0
159143 }
160144 }
161145 }