Replace share button with file details button
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 9 Nov 2022 12:10:59 +0000 (13:10 +0100)
committerClaudio Cambra <claudio.cambra@gmail.com>
Fri, 9 Dec 2022 14:06:35 +0000 (15:06 +0100)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/tray/ActivityItem.qml
src/gui/tray/ActivityItemActions.qml
src/gui/tray/ActivityItemContent.qml
src/gui/tray/Window.qml
src/gui/tray/activitylistmodel.cpp
src/gui/tray/activitylistmodel.h

index 6369b4f7c71f4a3e655160f796e8054a8e1bad94..ebbac6e5a24ca477c4a7de89d93b3a23730f4528 100644 (file)
@@ -51,8 +51,6 @@ ItemDelegate {
 
             activityData: model
 
-            onShareButtonClicked: Systray.presentShareViewInTray(model.openablePath)
-
             onDismissButtonClicked: activityModel.slotTriggerDismiss(model.activityIndex)
         }
 
index 1b7ffc4f9b58b16caf905c361ddf48487c4393d0..908aab9d6b372f94a513e65b529739e45c50aea0 100644 (file)
@@ -89,17 +89,6 @@ RowLayout {
                     moreActionsButtonContextMenu.close();
                 }
             }
-
-            ActivityItemContextMenu {
-                id: moreActionsButtonContextMenu
-
-                maxActionButtons: root.maxActionButtons
-                linksContextMenu: root.linksContextMenu
-
-                onMenuEntryTriggered: function(entryIndex) {
-                    root.triggerAction(entryIndex)
-                }
-            }
         }
     }
 }
index 6a049ca9dc7e4eec13325b969bc69c19cb0d3280..88caedaea48c6244a6fc91326fb86088993f2244 100644 (file)
@@ -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
 
@@ -182,7 +181,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
@@ -195,20 +194,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)
     }
 }
index a084efa74ffb607d7022ce1aee3ce09fea4c68fe..fdf96a64f5e64da10a8807cbf6033739eedb5ee9 100644 (file)
@@ -188,10 +188,11 @@ ApplicationWindow {
                                                 fileDetailsDrawer.pageToShow);\r
                 }\r
             }\r
-            sourceComponent:FileDetailsPage {\r
+            sourceComponent: FileDetailsPage {\r
                 id: fileDetails\r
 \r
-                anchors.fill: parent\r
+                width: parent.width\r
+                height: parent.height\r
 \r
                 background: null\r
                 accountState: fileDetailsDrawer.folderAccountState\r
index 352f23a559e282aa7fe16ed244fd754ed15d666e..5e16645d6a75efbeb26ec40dc0ee20844ce51ceb 100644 (file)
@@ -76,7 +76,7 @@ QHash<int, QByteArray> 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 &&
index 3ec5955557683bcec89790cae69f09284f29863d..17f1557db9fcd710dbbedfc3bb0700ec1d9cc2e0 100644 (file)
@@ -65,7 +65,7 @@ public:
         PointInTimeRole,
         AccountConnectedRole,
         DisplayActions,
-        ShareableRole,
+        ShowFileDetailsRole,
         IsCurrentUserFileActivityRole,
         ThumbnailRole,
         TalkNotificationConversationTokenRole,