From 38c7fadb3940ed94f0ddb44d1a74b01f99f49dfa Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 9 Nov 2022 13:10:59 +0100 Subject: [PATCH] Replace share button with file details button Signed-off-by: Claudio Cambra --- src/gui/tray/ActivityItem.qml | 2 -- src/gui/tray/ActivityItemActions.qml | 11 ----------- src/gui/tray/ActivityItemContent.qml | 21 +++++++++------------ src/gui/tray/Window.qml | 5 +++-- src/gui/tray/activitylistmodel.cpp | 4 ++-- src/gui/tray/activitylistmodel.h | 2 +- 6 files changed, 15 insertions(+), 30 deletions(-) diff --git a/src/gui/tray/ActivityItem.qml b/src/gui/tray/ActivityItem.qml index 6369b4f7c71f4..ebbac6e5a24ca 100644 --- a/src/gui/tray/ActivityItem.qml +++ b/src/gui/tray/ActivityItem.qml @@ -51,8 +51,6 @@ ItemDelegate { activityData: model - onShareButtonClicked: Systray.presentShareViewInTray(model.openablePath) - onDismissButtonClicked: activityModel.slotTriggerDismiss(model.activityIndex) } diff --git a/src/gui/tray/ActivityItemActions.qml b/src/gui/tray/ActivityItemActions.qml index 1b7ffc4f9b58b..908aab9d6b372 100644 --- a/src/gui/tray/ActivityItemActions.qml +++ b/src/gui/tray/ActivityItemActions.qml @@ -89,17 +89,6 @@ RowLayout { moreActionsButtonContextMenu.close(); } } - - ActivityItemContextMenu { - id: moreActionsButtonContextMenu - - maxActionButtons: root.maxActionButtons - linksContextMenu: root.linksContextMenu - - onMenuEntryTriggered: function(entryIndex) { - root.triggerAction(entryIndex) - } - } } } } diff --git a/src/gui/tray/ActivityItemContent.qml b/src/gui/tray/ActivityItemContent.qml index 80bc931fc7460..015ef4ea3b798 100644 --- a/src/gui/tray/ActivityItemContent.qml +++ b/src/gui/tray/ActivityItemContent.qml @@ -15,12 +15,11 @@ RowLayout { property bool showDismissButton: false - property bool childHovered: shareButton.hovered || dismissActionButton.hovered + property bool childHovered: fileDetailsButton.hovered || dismissActionButton.hovered property int iconSize: Style.trayListItemIconSize signal dismissButtonClicked() - signal shareButtonClicked() spacing: Style.trayHorizontalMargin @@ -186,7 +185,7 @@ RowLayout { Layout.preferredWidth: Style.trayListItemIconSize Layout.preferredHeight: Style.trayListItemIconSize - visible: root.showDismissButton && !shareButton.visible + visible: root.showDismissButton && !fileDetailsButton.visible imageSource: "image://svgimage-custom-color/clear.svg" + "/" + Style.ncTextColor imageSourceHover: "image://svgimage-custom-color/clear.svg" + "/" + UserModel.currentUser.headerTextColor @@ -199,20 +198,18 @@ RowLayout { } CustomButton { - id: shareButton + id: fileDetailsButton Layout.preferredWidth: Style.trayListItemIconSize Layout.preferredHeight: Style.trayListItemIconSize - visible: root.activityData.isShareable - - imageSource: "image://svgimage-custom-color/share.svg" + "/" + Style.adjustedCurrentUserHeaderColor - imageSourceHover: "image://svgimage-custom-color/share.svg" + "/" + Style.currentUserHeaderTextColor - - toolTipText: qsTr("Open share dialog") - + imageSource: "image://svgimage-custom-color/more.svg" + "/" + Style.adjustedCurrentUserHeaderColor + imageSourceHover: "image://svgimage-custom-color/more.svg" + "/" + Style.currentUserHeaderTextColor + toolTipText: qsTr("Open file details") bgColor: Style.currentUserHeaderColor - onClicked: root.shareButtonClicked() + visible: model.showFileDetails + + onClicked: Systray.presentShareViewInTray(model.openablePath) } } diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 40319c4bb13e3..79008164f5361 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -188,10 +188,11 @@ ApplicationWindow { fileDetailsDrawer.pageToShow); } } - sourceComponent:FileDetailsPage { + sourceComponent: FileDetailsPage { id: fileDetails - anchors.fill: parent + width: parent.width + height: parent.height background: null accountState: fileDetailsDrawer.folderAccountState diff --git a/src/gui/tray/activitylistmodel.cpp b/src/gui/tray/activitylistmodel.cpp index 352f23a559e28..5e16645d6a75e 100644 --- a/src/gui/tray/activitylistmodel.cpp +++ b/src/gui/tray/activitylistmodel.cpp @@ -76,7 +76,7 @@ QHash ActivityListModel::roleNames() const roles[ObjectNameRole] = "objectName"; roles[PointInTimeRole] = "dateTime"; roles[DisplayActions] = "displayActions"; - roles[ShareableRole] = "isShareable"; + roles[ShowFileDetailsRole] = "showFileDetails"; roles[IsCurrentUserFileActivityRole] = "isCurrentUserFileActivity"; roles[IsCurrentUserFileActivityRole] = "isCurrentUserFileActivity"; roles[ThumbnailRole] = "thumbnail"; @@ -342,7 +342,7 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const return (ast && ast->isConnected()); case DisplayActions: return _displayActions; - case ShareableRole: + case ShowFileDetailsRole: return !data(index, PathRole).toString().isEmpty() && a._objectType == QStringLiteral("files") && _displayActions && diff --git a/src/gui/tray/activitylistmodel.h b/src/gui/tray/activitylistmodel.h index 3ec5955557683..17f1557db9fcd 100644 --- a/src/gui/tray/activitylistmodel.h +++ b/src/gui/tray/activitylistmodel.h @@ -65,7 +65,7 @@ class ActivityListModel : public QAbstractListModel PointInTimeRole, AccountConnectedRole, DisplayActions, - ShareableRole, + ShowFileDetailsRole, IsCurrentUserFileActivityRole, ThumbnailRole, TalkNotificationConversationTokenRole,