on xenial help sign in
Uninvert Launcher in Desktop Mode
8471b26Michael 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+2−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
@@ -54,6 +54,7 @@ Rectangle {
54 objectName: "buttonShowDashHome"
54 objectName: "buttonShowDashHome"
55 width: parent.width
55 width: parent.width
56 height: units.gu(7)
56 height: units.gu(7)
57+ clip: true
57
58
58 UbuntuShape {
59 UbuntuShape {
59 anchors {
60 anchors {
qml/Shell.qml+7−5
@@ -129,6 +129,11 @@ Item {
129 sourceSize.width: 0
129 sourceSize.width: 0
130 }
130 }
131
131
132+ GSettings {
133+ id: usageModeSettings
134+ schema.id: "com.canonical.Unity8"
135+ }
136+
132 Binding {
137 Binding {
133 target: LauncherModel
138 target: LauncherModel
134 property: "applicationManager"
139 property: "applicationManager"
@@ -270,11 +275,6 @@ Item {
270 source: usageModeSettings.usageMode === "Windowed" ? "Stages/DesktopStage.qml"
275 source: usageModeSettings.usageMode === "Windowed" ? "Stages/DesktopStage.qml"
271 : tabletMode ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
276 : tabletMode ? "Stages/TabletStage.qml" : "Stages/PhoneStage.qml"
272
277
273− GSettings {
274− id: usageModeSettings
275− schema.id: "com.canonical.Unity8"
276− }
277−
278 Binding {
278 Binding {
279 target: applicationsDisplayLoader.item
279 target: applicationsDisplayLoader.item
280 property: "objectName"
280 property: "objectName"
@@ -733,10 +733,12 @@ Item {
733 readonly property bool dashSwipe: progress > 0
733 readonly property bool dashSwipe: progress > 0
734
734
735 anchors.top: parent.top
735 anchors.top: parent.top
736+ anchors.topMargin: inverted ? 0 : panel.panelHeight
736 anchors.bottom: parent.bottom
737 anchors.bottom: parent.bottom
737 width: parent.width
738 width: parent.width
738 dragAreaWidth: shell.edgeSize
739 dragAreaWidth: shell.edgeSize
739 available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.enableLauncherWhileLocked) && !greeter.hasLockedApp
740 available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.enableLauncherWhileLocked) && !greeter.hasLockedApp
741+ inverted: usageModeSettings.usageMode === "Staged"
740
742
741 onShowDashHome: showHome()
743 onShowDashHome: showHome()
742 onDash: showDash()
744 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 }
tests/qmltests/tst_Shell.qml+7−11
@@ -496,16 +496,8 @@ Item {
496 function tapOnAppIconInLauncher() {
496 function tapOnAppIconInLauncher() {
497 var launcherPanel = findChild(shell, "launcherPanel");
497 var launcherPanel = findChild(shell, "launcherPanel");
498
498
499− // pick the first icon, the one at the bottom.
499+ // pick the first icon, the one at the top.
500 var appIcon = findChild(launcherPanel, "launcherDelegate0")
500 var appIcon = findChild(launcherPanel, "launcherDelegate0")
501−
502− // Swipe upwards over the launcher to ensure that this icon
503− // at the bottom is not folded and faded away.
504− var touchStartX = launcherPanel.width / 2;
505− var touchEndY = launcherPanel.height / 2;
506− touchFlick(launcherPanel, touchStartX, 0, touchStartX, touchEndY);
507− tryCompare(launcherPanel, "moving", false);
508−
509 tap(appIcon, appIcon.width / 2, appIcon.height / 2);
501 tap(appIcon, appIcon.width / 2, appIcon.height / 2);
510 }
502 }
511
503
@@ -753,13 +745,17 @@ Item {
753 dragLauncherIntoView();
745 dragLauncherIntoView();
754
746
755 // Emulate a tap with a finger, where the touch position drifts during the tap.
747 // Emulate a tap with a finger, where the touch position drifts during the tap.
748+ // This is to test the touch ownership changes. The tap is happening on the button
749+ // area but then drifting into the left edge drag area. This test makes sure
750+ // the touch ownership stays with the button and doesn't move over to the
751+ // left edge drag area.
756 {
752 {
757 var buttonShowDashHome = findChild(launcher, "buttonShowDashHome");
753 var buttonShowDashHome = findChild(launcher, "buttonShowDashHome");
758 var startPos = buttonShowDashHome.mapToItem(shell,
754 var startPos = buttonShowDashHome.mapToItem(shell,
759− buttonShowDashHome.width * 0.2,
755+ buttonShowDashHome.width * 0.8,
760 buttonShowDashHome.height * 0.2);
756 buttonShowDashHome.height * 0.2);
761 var endPos = buttonShowDashHome.mapToItem(shell,
757 var endPos = buttonShowDashHome.mapToItem(shell,
762− buttonShowDashHome.width * 0.8,
758+ buttonShowDashHome.width * 0.2,
763 buttonShowDashHome.height * 0.8);
759 buttonShowDashHome.height * 0.8);
764 touchFlick(shell, startPos.x, startPos.y, endPos.x, endPos.y);
760 touchFlick(shell, startPos.x, startPos.y, endPos.x, endPos.y);
765 }
761 }