@@ -1,201 +0,0 @@
2− * Copyright (C) 2013 Canonical, Ltd.
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.
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.
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/>.
18−import Ubuntu.Components 0.1
19−import "../Components"
20−import "../Components/ListItems" as ListItems
25− property alias previewShown: previewLoader.onScreen
27− property var categoryNames: [
30− i18n.tr("New Releases"),
31− i18n.tr("Popular Online")
34− onIsCurrentChanged: {
35− pageHeader.resetSearch();
38− onMovementStarted: categoryView.showHeader()
41− target: scopeView.scope
42− property: "searchQuery"
43− value: pageHeader.searchQuery
48− onSearchClicked: if (isCurrent) {
49− pageHeader.triggerSearch()
50− categoryView.showHeader()
54− function getRenderer(categoryId) {
55− switch (categoryId) {
56− case "featured": return "Video/VideosCarousel.qml"
57− default: return "Video/VideosFilterGrid.qml"
65− bottomMargin: -bottomOverflow
67− sourceItem: categoryView
71− topGapPx: (1 - gap) * positionPx
72− topOpacity: Math.max(0, (1 - gap * 1.2))
73− bottomGapPx: positionPx + gap * (targetBottomGapPx - positionPx)
74− bottomOverflow: units.gu(6)
75− bottomOpacity: 1 - (gap * 0.8)
77− property int targetBottomGapPx: height - units.gu(8) - bottomOverflow
78− property real gap: previewLoader.open ? 1.0 : 0.0
83− easing.type: Easing.InOutQuad
85− if (!previewLoader.open && !running) {
86− previewLoader.onScreen = false;
96− model: scopeView.categories
97− forceNoClip: previewLoader.onScreen
99− onAtYEndChanged: if (atYEnd) endReached()
100− onMovingChanged: if (moving && atYEnd) endReached()
102− delegate: ListItems.Base {
104− highlightWhenPressed: false
105− property string categoryId: model.categoryId
109− anchors { top: parent.top; left: parent.left; right: parent.right }
110− source: scopeView.getRenderer(base.categoryId)
112− item.model = results
119− // VideosCarousel and VideosFilterGrid have different
120− // clicked signals, accomodate for that
121− if (categoryId == "featured") {
122− var fileUri = delegateItem.model.uri.replace(/^[^:]+:/, "")
123− dataItem = {fileUri: fileUri, nfoUri: delegateItem.model.comment}
127− if (dataItem.nfoUri != "") {
128− previewLoader.videoData = dataItem;
129− previewLoader.open = true;
130− effect.positionPx = mapToItem(categoryView, 0, itemY).y;
137− sectionProperty: "name"
138− sectionDelegate: ListItems.Header {
139− width: categoryView.width
140− text: i18n.tr(section)
143− pageHeader: PageHeader {
145− width: categoryView.width
146− text: i18n.tr("Videos")
147− searchEntryEnabled: true
148− searchHistory: scopeView.searchHistory
154− height: effect.bottomGapPx - effect.topGapPx
157− topMargin: effect.topGapPx
161− sourceComponent: onScreen ? previewComponent : undefined
163− property bool open: false
164− property bool onScreen: false
165− property var videoData
175− item.item = videoData;
180− id: previewComponent
184− anchors.fill: parent
185− onClose: open = false;
189− // TODO: Move as InverseMouseArea to DashPreview
191− enabled: previewLoader.onScreen
194− topMargin: effect.bottomGapPx
197− previewLoader.open = false;