@@ -11,17 +11,17 @@ import com.nextcloud.desktopclient as NC
1111
1212ScrollView {
1313 id: controlRoot
14+
1415 property alias model: sortedActivityList .sourceModel
1516 property alias count: activityList .count
16- property alias atYBeginning : activityList .atYBeginning
17+ property alias atYBeginning: activityList .atYBeginning
1718 property bool isFileActivityList: false
1819 property int iconSize: Style .trayListItemIconSize
1920 property int delegateHorizontalPadding: 0
2021
2122 property bool scrollingToTop: false
2223
2324 function scrollToTop () {
24- // Triggers activation of repeating upward flick timer
2525 scrollingToTop = true
2626 }
2727
@@ -33,7 +33,7 @@ ScrollView {
3333 topPadding: 0
3434 bottomPadding: 0
3535 rightPadding: ScrollBar .vertical .width
36-
36+
3737 focus: false
3838
3939 ScrollBar .horizontal .policy : ScrollBar .AlwaysOff
@@ -60,6 +60,9 @@ ScrollView {
6060 currentIndex: - 1
6161 interactive: true
6262
63+ highlight: null
64+ highlightFollowsCurrentItem: false
65+
6366 Timer {
6467 id: repeatUpFlickTimer
6568 interval: Style .activityListScrollToTopTimerInterval
@@ -74,53 +77,34 @@ ScrollView {
7477 }
7578 }
7679
77- highlight: Rectangle {
78- id: activityHover
79- anchors .fill : activityList .currentItem
80- color: palette .highlight
81- radius: Style .mediumRoundedButtonRadius
82- visible: activityList .activeFocus
83- }
84-
85- highlightFollowsCurrentItem: true
86- highlightMoveDuration: 0
87- highlightResizeDuration: 0
88- highlightRangeMode: ListView .ApplyRange
89- preferredHighlightBegin: 0
90- preferredHighlightEnd: controlRoot .height
91-
9280 model: NC .SortedActivityListModel {
9381 id: sortedActivityList
9482 }
9583
9684 delegate: ActivityItem {
97- background: null
9885 width: activityList .contentItem .width
9986
10087 isFileActivityList: controlRoot .isFileActivityList
10188 iconSize: Style .nmcListViewIconSize
10289 leftPadding: Style .nmcListViewLeftPadding
10390 flickable: activityList
91+
10492 onHoveredChanged: if (hovered) {
105- // When we set the currentIndex the list view will scroll...
106- // unless we tamper with the preferred highlight points to stop this.
107- const savedPreferredHighlightBegin = activityList .preferredHighlightBegin ;
108- const savedPreferredHighlightEnd = activityList .preferredHighlightEnd ;
109- // Set overkill values to make sure no scroll happens when we hover with mouse
110- activityList .preferredHighlightBegin = - controlRoot .height ;
111- activityList .preferredHighlightEnd = controlRoot .height * 2 ;
93+ const savedPreferredHighlightBegin = activityList .preferredHighlightBegin
94+ const savedPreferredHighlightEnd = activityList .preferredHighlightEnd
11295
113- activityList .currentIndex = index
96+ activityList .preferredHighlightBegin = - controlRoot .height
97+ activityList .preferredHighlightEnd = controlRoot .height * 2
11498
115- // Reset original values so keyboard navigation makes list view scroll
116- activityList .preferredHighlightBegin = savedPreferredHighlightBegin;
117- activityList .preferredHighlightEnd = savedPreferredHighlightEnd;
99+ activityList .currentIndex = index
118100
119- forceActiveFocus ();
101+ activityList .preferredHighlightBegin = savedPreferredHighlightBegin
102+ activityList .preferredHighlightEnd = savedPreferredHighlightEnd
120103 }
104+
121105 onClicked: {
122106 if (model .isCurrentUserFileActivity && model .openablePath ) {
123- openFile (" file://" + model .openablePath );
107+ openFile (" file://" + model .openablePath )
124108 } else {
125109 activityItemClicked (model .activityIndex )
126110 }
@@ -151,6 +135,7 @@ ScrollView {
151135
152136 Column {
153137 id: placeholderColumn
138+
154139 width: parent .width * 0.75
155140 anchors .centerIn : parent
156141 visible: activityList .count === 0
@@ -165,12 +150,12 @@ ScrollView {
165150 }
166151
167152 EnforcedPlainTextLabel {
168- width: parent .width
169- text: qsTr (" No activities yet" )
170- font .bold : true
171- wrapMode: Text .Wrap
172- horizontalAlignment: Text .AlignHCenter
173- verticalAlignment: Text .AlignVCenter
153+ width: parent .width
154+ text: qsTr (" No activities yet" )
155+ font .bold : true
156+ wrapMode: Text .Wrap
157+ horizontalAlignment: Text .AlignHCenter
158+ verticalAlignment: Text .AlignVCenter
174159 }
175160 }
176161 }
0 commit comments