on xenial help sign in
Some fav/unfav animation
16f192aAlbert Astals
qml/Dash/Dash.qml+1
@@ -153,6 +153,7 @@ Showable {
153 height: dash.height
153 height: dash.height
154 scope: scopes.overviewScope
154 scope: scopes.overviewScope
155 y: dash.height * (1 - bottomEdgeController.progress)
155 y: dash.height * (1 - bottomEdgeController.progress)
156+ visible: bottomEdgeController.progress != 0
156 onBackClicked: {
157 onBackClicked: {
157 bottomEdgeController.enableAnimation = true;
158 bottomEdgeController.enableAnimation = true;
158 bottomEdgeController.progress = 0;
159 bottomEdgeController.progress = 0;
qml/Dash/ScopesList.qml−2
@@ -63,7 +63,6 @@ Item {
63 clip: true
63 clip: true
64 contentWidth: root.width
64 contentWidth: root.width
65 contentHeight: column.height
65 contentHeight: column.height
66− onContentHeightChanged: console.log("column.height", column.height);
67 Column {
66 Column {
68 id: column
67 id: column
69 Repeater {
68 Repeater {
@@ -77,7 +76,6 @@ Item {
77 item.isFavoriteFeeds = index == 0;
76 item.isFavoriteFeeds = index == 0;
78 item.scopeStyle = scopeStyle;
77 item.scopeStyle = scopeStyle;
79 item.model = Qt.binding(function() { return results });
78 item.model = Qt.binding(function() { return results });
80− console.log(results, renderer);
81 }
79 }
82 Connections {
80 Connections {
83 target: item
81 target: item
qml/Dash/ScopesListCategory.qml+8−3
@@ -41,19 +41,24 @@ Item {
41 property var myTemplate: JSON.parse('{"card-layout":"horizontal","card-size":"small","category-layout":"grid","collapsed-rows":2}')
41 property var myTemplate: JSON.parse('{"card-layout":"horizontal","card-size":"small","category-layout":"grid","collapsed-rows":2}')
42 property var myComponents: JSON.parse('{"art":{"aspect-ratio":1,"field":"art"},"title":{"field":"title"},"attributes":{}}')
42 property var myComponents: JSON.parse('{"art":{"aspect-ratio":1,"field":"art"},"title":{"field":"title"},"attributes":{}}')
43
43
44−
45 ListView {
44 ListView {
46 id: list
45 id: list
47− height: contentHeight
46+
47+ readonly property double targetHeight: model.count * units.gu(6)
48+ clip: height != targetHeight
49+ height: targetHeight
50+ Behavior on height { enabled: visible; UbuntuNumberAnimation { } }
51+ width: parent.width
48 interactive: false
52 interactive: false
49
53
54+ removeDisplaced: Transition { UbuntuNumberAnimation { properties: "y" } }
55+
50 anchors.top: header.bottom
56 anchors.top: header.bottom
51 delegate: Loader {
57 delegate: Loader {
52 asynchronous: true
58 asynchronous: true
53 width: root.width
59 width: root.width
54 height: units.gu(6)
60 height: units.gu(6)
55 sourceComponent: Item {
61 sourceComponent: Item {
56− height: units.gu(6)
57 width: root.width
62 width: root.width
58 UbuntuShape {
63 UbuntuShape {
59 id: shape
64 id: shape
tests/mocks/Unity/fake_scopesoverview.cpp+2
@@ -311,6 +311,7 @@ void ScopesOverviewResultsModel::appendScope(Scope *scope)
311 beginInsertRows(QModelIndex(), index, index);
311 beginInsertRows(QModelIndex(), index, index);
312 m_scopes << scope;
312 m_scopes << scope;
313 endInsertRows();
313 endInsertRows();
314+ Q_EMIT countChanged();
314}
315}
315
316
316void ScopesOverviewResultsModel::removeScope(Scope *scope)
317void ScopesOverviewResultsModel::removeScope(Scope *scope)
@@ -320,4 +321,5 @@ void ScopesOverviewResultsModel::removeScope(Scope *scope)
320 beginRemoveRows(QModelIndex(), index, index);
321 beginRemoveRows(QModelIndex(), index, index);
321 m_scopes.removeAt(index);
322 m_scopes.removeAt(index);
322 endRemoveRows();
323 endRemoveRows();
324+ Q_EMIT countChanged();
323}
325}