on xenial help sign in
implement this binding in qml so it's easier to override
commit721aac92ac7e42770b679e1e01583780887e8faf authorAlbert Astals <albert.astals@canonical.com> dateThu 27 Jun 2013, 16:56 (13 years ago) parentffd9bbb
7 files changed+28−12
Dash/DashApps.qml+1−2 Dash/DashHome.qml+1−2 Dash/DashMusic.qml+1−2 Dash/DashVideos.qml+1−2 Dash/GenericScopeView.qml+1−2 Dash/ScopeListView.qml+23 plugins/ListViewWithPageHeader/listviewwithpageheader.cpp−2
Dash/DashApps.qml+1−2
@@ -17,7 +17,6 @@
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import Utils 0.1
20−import ListViewWithPageHeader 0.1
2120import "../Components"
2221import "../Components/ListItems"
2322import "Apps"
@@ -113,7 +112,7 @@ ScopeView {
113112 "ApplicationsFilterGrid": applicationsFilterGrid,
114113 }
115114
116− ListViewWithPageHeader {
115+ ScopeListView {
117116 id: categoryView
118117 anchors.fill: parent
119118 model: SortFilterProxyModel {
Dash/DashHome.qml+1−2
@@ -17,7 +17,6 @@
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import Utils 0.1
20−import ListViewWithPageHeader 0.1
2120import "../Components"
2221import "../Components/ListItems"
2322import "../Applications"
@@ -131,7 +130,7 @@ ScopeView {
131130 "VideosGrid": videosGrid,
132131 }
133132
134− ListViewWithPageHeader {
133+ ScopeListView {
135134 id: listView
136135 anchors.fill: parent
137136 model: categoryListModel
Dash/DashMusic.qml+1−2
@@ -16,7 +16,6 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19−import ListViewWithPageHeader 0.1
2019import "../Components"
2120import "../Components/ListItems" as ListItems
2221import "Music"
@@ -65,7 +64,7 @@ ScopeView {
6564 }
6665 }
6766
68− ListViewWithPageHeader {
67+ ScopeListView {
6968 id: categoryView
7069 anchors.fill: parent
7170 model: scopeView.categories
Dash/DashVideos.qml+1−2
@@ -16,7 +16,6 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19−import ListViewWithPageHeader 0.1
2019import "../Components"
2120import "../Components/ListItems" as ListItems
2221import "Video"
@@ -98,7 +97,7 @@ ScopeView {
9897 }
9998 }
10099
101− ListViewWithPageHeader {
100+ ScopeListView {
102101 id: categoryView
103102 anchors.fill: parent
104103 model: scopeView.categories
Dash/GenericScopeView.qml+1−2
@@ -16,7 +16,6 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19−import ListViewWithPageHeader 0.1
2019import "../Components"
2120import "../Components/ListItems" as ListItems
2221import "../Components/IconUtil.js" as IconUtil
@@ -44,7 +43,7 @@ ScopeView {
4443 }
4544 }
4645
47− ListViewWithPageHeader {
46+ ScopeListView {
4847 id: categoryView
4948 anchors.fill: parent
5049 model: scopeView.categories
Dash/ScopeListView.qmlnew file+23
@@ -0,0 +1,23 @@
1+/*
2+ * Copyright (C) 2013 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+import ListViewWithPageHeader 0.1
19+
20+ListViewWithPageHeader {
21+ maximumFlickVelocity: height * 10
22+ flickDeceleration: height * 2
23+}
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp−2
@@ -724,8 +724,6 @@ void ListViewWithPageHeader::onContentWidthChanged()
724724
725725void ListViewWithPageHeader::onHeightChanged()
726726{
727− setMaximumFlickVelocity(height() * 10);
728− setFlickDeceleration(height() * 2);
729727 polish();
730728}
731729