Skip to content

Commit a7b7c1c

Browse files
committed
Add button to scroll to top when activity list is long.
Signed-off-by: Camila Ayres <hello@camilasan.com>
1 parent 2fcd4f6 commit a7b7c1c

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/gui/tray/ActivityList.qml

+22
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,28 @@ ScrollView {
114114
}
115115
}
116116

117+
Button {
118+
id: scrollToTopButton
119+
120+
anchors.bottom: parent.bottom
121+
anchors.right: parent.right
122+
123+
hoverEnabled: true
124+
padding: Style.smallSpacing
125+
126+
Accessible.role: Accessible.Button
127+
Accessible.name: qsTr("Scroll to top")
128+
Accessible.onPressAction: scrollToTopButton.clicked()
129+
130+
icon.source: "image://svgimage-custom-color/chevron-double-up.svg/" + palette.buttonText
131+
icon.width: Style.activityListButtonIconSize
132+
icon.height: Style.activityListButtonIconSize
133+
134+
onClicked: controlRoot.scrollToTop()
135+
136+
visible: !controlRoot.atYBeginning && controlRoot.contentHeight > controlRoot.height
137+
}
138+
117139
Column {
118140
id: placeholderColumn
119141
width: parent.width * 0.8

theme.qrc.in

+1
Original file line numberDiff line numberDiff line change
@@ -241,5 +241,6 @@
241241
<file>theme/send.svg</file>
242242
<file>theme/call-notification.wav</file>
243243
<file>theme/talk-app.svg</file>
244+
<file>theme/chevron-double-up.svg</file>
244245
</qresource>
245246
</RCC>

theme/chevron-double-up.svg

+1
Loading

0 commit comments

Comments
 (0)