diff --git a/src/qml/Base/HFixedListView.qml b/src/qml/Base/HFixedListView.qml index 708e46e2..253de681 100644 --- a/src/qml/Base/HFixedListView.qml +++ b/src/qml/Base/HFixedListView.qml @@ -2,6 +2,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 ListView { + id: listView interactive: false currentIndex: -1 highlightMoveDuration: theme.animationDuration @@ -21,16 +22,24 @@ ListView { opacity: theme.controls.interactiveRectangle.checkedOpacity } + // Important: + // https://doc.qt.io/qt-5/qml-qtquick-viewtransition.html#handling-interrupted-animations + + populate: add + displaced: move + add: Transition { - HNumberAnimation { properties: "x,y"; from: 100 } + ParallelAnimation { + HNumberAnimation { property: "opacity"; from: 0; to: 1 } + HNumberAnimation { properties: "x,y"; from: 100 } + } } move: Transition { - HNumberAnimation { properties: "x,y" } - } - - displaced: Transition { - HNumberAnimation { properties: "x,y" } + ParallelAnimation { + HNumberAnimation { property: "opacity"; to: 1 } + HNumberAnimation { properties: "x,y" } + } } remove: Transition { diff --git a/src/qml/SidePane/AccountRoomList.qml b/src/qml/SidePane/AccountRoomList.qml index a46c9710..4c30158a 100644 --- a/src/qml/SidePane/AccountRoomList.qml +++ b/src/qml/SidePane/AccountRoomList.qml @@ -11,9 +11,9 @@ HListView { readonly property var collapseAccounts: window.uiState.collapseAccounts readonly property string filter: paneToolBar.roomFilter - onOriginSourceChanged: Qt.callLater(filterSource) - onFilterChanged: Qt.callLater(filterSource) - onCollapseAccountsChanged: Qt.callLater(filterSource) + onOriginSourceChanged: filterLimiter.requestFire() + onFilterChanged: filterLimiter.requestFire() + onCollapseAccountsChanged: filterLimiter.requestFire() function filterSource() { @@ -101,6 +101,12 @@ HListView { } + HRateLimiter { + id: filterLimiter + cooldown: 16 + onFired: filterSource() + } + HRateLimiter { id: activateLimiter onFired: currentItem.item.activate()