on xenial help sign in
flickable speed tuning
commitd906237007a6f2b5ee85102e3e00579244a8f5cf authorAndrea Cimitan <andrea.cimitan@gmail.com> dateWed 27 Jul 2016, 17:04 (10 years ago) parent07e4e7b
5 files changed+96−2
qml/Components/Flickable.qml+24 qml/Components/GridView.qml+24 qml/Components/ListView.qml+24 qml/Components/flickableUtils.js+20 qml/Dash/ScopeListView.qml+4−2
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 @@
1515 */
1616
1717import QtQuick 2.4
18+import Ubuntu.Components 1.3
1819import Dash 0.1
20+import "../Components/flickableUtils.js" as FlickableUtilsJS
1921
2022ListViewWithPageHeader {
21− maximumFlickVelocity: height * 10
22− flickDeceleration: height * 2
23+ flickDeceleration: FlickableUtilsJS.flickDeceleration
24+ maximumFlickVelocity: FlickableUtilsJS.maximumFlickVelocity
2325 // 1073741823 is s^30 -1. A quite big number so that you have "infinite" cache, but not so
2426 // big so that if you add if with itself you're outside the 2^31 int range
2527 cacheBuffer: 1073741823