on xenial help sign in
Remove the swipe to close the Drawer :(
1259b90Dalton Durst
qml/Launcher/Drawer.qml+17−106
@@ -26,7 +26,7 @@ FocusScope {
26 id: root
26 id: root
27
27
28 property int panelWidth: 0
28 property int panelWidth: 0
29− readonly property bool moving: singleGroupListView && singleGroupListView.moving
29+ readonly property bool moving: appList && appList.moving
30 readonly property Item searchTextField: searchField
30 readonly property Item searchTextField: searchField
31 readonly property real delegateWidth: units.gu(10)
31 readonly property real delegateWidth: units.gu(10)
32
32
@@ -81,7 +81,7 @@ FocusScope {
81
81
82 Item {
82 Item {
83 id: searchFieldContainer
83 id: searchFieldContainer
84− height: units.gu(4)
84+ height: units.gu(6)
85 anchors { left: parent.left; top: parent.top; right: parent.right; margins: units.gu(1) }
85 anchors { left: parent.left; top: parent.top; right: parent.right; margins: units.gu(1) }
86
86
87 TextField {
87 TextField {
@@ -92,15 +92,15 @@ FocusScope {
92 top: parent.top
92 top: parent.top
93 right: parent.right
93 right: parent.right
94 bottom: parent.bottom
94 bottom: parent.bottom
95− bottomMargin: units.gu(1)
95+ bottomMargin: units.gu(2)
96 }
96 }
97 placeholderText: i18n.tr("Search…")
97 placeholderText: i18n.tr("Search…")
98 z: 100
98 z: 100
99
99
100− KeyNavigation.down: singleGroupListView
100+ KeyNavigation.down: appList
101
101
102 onAccepted: {
102 onAccepted: {
103− if (searchField.displayText != "" && singleGroupListView) {
103+ if (searchField.displayText != "" && appList) {
104 // In case there is no currentItem (it might have been filtered away) lets reset it to the first item
104 // In case there is no currentItem (it might have been filtered away) lets reset it to the first item
105 if (!appList.currentItem) {
105 if (!appList.currentItem) {
106 appList.currentIndex = 0;
106 appList.currentIndex = 0;
@@ -111,116 +111,27 @@ FocusScope {
111 }
111 }
112 }
112 }
113
113
114− FocusScope {
114+ DrawerGridView {
115− id: headerFocusScope
115+ id: appList
116− objectName: "headerFocusScope"
117− KeyNavigation.up: searchField
118− KeyNavigation.down: singleGroupListView
119− KeyNavigation.backtab: searchField
120− KeyNavigation.tab: singleGroupListView
121− activeFocusOnTab: true
122−
123− GSettings {
124− id: settings
125− schema.id: "com.canonical.Unity8"
126− }
127−
128− Keys.onPressed: {
129− switch (event.key) {
130− case Qt.Key_Return:
131− case Qt.Key_Enter:
132− case Qt.Key_Space:
133− trigger();
134− event.accepted = true;
135− }
136− }
137−
138− function trigger() {
139− Qt.openUrlExternally(settings.appstoreUri)
140− }
141− }
142−
143− MouseArea {
144− id: horizontalDragDetector
145− parent: singleGroupListView
146− anchors.fill: parent
147− propagateComposedEvents: true
148− property int oldX: 0
149− onPressed: {
150− if (root.firstOpen) {
151− mouse.accepted = false;
152− root.firstOpen = false;
153− return;
154− }
155− oldX = mouseX;
156− }
157− onMouseXChanged: {
158− var diff = oldX - mouseX;
159− root.draggingHorizontally |= diff > units.gu(2);
160− if (!root.draggingHorizontally) {
161− return;
162− }
163− parent.interactive = false;
164− root.dragDistance += diff;
165− oldX = mouseX
166− }
167− onReleased: reset();
168− onCanceled: reset();
169− function reset() {
170− if (root.draggingHorizontally) {
171− root.draggingHorizontally = false;
172− parent.interactive = true;
173− }
174− }
175− }
176−
177− Item {
178 anchors {
116 anchors {
179 left: parent.left
117 left: parent.left
180 right: parent.right
118 right: parent.right
181 top: searchFieldContainer.bottom
119 top: searchFieldContainer.bottom
182 bottom: parent.bottom
120 bottom: parent.bottom
183 }
121 }
184− z: 1
122+ height: rows * delegateHeight
185−
186− Flickable {
187− id: singleGroupListView
188− clip: true
123+ clip: true
189−
190− contentHeight: appListContainer.height
191−
192− anchors.fill: parent
193−
194− Item {
195− id: appListContainer
196− width: parent.width - units.gu(2)
197− anchors.horizontalCenter: parent.horizontalCenter
198−
199− readonly property string appId: model.appId
200−
201− // NOTE: Cannot use gridView.rows here as it would evaluate to 0 at first and only update later,
202− // which messes up the ListView.
203− height: (Math.ceil(appList.model.count / appList.columns) * appList.delegateHeight) + units.gu(2)
204−
205− DrawerGridView {
206− id: appList
207− anchors { left: parent.left; top: parent.top; right: parent.right; topMargin: units.gu(1) }
208− height: rows * delegateHeight
209
124
210− interactive: false
211− focus: index == aToZListView.currentIndex
125+ focus: index == aToZListView.currentIndex
212
126
213− model: AppDrawerProxyModel {
127+ model: AppDrawerProxyModel {
214− id: categoryModel
128+ id: categoryModel
215− source: sortProxyModel
129+ source: sortProxyModel
216− dynamicSortFilter: false
130+ dynamicSortFilter: false
217− }
218− delegateWidth: root.delegateWidth
219− delegateHeight: units.gu(11)
220− delegate: drawerDelegateComponent
221− }
222− }
223 }
131 }
132+ delegateWidth: root.delegateWidth
133+ delegateHeight: units.gu(11)
134+ delegate: drawerDelegateComponent
224 }
135 }
225 }
136 }
226
137
qml/Launcher/Launcher.qml+11−1
@@ -179,7 +179,11 @@ FocusScope {
179 if (focusInputField) {
179 if (focusInputField) {
180 drawer.focusInput();
180 drawer.focusInput();
181 }
181 }
182+ if (state === "drawer") {
183+ switchToNextState("")
184+ } else {
182− switchToNextState("drawer")
185+ switchToNextState("drawer")
186+ }
183 }
187 }
184
188
185 Keys.onPressed: {
189 Keys.onPressed: {
@@ -588,6 +592,7 @@ FocusScope {
588 PropertyChanges {
592 PropertyChanges {
589 target: panel
593 target: panel
590 x: -root.panelWidth
594 x: -root.panelWidth
595+ showCloseIcon: false
591 }
596 }
592 PropertyChanges {
597 PropertyChanges {
593 target: drawer
598 target: drawer
@@ -600,6 +605,7 @@ FocusScope {
600 PropertyChanges {
605 PropertyChanges {
601 target: panel
606 target: panel
602 x: -root.x // so we never go past panelWidth, even when teased by tutorial
607 x: -root.x // so we never go past panelWidth, even when teased by tutorial
608+ showCloseIcon: false
603 }
609 }
604 PropertyChanges {
610 PropertyChanges {
605 target: drawer
611 target: drawer
@@ -614,6 +620,10 @@ FocusScope {
614 anchors.rightMargin: -drawer.width + root.x // so we never go past panelWidth, even when teased by tutorial
620 anchors.rightMargin: -drawer.width + root.x // so we never go past panelWidth, even when teased by tutorial
615 focus: true
621 focus: true
616 }
622 }
623+ PropertyChanges {
624+ target: panel
625+ showCloseIcon: true
626+ }
617 },
627 },
618 State {
628 State {
619 name: "visibleTemporary"
629 name: "visibleTemporary"
qml/Launcher/LauncherPanel.qml+2−1
@@ -35,6 +35,7 @@ Rectangle {
35 property bool moving: launcherListView.moving || launcherListView.flicking
35 property bool moving: launcherListView.moving || launcherListView.flicking
36 property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed
36 property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed
37 || dndArea.containsMouse || dashItem.hovered
37 || dndArea.containsMouse || dashItem.hovered
38+ property bool showCloseIcon: false
38 property int highlightIndex: -2
39 property int highlightIndex: -2
39 property bool shortcutHintsShown: false
40 property bool shortcutHintsShown: false
40 readonly property bool quickListOpen: quickList.state === "open"
41 readonly property bool quickListOpen: quickList.state === "open"
@@ -97,7 +98,7 @@ Rectangle {
97 sourceSize.width: width
98 sourceSize.width: width
98 sourceSize.height: height
99 sourceSize.height: height
99 anchors.centerIn: parent
100 anchors.centerIn: parent
100− source: "graphics/home.svg"
101+ source: root.showCloseIcon ? "graphics/back.svg": "graphics/home.svg"
101 rotation: root.rotation
102 rotation: root.rotation
102 }
103 }
103 AbstractButton {
104 AbstractButton {
qml/Launcher/graphics/back.svgnew file+197
@@ -0,0 +1,197 @@
1+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+<!-- Created with Inkscape (http://www.inkscape.org/) -->
3+
4+<svg
5+ xmlns:dc="http://purl.org/dc/elements/1.1/"
6+ xmlns:cc="http://creativecommons.org/ns#"
7+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8+ xmlns:svg="http://www.w3.org/2000/svg"
9+ xmlns="http://www.w3.org/2000/svg"
10+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12+ width="96"
13+ height="96"
14+ id="svg4874"
15+ version="1.1"
16+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
17+ viewBox="0 0 96 96.000001"
18+ sodipodi:docname="back.svg">
19+ <defs
20+ id="defs4876">
21+ <clipPath
22+ clipPathUnits="userSpaceOnUse"
23+ id="clipPath16">
24+ <path
25+ d="m 0,595.28 841.89,0 L 841.89,0 0,0 0,595.28 Z"
26+ id="path18"
27+ inkscape:connector-curvature="0" />
28+ </clipPath>
29+ </defs>
30+ <sodipodi:namedview
31+ id="base"
32+ pagecolor="#ffffff"
33+ bordercolor="#666666"
34+ borderopacity="1.0"
35+ inkscape:pageopacity="0.0"
36+ inkscape:pageshadow="2"
37+ inkscape:zoom="10.685496"
38+ inkscape:cx="50.995361"
39+ inkscape:cy="57.096039"
40+ inkscape:document-units="px"
41+ inkscape:current-layer="layer1"
42+ showgrid="true"
43+ showborder="true"
44+ fit-margin-top="0"
45+ fit-margin-left="0"
46+ fit-margin-right="0"
47+ fit-margin-bottom="0"
48+ inkscape:snap-bbox="true"
49+ inkscape:bbox-paths="true"
50+ inkscape:bbox-nodes="true"
51+ inkscape:snap-bbox-edge-midpoints="true"
52+ inkscape:snap-bbox-midpoints="true"
53+ inkscape:object-paths="true"
54+ inkscape:snap-intersection-paths="true"
55+ inkscape:object-nodes="true"
56+ inkscape:snap-smooth-nodes="true"
57+ inkscape:snap-midpoints="true"
58+ inkscape:snap-object-midpoints="true"
59+ inkscape:snap-center="true"
60+ showguides="true"
61+ inkscape:guide-bbox="true"
62+ inkscape:snap-global="true"
63+ inkscape:window-width="1920"
64+ inkscape:window-height="1012"
65+ inkscape:window-x="0"
66+ inkscape:window-y="32"
67+ inkscape:window-maximized="1">
68+ <inkscape:grid
69+ type="xygrid"
70+ id="grid5451"
71+ empspacing="8" />
72+ <sodipodi:guide
73+ orientation="1,0"
74+ position="8,-8.0000001"
75+ id="guide4063"
76+ inkscape:locked="false" />
77+ <sodipodi:guide
78+ orientation="1,0"
79+ position="4,-8.0000001"
80+ id="guide4065"
81+ inkscape:locked="false" />
82+ <sodipodi:guide
83+ orientation="0,1"
84+ position="-8,88.000001"
85+ id="guide4067"
86+ inkscape:locked="false" />
87+ <sodipodi:guide
88+ orientation="0,1"
89+ position="-8,92.000001"
90+ id="guide4069"
91+ inkscape:locked="false" />
92+ <sodipodi:guide
93+ orientation="0,1"
94+ position="104,4"
95+ id="guide4071"
96+ inkscape:locked="false" />
97+ <sodipodi:guide
98+ orientation="0,1"
99+ position="-5,8.0000001"
100+ id="guide4073"
101+ inkscape:locked="false" />
102+ <sodipodi:guide
103+ orientation="1,0"
104+ position="88,-8.0000001"
105+ id="guide4077"
106+ inkscape:locked="false" />
107+ <sodipodi:guide
108+ orientation="0,1"
109+ position="-8,84.000001"
110+ id="guide4074"
111+ inkscape:locked="false" />
112+ <sodipodi:guide
113+ orientation="1,0"
114+ position="12,-8.0000001"
115+ id="guide4076"
116+ inkscape:locked="false" />
117+ <sodipodi:guide
118+ orientation="1,0"
119+ position="84,-8.0000001"
120+ id="guide4080"
121+ inkscape:locked="false" />
122+ <sodipodi:guide
123+ position="48,-8.0000001"
124+ orientation="1,0"
125+ id="guide4170"
126+ inkscape:locked="false" />
127+ <sodipodi:guide
128+ position="-8,48"
129+ orientation="0,1"
130+ id="guide4172"
131+ inkscape:locked="false" />
132+ <sodipodi:guide
133+ position="92,-8.0000001"
134+ orientation="1,0"
135+ id="guide4760"
136+ inkscape:locked="false" />
137+ <sodipodi:guide
138+ position="104,12"
139+ orientation="0,1"
140+ id="guide4207"
141+ inkscape:locked="false" />
142+ </sodipodi:namedview>
143+ <metadata
144+ id="metadata4879">
145+ <rdf:RDF>
146+ <cc:Work
147+ rdf:about="">
148+ <dc:format>image/svg+xml</dc:format>
149+ <dc:type
150+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
151+ <dc:title />
152+ </cc:Work>
153+ </rdf:RDF>
154+ </metadata>
155+ <g
156+ inkscape:label="Layer 1"
157+ inkscape:groupmode="layer"
158+ id="layer1"
159+ transform="translate(67.857146,-78.50504)">
160+ <g
161+ inkscape:label="Layer 1"
162+ id="layer1-695"
163+ transform="translate(-2.8652345e-6,-1.4294891e-5)">
164+ <g
165+ transform="matrix(0,-1,-1,0,373.50506,516.50504)"
166+ id="g4845-27"
167+ style="display:inline">
168+ <g
169+ inkscape:export-ydpi="90"
170+ inkscape:export-xdpi="90"
171+ inkscape:export-filename="next01.png"
172+ transform="matrix(-0.9996045,0,0,1,575.94296,-611.00001)"
173+ id="g4778-56"
174+ inkscape:label="Layer 1">
175+ <g
176+ transform="matrix(-1,0,0,1,575.99999,611)"
177+ id="g4780-75"
178+ style="display:inline">
179+ <path
180+ style="display:inline;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1"
181+ d="m 437.00209,379.49587 c -5.24691,4.1449 -10.54573,8.128 -15.94494,11.7914 -6.00476,4.0757 -11.8322,7.7257 -17.4773,10.9536 -5.20923,2.9783 -9.64507,5.2206 -13.59532,7.0003 -3.95086,-1.7798 -8.3889,-4.0213 -13.59947,-7.0003 -5.64495,-3.2278 -11.47152,-6.8778 -17.47731,-10.9536 -5.39821,-3.6627 -10.69595,-7.6466 -15.94285,-11.7914 h 7.93911 c 3.15098,2.4002 6.38063,4.7681 9.75501,7.0752 4.26477,2.9172 8.6291,5.6557 13.09079,8.2194 4.52823,2.6011 10.75085,5.7064 15.00884,7.7151 h 0.002 l 1.22173,0.5752 1.22172,-0.5752 h 0.002 c 4.25899,-2.0087 10.48126,-5.1138 15.00884,-7.7151 4.46175,-2.5637 8.82538,-5.3023 13.09078,-8.2194 3.37342,-2.307 6.60393,-4.6749 9.75502,-7.0752 h 7.9412 z"
182+ id="path4265-0-4"
183+ inkscape:connector-curvature="0" />
184+ <rect
185+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
186+ id="rect4782-01"
187+ width="96.037987"
188+ height="96"
189+ x="-438.00244"
190+ y="345.36221"
191+ transform="scale(-1,1)" />
192+ </g>
193+ </g>
194+ </g>
195+ </g>
196+ </g>
197+</svg>