on xenial help sign in
Preview comes from the right
1c2fb19Albert Astals
qml/Dash/DashContent.qml+9−14
@@ -93,7 +93,11 @@ Item {
93
93
94 Item {
94 Item {
95 id: dashContentListHolder
95 id: dashContentListHolder
96− anchors.fill: parent
96+
97+ x: previewListView.open ? -width : 0
98+ Behavior on x { UbuntuNumberAnimation { } }
99+ width: parent.width
100+ height: parent.height
97
101
98 ListView {
102 ListView {
99 id: dashContentList
103 id: dashContentList
@@ -114,6 +118,7 @@ Item {
114 cacheBuffer: 1073741823
118 cacheBuffer: 1073741823
115 onMovementStarted: dashContent.movementStarted()
119 onMovementStarted: dashContent.movementStarted()
116 onMovementEnded: dashContent.movementEnded()
120 onMovementEnded: dashContent.movementEnded()
121+ clip: parent.x != 0
117
122
118 // If the number of items is less than the current index, then need to reset to another item.
123 // If the number of items is less than the current index, then need to reset to another item.
119 onCountChanged: {
124 onCountChanged: {
@@ -149,7 +154,6 @@ Item {
149 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })
154 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })
150 item.tabBarHeight = dashPageHeader.implicitHeight;
155 item.tabBarHeight = dashPageHeader.implicitHeight;
151 item.pageHeader = dashPageHeader;
156 item.pageHeader = dashPageHeader;
152− item.openEffect = openEffect;
153 item.previewListView = previewListView;
157 item.previewListView = previewListView;
154 dashContentList.movementStarted.connect(item.movementStarted)
158 dashContentList.movementStarted.connect(item.movementStarted)
155 dashContent.positionedAtBeginning.connect(item.positionedAtBeginning)
159 dashContent.positionedAtBeginning.connect(item.positionedAtBeginning)
@@ -219,21 +223,12 @@ Item {
219 }
223 }
220 }
224 }
221
225
222− DashContentOpenEffect {
223− id: openEffect
224− anchors {
225− fill: parent
226− bottomMargin: -bottomOverflow
227− }
228− sourceItem: dashContentListHolder
229− previewListView: previewListView
230− }
231−
232 PreviewListView {
226 PreviewListView {
233 id: previewListView
227 id: previewListView
234− openEffect: openEffect
235 scope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null
228 scope: dashContentList.currentItem ? dashContentList.currentItem.theScope : null
236 pageHeader: dashPageHeader
229 pageHeader: dashPageHeader
237− anchors.fill: parent
230+ width: parent.width
231+ height: parent.height
232+ anchors.left: dashContentListHolder.right
238 }
233 }
239}
234}
qml/Dash/GenericScopeView.qml−16
@@ -30,7 +30,6 @@ FocusScope {
30 property alias moving: categoryView.moving
30 property alias moving: categoryView.moving
31 property int tabBarHeight: 0
31 property int tabBarHeight: 0
32 property PageHeader pageHeader: null
32 property PageHeader pageHeader: null
33− property OpenEffect openEffect: null
34 property Item previewListView: null
33 property Item previewListView: null
35
34
36 signal endReached
35 signal endReached
@@ -190,7 +189,6 @@ FocusScope {
190 target: rendererLoader.item
189 target: rendererLoader.item
191 onClicked: {
190 onClicked: {
192 // Prepare the preview in case activate() triggers a preview only
191 // Prepare the preview in case activate() triggers a preview only
193− openEffect.positionPx = Math.max(mapToItem(categoryView, 0, itemY).y, pageHeader.height + categoryView.stickyHeaderHeight);
194 previewListView.model = target.model;
192 previewListView.model = target.model;
195 previewListView.currentIndex = -1
193 previewListView.currentIndex = -1
196 previewListView.currentIndex = index;
194 previewListView.currentIndex = index;
@@ -204,7 +202,6 @@ FocusScope {
204 }
202 }
205 }
203 }
206 onPressAndHold: {
204 onPressAndHold: {
207− openEffect.positionPx = Math.max(mapToItem(categoryView, 0, itemY).y, pageHeader.height + categoryView.stickyHeaderHeight);
208 previewListView.model = target.model;
205 previewListView.model = target.model;
209 previewListView.currentIndex = -1
206 previewListView.currentIndex = -1
210 previewListView.currentIndex = index;
207 previewListView.currentIndex = index;
@@ -325,17 +322,4 @@ FocusScope {
325 default: return "CardFilterGrid.qml";
322 default: return "CardFilterGrid.qml";
326 }
323 }
327 }
324 }
328−
329− // TODO: Move as InverseMouseArea to DashPreview
330− MouseArea {
331− objectName: "closePreviewMouseArea"
332− enabled: previewListView.onScreen
333− anchors {
334− fill: parent
335− topMargin: openEffect.bottomGapPx
336− }
337− onClicked: {
338− previewListView.open = false;
339− }
340− }
341}
325}
qml/Dash/PreviewListView.qml+2−10
@@ -23,7 +23,6 @@ import "Previews" as Previews
23Item {
23Item {
24 id: root
24 id: root
25
25
26− property OpenEffect openEffect: null
27 property Scope scope: null
26 property Scope scope: null
28 property var pageHeader: null
27 property var pageHeader: null
29
28
@@ -36,19 +35,12 @@ Item {
36
35
37 PageHeader {
36 PageHeader {
38 id: header
37 id: header
39− anchors.topMargin: openEffect.topGapPx
40 width: parent.width
38 width: parent.width
41 searchEntryEnabled: false
39 searchEntryEnabled: false
42 scope: root.scope
40 scope: root.scope
43 height: units.gu(8.5)
41 height: units.gu(8.5)
44 showBackButton: true
42 showBackButton: true
45− onBackClicked: {
43+ onBackClicked: root.open = false
46− visibleOnce = false;
47− root.open = false;
48− }
49− visible: previewListView.open && previewListView.currentItem && previewListView.currentItem.ready || visibleOnce
50− onVisibleChanged: visibleOnce = visible
51− property bool visibleOnce: false
52
44
53 childItem: Label {
45 childItem: Label {
54 id: label
46 id: label
@@ -69,9 +61,9 @@ Item {
69 ListView {
61 ListView {
70 id: previewListView
62 id: previewListView
71 objectName: "previewListView"
63 objectName: "previewListView"
72− height: openEffect.bottomGapPx - openEffect.topGapPx
73 anchors {
64 anchors {
74 top: header.bottom
65 top: header.bottom
66+ bottom: parent.bottom
75 left: parent.left
67 left: parent.left
76 right: parent.right
68 right: parent.right
77 }
69 }
qml/Dash/ScopeItem.qml+9−15
@@ -33,7 +33,11 @@ Item {
33
33
34 Item {
34 Item {
35 id: scopeViewHolder
35 id: scopeViewHolder
36− anchors.fill: parent
36+
37+ x: previewListView.open ? -width : 0
38+ Behavior on x { UbuntuNumberAnimation { } }
39+ width: parent.width
40+ height: parent.height
37
41
38 GenericScopeView {
42 GenericScopeView {
39 id: scopeView
43 id: scopeView
@@ -42,7 +46,6 @@ Item {
42 isCurrent: scope != null
46 isCurrent: scope != null
43 tabBarHeight: scopeItemPageHeader.implicitHeight
47 tabBarHeight: scopeItemPageHeader.implicitHeight
44 pageHeader: scopeItemPageHeader
48 pageHeader: scopeItemPageHeader
45− openEffect: openEffect
46 previewListView: previewListView
49 previewListView: previewListView
47
50
48 Connections {
51 Connections {
@@ -58,7 +61,7 @@ Item {
58 searchEntryEnabled: true
61 searchEntryEnabled: true
59 searchHistory: root.searchHistory
62 searchHistory: root.searchHistory
60 scope: root.scope
63 scope: root.scope
61− height: units.gu(7)
64+ height: units.gu(8.5)
62 showBackButton: true
65 showBackButton: true
63 onBackClicked: root.back();
66 onBackClicked: root.back();
64
67
@@ -79,21 +82,12 @@ Item {
79 }
82 }
80 }
83 }
81
84
82− DashContentOpenEffect {
83− id: openEffect
84− anchors {
85− fill: parent
86− bottomMargin: -bottomOverflow
87− }
88− sourceItem: scopeViewHolder
89− previewListView: previewListView
90− }
91−
92 PreviewListView {
85 PreviewListView {
93 id: previewListView
86 id: previewListView
94− openEffect: openEffect
95 pageHeader: scopeItemPageHeader
87 pageHeader: scopeItemPageHeader
96 scope: root.scope
88 scope: root.scope
97− anchors.fill: parent
89+ width: parent.width
90+ height: parent.height
91+ anchors.left: scopeViewHolder.right
98 }
92 }
99}
93}