on xenial help sign in
Will it break?
commit34013082f8eafc21a2c2d834089b04611d166434 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateFri 5 Sep 2014, 16:23 (12 years ago) parent464d4d7
31 files changed+149−41
qml/Components/Carousel.qml+2−3 qml/Components/Flickables/Flickable.qml+23 qml/Components/Flickables/GridView.qml+23 qml/Components/Flickables/ListView.qml+23 qml/Components/Flickables/ListViewWithPageHeader.qml+23 qml/Components/ResponsiveGridView.qml+2−1 qml/Components/ZoomableImage.qml+2−2 qml/Dash/CardHorizontalList.qml+2−1 qml/Dash/DashContent.qml+2−3 qml/Dash/DashNavigationButton.qml+2−1 qml/Dash/DashNavigationList.qml+2−1 qml/Dash/PageHeader.qml+2−1 qml/Dash/PreviewListView.qml+2−3 qml/Dash/Previews/Preview.qml+2−1 qml/Dash/Previews/PreviewImageGallery.qml+2−1 qml/Dash/ScopeListView.qml+3−6 qml/Dash/ScopeSettingsPage.qml+2−1 qml/Dash/ScopesOverviewAll.qml+2−1 qml/Dash/ScopesOverviewFavorites.qml+4−2 qml/Greeter/LoginList.qml+2−2 qml/Hud/Hud.qml+2−1 qml/Hud/HudParametrizedActionsPage.qml+2−1 qml/Launcher/LauncherPanel.qml+2−1 qml/Notifications/Notification.qml+2−1 qml/Notifications/Notifications.qml+2−1 qml/Panel/IndicatorRow.qml+2−1 qml/Panel/Indicators/DefaultIndicatorPage.qml+2−1 qml/Panel/Indicators/client/IndicatorsList.qml+2−1 qml/Panel/Indicators/client/IndicatorsTree.qml+2−1 qml/Stages/PhoneStage.qml+2−1 qml/Stages/TabletStage.qml+2−1
qml/Components/Carousel.qml+2−3
@@ -17,6 +17,7 @@
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import "carousel.js" as CarouselJS
20+import "Flickables" as Flickables
2021
2122/*! The Carousel component presents the items of a model in a carousel view. It's similar to a
2223 cover flow. But it stops at it's boundaries (therefore no PathView is used).
@@ -63,7 +64,7 @@ Item {
6364 and footer item to compensate that.
6465
6566 The scaling of the items is controlled by the variable continuousIndex, described below. */
66− ListView {
67+ Flickables.ListView {
6768 id: listView
6869 objectName: "listView"
6970
@@ -135,8 +136,6 @@ Item {
135136
136137 boundsBehavior: Flickable.DragOverBounds
137138 cacheBuffer: carousel.cacheBuffer
138− flickDeceleration: Math.max(1500 * Math.pow(realWidth / referenceWidth, 1.5), 1500) // 1500 is platform default
139− maximumFlickVelocity: Math.max(2500 * Math.pow(realWidth / referenceWidth, 1.5), 2500) // 2500 is platform default
140139 orientation: ListView.Horizontal
141140
142141 function getXFromContinuousIndex(index) {
qml/Components/Flickables/Flickable.qmlnew file+23
@@ -0,0 +1,23 @@
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.3 as QtQuick
18+import Ubuntu.Components 0.1
19+
20+QtQuick.Flickable {
21+ flickDeceleration: 1500 * units.gridUnit / 8
22+ maximumFlickVelocity: 2500 * units.gridUnit / 8
23+}
qml/Components/Flickables/GridView.qmlnew file+23
@@ -0,0 +1,23 @@
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.3 as QtQuick
18+import Ubuntu.Components 0.1
19+
20+QtQuick.GridView {
21+ flickDeceleration: 1500 * units.gridUnit / 8
22+ maximumFlickVelocity: 2500 * units.gridUnit / 8
23+}
qml/Components/Flickables/ListView.qmlnew file+23
@@ -0,0 +1,23 @@
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.3 as QtQuick
18+import Ubuntu.Components 0.1
19+
20+QtQuick.ListView {
21+ flickDeceleration: 1500 * units.gridUnit / 8
22+ maximumFlickVelocity: 2500 * units.gridUnit / 8
23+}
qml/Components/Flickables/ListViewWithPageHeader.qmlnew file+23
@@ -0,0 +1,23 @@
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 Dash 0.1
18+import Ubuntu.Components 0.1
19+
20+ListViewWithPageHeader {
21+ flickDeceleration: 1500 * units.gridUnit / 8
22+ maximumFlickVelocity: 2500 * units.gridUnit / 8
23+}
qml/Components/ResponsiveGridView.qml+2−1
@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.3
1818import Ubuntu.Components 0.1
19+import "Flickables" as Flickables
1920
2021/*
2122 Essentially a GridView where you can specify the maximum number of columns it can have.
@@ -51,7 +52,7 @@ Item {
5152 return rows * height
5253 }
5354
54− GridView {
55+ Flickables.GridView {
5556 id: gridView
5657 objectName: "responsiveGridViewGrid"
5758 anchors {
qml/Components/ZoomableImage.qml+2−2
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19−import "../Components"
19+import "Flickables" as Flickables
2020
2121/*! \brief Zoomable for image.
2222
@@ -32,7 +32,7 @@ Item {
3232 property alias scaleTo: lazyImage.scaleTo
3333 property alias asynchronous: lazyImage.asynchronous
3434
35− Flickable {
35+ Flickables.Flickable {
3636 id: flickable
3737 objectName: "flickable"
3838 clip: true
qml/Dash/CardHorizontalList.qml+2−1
@@ -17,6 +17,7 @@
1717import QtQuick 2.2
1818import Ubuntu.Components 1.1
1919import "../Components"
20+import "../Components/Flickables" as Flickables
2021
2122DashRenderer {
2223 id: root
@@ -25,7 +26,7 @@ DashRenderer {
2526 collapsedHeight: expandedHeight
2627 clip: true
2728
28− ListView {
29+ Flickables.ListView {
2930 id: listView
3031 anchors {
3132 fill: parent
qml/Dash/DashContent.qml+2−3
@@ -19,6 +19,7 @@ import Ubuntu.Components 0.1
1919import Unity 0.2
2020import Utils 0.1
2121import "../Components"
22+import "../Components/Flickables" as Flickables
2223
2324Item {
2425 id: dashContent
@@ -97,7 +98,7 @@ Item {
9798 anchors.fill: parent
9899 }
99100
100− ListView {
101+ Flickables.ListView {
101102 id: dashContentList
102103 objectName: "dashContentList"
103104
@@ -105,8 +106,6 @@ Item {
105106 anchors.fill: parent
106107 orientation: ListView.Horizontal
107108 boundsBehavior: Flickable.DragAndOvershootBounds
108− flickDeceleration: units.gu(625)
109− maximumFlickVelocity: width * 5
110109 snapMode: ListView.SnapOneItem
111110 highlightMoveDuration: 250
112111 highlightRangeMode: ListView.StrictlyEnforceRange
qml/Dash/DashNavigationButton.qml+2−1
@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.2
1818import Ubuntu.Components 1.1
19+import "../Components/Flickables" as Flickables
1920
2021AbstractButton {
2122 id: root
@@ -75,7 +76,7 @@ AbstractButton {
7576 }
7677
7778 // navigationListView is outside root
78− ListView {
79+ Flickables.ListView {
7980 id: navigationListView
8081 objectName: "navigationListView"
8182 visible: height > 0
qml/Dash/DashNavigationList.qml+2−1
@@ -17,6 +17,7 @@
1717import QtQuick 2.2
1818import Ubuntu.Components 1.1
1919import "../Components"
20+import "../Components/Flickables" as Flickables
2021
2122Item {
2223 id: root
@@ -45,7 +46,7 @@ Item {
4546 }
4647 }
4748
48− Flickable {
49+ Flickables.Flickable {
4950 id: flickable
5051
5152 anchors.fill: parent
qml/Dash/PageHeader.qml+2−1
@@ -21,6 +21,7 @@ import Ubuntu.Components.Popups 1.0
2121import Ubuntu.Components.ListItems 1.0
2222import "../Components"
2323import "../Components/SearchHistoryModel"
24+import "../Components/Flickables" as Flickables
2425
2526Item {
2627 id: root
@@ -128,7 +129,7 @@ Item {
128129 }
129130 }
130131
131− Flickable {
132+ Flickables.Flickable {
132133 id: headerContainer
133134 objectName: "headerContainer"
134135 clip: contentY < height
qml/Dash/PreviewListView.qml+2−3
@@ -18,6 +18,7 @@ import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import Unity 0.2
2020import "../Components"
21+import "../Components/Flickables" as Flickables
2122import "Previews" as Previews
2223
2324Item {
@@ -52,7 +53,7 @@ Item {
5253 onBackClicked: root.backClicked()
5354 }
5455
55− ListView {
56+ Flickables.ListView {
5657 id: previewListView
5758 objectName: "listView"
5859 anchors {
@@ -66,8 +67,6 @@ Item {
6667 snapMode: ListView.SnapOneItem
6768 boundsBehavior: Flickable.DragAndOvershootBounds
6869 highlightMoveDuration: 250
69− flickDeceleration: units.gu(625)
70− maximumFlickVelocity: width * 5
7170 cacheBuffer: 0
7271
7372 property bool open: false
qml/Dash/Previews/Preview.qml+2−1
@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19+import "../../Components/Flickables" as Flickables
1920
2021/*! \brief This component constructs the Preview UI.
2122 *
@@ -63,7 +64,7 @@ Item {
6364 Repeater {
6465 model: previewModel
6566
66− delegate: ListView {
67+ delegate: Flickables.ListView {
6768 id: column
6869 anchors { top: parent.top; bottom: parent.bottom }
6970 width: row.columnWidth
qml/Dash/Previews/PreviewImageGallery.qml+2−1
@@ -17,6 +17,7 @@
1717import QtQuick 2.0
1818import Ubuntu.Components 1.1
1919import "../../Components"
20+import "../../Components/Flickables" as Flickables
2021
2122/*! This preview widget shows a horizontal list of images.
2223 * The URIs for the images should be an array in widgetData["sources"].
@@ -26,7 +27,7 @@ PreviewWidget {
2627 id: root
2728 implicitHeight: units.gu(22)
2829
29− ListView {
30+ Flickables.ListView {
3031 id: previewImageListView
3132 spacing: units.gu(1)
3233 anchors.fill: parent
qml/Dash/ScopeListView.qml+3−6
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2014 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,10 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Dash 0.1
17+import "../Components/Flickables" as Flickables
1918
20−ListViewWithPageHeader {
21− maximumFlickVelocity: height * 10
22− flickDeceleration: height * 2
19+Flickables.ListViewWithPageHeader {
2320}
qml/Dash/ScopeSettingsPage.qml+2−1
@@ -18,6 +18,7 @@ import QtQuick 2.2
1818import Ubuntu.Components 1.1
1919import Unity 0.2
2020import "../Components"
21+import "../Components/Flickables" as Flickables
2122import "ScopeSettings"
2223
2324Item {
@@ -39,7 +40,7 @@ Item {
3940 onBackClicked: root.backClicked()
4041 }
4142
42− ListView {
43+ Flickables.ListView {
4344 id: scopeSettings
4445 objectName: "scopeSettings"
4546 anchors {
qml/Dash/ScopesOverviewAll.qml+2−1
@@ -16,8 +16,9 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19+import "../Components/Flickables" as Flickables
1920
20−Flickable {
21+Flickables.Flickable {
2122 id: root
2223
2324 property alias model: cardGrid.model
qml/Dash/ScopesOverviewFavorites.qml+4−2
@@ -14,9 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.3
18+import Ubuntu.Components 1.1
19+import "../Components/Flickables" as Flickables
1820
19−Flickable {
21+Flickables.Flickable {
2022 id: root
2123
2224 signal clicked(int index, var result, var itemModel)
qml/Greeter/LoginList.qml+2−2
@@ -18,6 +18,7 @@ import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import LightDM 0.1 as LightDM
2020import "../Components"
21+import "../Components/Flickables" as Flickables
2122
2223Item {
2324 id: root
@@ -52,7 +53,7 @@ Item {
5253 antialiasing: true
5354 }
5455
55− ListView {
56+ Flickables.ListView {
5657 id: userList
5758 objectName: "userList"
5859
@@ -62,7 +63,6 @@ Item {
6263 preferredHighlightEnd: userList.height / 2 - root.highlightedHeight / 2
6364 highlightRangeMode: ListView.StrictlyEnforceRange
6465 highlightMoveDuration: root.moveDuration
65− flickDeceleration: 10000
6666
6767 readonly property bool movingInternally: moveTimer.running || userList.moving
6868
qml/Hud/Hud.qml+2−1
@@ -19,6 +19,7 @@ import Ubuntu.Components 0.1
1919import HudClient 0.1
2020
2121import "../Components"
22+import "../Components/Flickables" as Flickables
2223
2324Item {
2425 id: hud
@@ -400,7 +401,7 @@ Item {
400401 }
401402 progress: MathUtils.clamp((y - hudShowable.y + height - units.gu(8))/elementsYSliding, 0, 1)
402403
403− Flickable {
404+ Flickables.Flickable {
404405 anchors.left: parent.left
405406 anchors.right: parent.right
406407 contentHeight: resultList.height
qml/Hud/HudParametrizedActionsPage.qml+2−1
@@ -18,6 +18,7 @@ import QtQuick 2.0
1818import Ubuntu.Components 1.1
1919import Ubuntu.Components.Themes.Ambiance 1.1
2020import "../Components"
21+import "../Components/Flickables" as Flickables
2122
2223Item {
2324 property alias header: header.title
@@ -74,7 +75,7 @@ Item {
7475 return values
7576 }
7677
77− Flickable {
78+ Flickables.Flickable {
7879 anchors.top: parent.top
7980 anchors.bottom: buttons.top
8081 anchors.left: parent.left
qml/Launcher/LauncherPanel.qml+2−1
@@ -21,6 +21,7 @@ import Unity.Launcher 0.1
2121import Ubuntu.Components.Popups 0.1
2222import "../Components/ListItems"
2323import "../Components/"
24+import "../Components/Flickables" as Flickables
2425
2526Rectangle {
2627 id: root
@@ -83,7 +84,7 @@ Rectangle {
8384 anchors.fill: parent
8485 clip: true
8586
86− ListView {
87+ Flickables.ListView {
8788 id: launcherListView
8889 objectName: "launcherListView"
8990 anchors {
qml/Notifications/Notification.qml+2−1
@@ -20,6 +20,7 @@ import Ubuntu.Components 1.1
2020import Unity.Notifications 1.0
2121import QMenuModel 0.1
2222import Utils 0.1
23+import "../Components/Flickables" as Flickables
2324
2425import Ubuntu.Components.ListItems 0.1 as ListItem
2526
@@ -369,7 +370,7 @@ Item {
369370 onClicked: notification.notification.invokeAction(comboRepeater.itemAt(2).actionId)
370371 expanded: false
371372 expandedHeight: (comboRepeater.count - 2) * units.gu(4) + units.gu(.5)
372− comboList: Flickable {
373+ comboList: Flickables.Flickable {
373374 // this has to be wrapped inside a flickable
374375 // to work around a feature/bug? of the
375376 // ComboButton SDK-element, making a regular
qml/Notifications/Notifications.qml+2−1
@@ -19,8 +19,9 @@ import Ubuntu.Components 0.1
1919import Unity.Notifications 1.0 as UnityNotifications
2020import Utils 0.1
2121import "../Components"
22+import "../Components/Flickables" as Flickables
2223
23−ListView {
24+Flickables.ListView {
2425 id: notificationList
2526
2627 objectName: "notificationList"
qml/Panel/IndicatorRow.qml+2−1
@@ -18,6 +18,7 @@ import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import Unity.Indicators 0.1 as Indicators
2020import "../Components"
21+import "../Components/Flickables" as Flickables
2122
2223Item {
2324 id: indicatorRow
@@ -60,7 +61,7 @@ Item {
6061 }
6162 }
6263
63− ListView {
64+ Flickables.ListView {
6465 id: itemView
6566 objectName: "indicatorRowItems"
6667 interactive: false
qml/Panel/Indicators/DefaultIndicatorPage.qml+2−1
@@ -21,6 +21,7 @@
2121import QtQuick 2.0
2222import Ubuntu.Components 0.1 as Components
2323import Unity.Indicators 0.1 as Indicators
24+import "../../Components/Flickables" as Flickables
2425
2526IndicatorBase {
2627 id: main
@@ -67,7 +68,7 @@ IndicatorBase {
6768 }
6869 }
6970
70− ListView {
71+ Flickables.ListView {
7172 id: mainMenu
7273 objectName: "mainMenu"
7374 model: menuStack.rootMenu
qml/Panel/Indicators/client/IndicatorsList.qml+2−1
@@ -22,6 +22,7 @@ import Ubuntu.Components 0.1
2222import Ubuntu.Components.ListItems 0.1 as ListItem
2323import Unity.Indicators 0.1 as Indicators
2424import "../.."
25+import "../../../Components/Flickables" as Flickables
2526
2627Page {
2728 id: page
@@ -35,7 +36,7 @@ Page {
3536 Component.onCompleted: load(profile)
3637 }
3738
38− ListView {
39+ Flickables.ListView {
3940 id: mainMenu
4041 objectName: "mainMenu"
4142 anchors.fill: parent
qml/Panel/Indicators/client/IndicatorsTree.qml+2−1
@@ -22,6 +22,7 @@ import Ubuntu.Components 0.1
2222import Unity.Indicators 0.1 as Indicators
2323import QMenuModel 0.1
2424import Ubuntu.Components.ListItems 0.1 as ListItem
25+import "../../../Components/Flickables" as Flickables
2526
2627Page {
2728 id: page
@@ -52,7 +53,7 @@ Page {
5253 model: unityModel
5354 }
5455
55− Flickable {
56+ Flickables.Flickable {
5657 anchors.fill: parent
5758 contentHeight: all_data.height
5859 clip:true
qml/Stages/PhoneStage.qml+2−1
@@ -20,6 +20,7 @@ import Ubuntu.Gestures 0.1
2020import Unity.Application 0.1
2121import Utils 0.1
2222import "../Components"
23+import "../Components/Flickables" as Flickables
2324
2425Rectangle {
2526 id: root
@@ -106,7 +107,7 @@ Rectangle {
106107
107108 }
108109
109− Flickable {
110+ Flickables.Flickable {
110111 id: spreadView
111112 objectName: "spreadView"
112113 anchors.fill: parent
qml/Stages/TabletStage.qml+2−1
@@ -20,6 +20,7 @@ import Ubuntu.Gestures 0.1
2020import Unity.Application 0.1
2121import Utils 0.1
2222import "../Components"
23+import "../Components/Flickables" as Flickables
2324
2425Rectangle {
2526 id: root
@@ -142,7 +143,7 @@ Rectangle {
142143 }
143144 }
144145
145− Flickable {
146+ Flickables.Flickable {
146147 id: spreadView
147148 anchors.fill: parent
148149 interactive: (spreadDragArea.status == DirectionalDragArea.Recognized || phase > 1)