Skip to content

Commit

Permalink
Merge pull request #7823 from nextcloud/enh/scrolltotop
Browse files Browse the repository at this point in the history
Add button to scroll to top when activity list is long.
  • Loading branch information
camilasan authored Feb 10, 2025
2 parents 2fcd4f6 + a7b7c1c commit 9b44943
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/gui/tray/ActivityList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,28 @@ ScrollView {
}
}

Button {
id: scrollToTopButton

anchors.bottom: parent.bottom
anchors.right: parent.right

hoverEnabled: true
padding: Style.smallSpacing

Accessible.role: Accessible.Button
Accessible.name: qsTr("Scroll to top")
Accessible.onPressAction: scrollToTopButton.clicked()

icon.source: "image://svgimage-custom-color/chevron-double-up.svg/" + palette.buttonText
icon.width: Style.activityListButtonIconSize
icon.height: Style.activityListButtonIconSize

onClicked: controlRoot.scrollToTop()

visible: !controlRoot.atYBeginning && controlRoot.contentHeight > controlRoot.height
}

Column {
id: placeholderColumn
width: parent.width * 0.8
Expand Down
1 change: 1 addition & 0 deletions theme.qrc.in
Original file line number Diff line number Diff line change
Expand Up @@ -241,5 +241,6 @@
<file>theme/send.svg</file>
<file>theme/call-notification.wav</file>
<file>theme/talk-app.svg</file>
<file>theme/chevron-double-up.svg</file>
</qresource>
</RCC>
1 change: 1 addition & 0 deletions theme/chevron-double-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9b44943

Please sign in to comment.