diff --git a/src/gui/tray/ActivityList.qml b/src/gui/tray/ActivityList.qml index 1819f421dbc16..caa7bfd28d127 100644 --- a/src/gui/tray/ActivityList.qml +++ b/src/gui/tray/ActivityList.qml @@ -7,10 +7,16 @@ import com.nextcloud.desktopclient 1.0 as NC ScrollView { id: controlRoot property alias model: sortedActivityList.sourceModel + property alias count: activityList.count + property alias contentY : activityList.contentY property bool isFileActivityList: false property int iconSize: Style.trayListItemIconSize property int delegateHorizontalPadding: 0 + function positionViewAtBeginning() { + activityList.positionViewAtBeginning() + } + signal openFile(string filePath) signal activityItemClicked(int index) diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index adbf1480ffdb3..3c6a22a9701f8 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -851,7 +851,42 @@ ApplicationWindow { anchors.right: trayWindowMainItem.right } + Loader { + id: newActivitiesButton + anchors.bottom: activityList.bottom + anchors.bottomMargin: 20 + width: 150 + height: 40 + anchors.horizontalCenter: activityList.horizontalCenter + z: 1 + + active: false + + sourceComponent: CustomButton { + hoverEnabled: true + padding: Style.smallSpacing + display: Button.TextOnly + + textColor: Style.currentUserHeaderTextColor + textColorHovered: Style.currentUserHeaderTextColor + contentsFont.bold: true + bgNormalColor: Qt.lighter(bgHoverColor, 1.25) + bgHoverColor: Style.currentUserHeaderColor + bgNormalOpacity: 1.0 + bgHoverOpacity: 1.7 + + anchors.fill: parent + + text: qsTr("New activities") + onClicked: { + activityList.positionViewAtBeginning(); + newActivitiesButton.active = false; + } + } + } + ActivityList { + id: activityList visible: !trayWindowMainItem.isUnifiedSearchActive anchors.top: syncStatus.bottom anchors.left: trayWindowMainItem.left @@ -864,6 +899,11 @@ ApplicationWindow { onActivityItemClicked: { model.slotTriggerDefaultAction(index) } + onCountChanged: { + if (contentY > 0) { + newActivitiesButton.active = true; + } + } } } // Item trayWindowMainItem } diff --git a/theme/Style/Style.qml b/theme/Style/Style.qml index 44ad1a6fb012f..f434140bcffd2 100644 --- a/theme/Style/Style.qml +++ b/theme/Style/Style.qml @@ -167,7 +167,7 @@ QtObject { property int progressBarRadius: 4 property int progressBarContentBorderWidth: 1 property int progressBarBackgroundBorderWidth: 1 - property color progressBarContentColor: buttonBackgroundColor + property color progressBarContentColor: ncBlue property color progressBarContentBorderColor: menuBorder property color progressBarBackgroundColor: backgroundColor property color progressBarBackgroundBorderColor: menuBorder