diff --git a/src/gui/tray/ActivityList.qml b/src/gui/tray/ActivityList.qml index 9c51b4c58009b..a697e3a0cb8b3 100644 --- a/src/gui/tray/ActivityList.qml +++ b/src/gui/tray/ActivityList.qml @@ -8,13 +8,15 @@ ScrollView { id: controlRoot property alias model: sortedActivityList.sourceModel property alias count: activityList.count - property alias contentY : activityList.contentY + property alias atYBeginning : activityList.atYBeginning property bool isFileActivityList: false property int iconSize: Style.trayListItemIconSize property int delegateHorizontalPadding: 0 - function positionViewAtBeginning() { - activityList.positionViewAtIndex(0, ListView.Beginning) + property bool scrollingToTop: false + + function scrollToTop() { + scrollingToTop = true; } signal openFile(string filePath) @@ -42,6 +44,20 @@ ScrollView { currentIndex: -1 interactive: true + Timer { + id: disappearTimer + interval: 50; + running: controlRoot.scrollingToTop + repeat: true + onTriggered: { + if (!activityList.atYBeginning) { + activityList.flick(0, 10000) + } else { + controlRoot.scrollingToTop = false; + } + } + } + highlight: Rectangle { id: activityHover anchors.fill: activityList.currentItem diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 016290b12ea66..8dbc6989af157 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -880,8 +880,7 @@ ApplicationWindow { text: qsTr("New activities") onClicked: { - //activityList.positionViewAtBeginning(); - activityList.contentY = 0; + activityList.scrollToTop(); newActivitiesButtonLoader.active = false; } @@ -927,7 +926,7 @@ ApplicationWindow { Connections { target: activityModel onInteractiveActivityReceived: { - if (activityList.contentY > 0) { + if (!activityList.atYBeginning) { newActivitiesButtonLoader.active = true; } }