on xenial help sign in
restructure a bit, uninvert the launcher in desktop mode
5d1dfecMichael Zanetti
qml/Launcher/Launcher.qml+1
@@ -24,6 +24,7 @@ Item {
24 id: root
24 id: root
25
25
26 property bool available: true // can be used to disable all interactions
26 property bool available: true // can be used to disable all interactions
27+ property alias inverted: panel.inverted
27
28
28 property int panelWidth: units.gu(8)
29 property int panelWidth: units.gu(8)
29 property int dragAreaWidth: units.gu(1)
30 property int dragAreaWidth: units.gu(1)
qml/Launcher/LauncherPanel.qml+1−1
@@ -29,7 +29,7 @@ Rectangle {
29 rotation: inverted ? 180 : 0
29 rotation: inverted ? 180 : 0
30
30
31 property var model
31 property var model
32− property bool inverted: true
32+ property bool inverted: false
33 property bool dragging: false
33 property bool dragging: false
34 property bool moving: launcherListView.moving || launcherListView.flicking
34 property bool moving: launcherListView.moving || launcherListView.flicking
35 property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed
35 property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed
qml/Shell.qml+8−6
@@ -45,7 +45,7 @@ Item {
45 id: shell
45 id: shell
46
46
47 // this is only here to select the width / height of the window if not running fullscreen
47 // 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
49 width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
49 width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
50 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
50 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
51
51
@@ -124,6 +124,11 @@ Item {
124 sourceSize.width: 0
124 sourceSize.width: 0
125 }
125 }
126
126
127+ GSettings {
128+ id: usageModeSettings
129+ schema.id: "com.canonical.Unity8"
130+ }
131+
127 Binding {
132 Binding {
128 target: LauncherModel
133 target: LauncherModel
129 property: "applicationManager"
134 property: "applicationManager"
@@ -257,11 +262,6 @@ Item {
257 source: usageModeSettings.usageMode === "Windowed" ? "Stages/DesktopStage.qml"
262 source: usageModeSettings.usageMode === "Windowed" ? "Stages/DesktopStage.qml"
258 : tabletMode ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
263 : tabletMode ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
259
264
260− GSettings {
261− id: usageModeSettings
262− schema.id: "com.canonical.Unity8"
263− }
264−
265 Binding {
265 Binding {
266 target: applicationsDisplayLoader.item
266 target: applicationsDisplayLoader.item
267 property: "objectName"
267 property: "objectName"
@@ -724,10 +724,12 @@ Item {
724 readonly property bool dashSwipe: progress > 0
724 readonly property bool dashSwipe: progress > 0
725
725
726 anchors.top: parent.top
726 anchors.top: parent.top
727+ anchors.topMargin: inverted ? 0 : panel.panelHeight
727 anchors.bottom: parent.bottom
728 anchors.bottom: parent.bottom
728 width: parent.width
729 width: parent.width
729 dragAreaWidth: shell.edgeSize
730 dragAreaWidth: shell.edgeSize
730 available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.enableLauncherWhileLocked) && !greeter.hasLockedApp
731 available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.enableLauncherWhileLocked) && !greeter.hasLockedApp
732+ inverted: usageModeSettings.usageMode === "Staged"
731
733
732 onShowDashHome: showHome()
734 onShowDashHome: showHome()
733 onDash: showDash()
735 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 {
61
61
62 delegate: Item {
62 delegate: Item {
63 id: appDelegate
63 id: appDelegate
64− height: units.gu(30)
65− width: units.gu(30)
66 z: ApplicationManager.count - index
64 z: ApplicationManager.count - index
65+ width: units.gu(60)
66+ height: units.gu(50)
67+
67
68
68 states: [
69 states: [
69 State {
70 State {
@@ -84,16 +85,6 @@ Item {
84 }
85 }
85 ]
86 ]
86
87
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−
97 MouseArea {
88 MouseArea {
98 anchors.fill: parent
89 anchors.fill: parent
99 anchors.margins: -units.gu(0.5)
90 anchors.margins: -units.gu(0.5)
@@ -141,21 +132,14 @@ Item {
141 }
132 }
142 }
133 }
143
134
144− WindowDecoration {
135+ DecoratedWindow {
145− anchors { left: parent.left; top: parent.top; right: parent.right }
136+ anchors.fill: parent
146− height: units.gu(3)
137+ application: ApplicationManager.get(index)
147− title: model.name
138+ active: ApplicationManager.focusedApplicationId === model.appId
139+
148 onClose: ApplicationManager.stopApplication(model.appId)
140 onClose: ApplicationManager.stopApplication(model.appId)
149 onMaximize: appDelegate.state = (appDelegate.state == "maximized" ? "normal" : "maximized")
141 onMaximize: appDelegate.state = (appDelegate.state == "maximized" ? "normal" : "maximized")
150 onMinimize: appDelegate.state = "minimized"
142 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
159 }
143 }
160 }
144 }
161 }
145 }