on xenial help sign in
Some fav/unfav animation
commit16f192a574667d7f4160490ea094649c30e04372 authorAlbert Astals <albert.astals@canonical.com> dateMon 22 Sep 2014, 10:38 (12 years ago) parent799f27b
4 files changed+11−5
qml/Dash/Dash.qml+1 qml/Dash/ScopesList.qml−2 qml/Dash/ScopesListCategory.qml+8−3 tests/mocks/Unity/fake_scopesoverview.cpp+2
qml/Dash/Dash.qml+1
@@ -153,6 +153,7 @@ Showable {
153153 height: dash.height
154154 scope: scopes.overviewScope
155155 y: dash.height * (1 - bottomEdgeController.progress)
156+ visible: bottomEdgeController.progress != 0
156157 onBackClicked: {
157158 bottomEdgeController.enableAnimation = true;
158159 bottomEdgeController.progress = 0;
qml/Dash/ScopesList.qml−2
@@ -63,7 +63,6 @@ Item {
6363 clip: true
6464 contentWidth: root.width
6565 contentHeight: column.height
66− onContentHeightChanged: console.log("column.height", column.height);
6766 Column {
6867 id: column
6968 Repeater {
@@ -77,7 +76,6 @@ Item {
7776 item.isFavoriteFeeds = index == 0;
7877 item.scopeStyle = scopeStyle;
7978 item.model = Qt.binding(function() { return results });
80− console.log(results, renderer);
8179 }
8280 Connections {
8381 target: item
qml/Dash/ScopesListCategory.qml+8−3
@@ -41,19 +41,24 @@ Item {
4141 property var myTemplate: JSON.parse('{"card-layout":"horizontal","card-size":"small","category-layout":"grid","collapsed-rows":2}')
4242 property var myComponents: JSON.parse('{"art":{"aspect-ratio":1,"field":"art"},"title":{"field":"title"},"attributes":{}}')
4343
44−
4544 ListView {
4645 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
4852 interactive: false
4953
54+ removeDisplaced: Transition { UbuntuNumberAnimation { properties: "y" } }
55+
5056 anchors.top: header.bottom
5157 delegate: Loader {
5258 asynchronous: true
5359 width: root.width
5460 height: units.gu(6)
5561 sourceComponent: Item {
56− height: units.gu(6)
5762 width: root.width
5863 UbuntuShape {
5964 id: shape
tests/mocks/Unity/fake_scopesoverview.cpp+2
@@ -311,6 +311,7 @@ void ScopesOverviewResultsModel::appendScope(Scope *scope)
311311 beginInsertRows(QModelIndex(), index, index);
312312 m_scopes << scope;
313313 endInsertRows();
314+ Q_EMIT countChanged();
314315}
315316
316317void ScopesOverviewResultsModel::removeScope(Scope *scope)
@@ -320,4 +321,5 @@ void ScopesOverviewResultsModel::removeScope(Scope *scope)
320321 beginRemoveRows(QModelIndex(), index, index);
321322 m_scopes.removeAt(index);
322323 endRemoveRows();
324+ Q_EMIT countChanged();
323325}