on xenial help sign in
Add these two missing files
commit5cfa2d944eb90a5f32ae22393d1d382fb21ff45a authorAlbert Astals <albert.astals@canonical.com> dateFri 11 Jul 2014, 15:12 (12 years ago) parentfb554b3
2 files changed+102
qml/Dash/ScopesOverviewAll.qml+48 qml/Dash/ScopesOverviewFavourites.qml+54
qml/Dash/ScopesOverviewAll.qmlnew file+48
@@ -0,0 +1,48 @@
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+
17+import QtQuick 2.0
18+
19+Flickable {
20+ id: root
21+
22+ property alias model: cardFilterGrid.model
23+ property alias cardTool: cardFilterGrid.cardTool
24+
25+ property real extraHeight: 0
26+
27+ signal clicked(int index, var result)
28+
29+ contentHeight: cardFilterGrid.height + extraHeight
30+ contentWidth: cardFilterGrid.width
31+
32+ CardFilterGrid {
33+ id: cardFilterGrid
34+ width: parent.width
35+
36+ Component.onCompleted: {
37+ setFilter(false, false);
38+ }
39+
40+ onClicked: {
41+ console.log(model);
42+ root.clicked(index, result);
43+ }
44+ onPressAndHold: {
45+ console.log("onPressAndHold TODO");
46+ }
47+ }
48+}
qml/Dash/ScopesOverviewFavourites.qmlnew file+54
@@ -0,0 +1,54 @@
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+
17+import QtQuick 2.0
18+
19+ListView {
20+ id: root
21+
22+ signal clicked(int index, var result)
23+
24+ property var cardTool: null
25+ property real scopeHeight: 0
26+ property real scopeWidth: 0
27+
28+ orientation: ListView.Horizontal
29+ // TODO root.parent.scale
30+ // TODO current item
31+
32+ spacing: units.gu(2) / root.parent.scale
33+
34+ delegate: Loader {
35+ id: loader
36+
37+
38+ sourceComponent: cardTool.cardComponent
39+ onLoaded: {
40+ item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight / root.parent.scale; });
41+ item.fontScale = Qt.binding(function() { return 1 / root.parent.scale; });
42+ item.height = Qt.binding(function() { return root.scopeHeight; });
43+ item.width = Qt.binding(function() { return root.scopeWidth; });
44+ item.cardData = Qt.binding(function() { return model; });
45+ item.template = Qt.binding(function() { return cardTool.template; });
46+ item.components = Qt.binding(function() { return cardTool.components; });
47+ }
48+
49+ Connections {
50+ target: loader.item
51+ onClicked: root.clicked(index, result)
52+ }
53+ }
54+}