on xenial help sign in
flickable speed tuning
d906237Andrea Cimitan
qml/Components/Flickable.qmlnew file+24
@@ -0,0 +1,24 @@
1+/*
2+ * Copyright (C) 2016 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.4 as QtQuick
18+import Ubuntu.Components 1.3
19+import "flickableUtils.js" as FlickableUtilsJS
20+
21+QtQuick.Flickable {
22+ flickDeceleration: FlickableUtilsJS.flickDeceleration
23+ maximumFlickVelocity: FlickableUtilsJS.maximumFlickVelocity
24+}
qml/Components/GridView.qmlnew file+24
@@ -0,0 +1,24 @@
1+/*
2+ * Copyright (C) 2016 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.4 as QtQuick
18+import Ubuntu.Components 1.3
19+import "flickableUtils.js" as FlickableUtilsJS
20+
21+QtQuick.GridView {
22+ flickDeceleration: FlickableUtilsJS.flickDeceleration
23+ maximumFlickVelocity: FlickableUtilsJS.maximumFlickVelocity
24+}
qml/Components/ListView.qmlnew file+24
@@ -0,0 +1,24 @@
1+/*
2+ * Copyright (C) 2016 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.4 as QtQuick
18+import Ubuntu.Components 1.3
19+import "flickableUtils.js" as FlickableUtilsJS
20+
21+QtQuick.ListView {
22+ flickDeceleration: FlickableUtilsJS.flickDeceleration
23+ maximumFlickVelocity: FlickableUtilsJS.maximumFlickVelocity
24+}
qml/Components/flickableUtils.jsnew file+20
@@ -0,0 +1,20 @@
1+/*
2+ * Copyright (C) 2016 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+.pragma library
18+
19+var flickDeceleration = 1500 * units.gridUnit / 8;
20+var maximumFlickVelocity = 2500 * units.gridUnit / 8
qml/Dash/ScopeListView.qml+4−2
@@ -15,11 +15,13 @@
15 */
15 */
16
16
17import QtQuick 2.4
17import QtQuick 2.4
18+import Ubuntu.Components 1.3
18import Dash 0.1
19import Dash 0.1
20+import "../Components/flickableUtils.js" as FlickableUtilsJS
19
21
20ListViewWithPageHeader {
22ListViewWithPageHeader {
21− maximumFlickVelocity: height * 10
23+ flickDeceleration: FlickableUtilsJS.flickDeceleration
22− flickDeceleration: height * 2
24+ maximumFlickVelocity: FlickableUtilsJS.maximumFlickVelocity
23 // 1073741823 is s^30 -1. A quite big number so that you have "infinite" cache, but not so
25 // 1073741823 is s^30 -1. A quite big number so that you have "infinite" cache, but not so
24 // big so that if you add if with itself you're outside the 2^31 int range
26 // big so that if you add if with itself you're outside the 2^31 int range
25 cacheBuffer: 1073741823
27 cacheBuffer: 1073741823