Skip to content

Commit

Permalink
Replace share button with file details button
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
  • Loading branch information
claucambra committed Nov 9, 2022
1 parent 8f4dfdb commit a036fe5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 26 deletions.
2 changes: 0 additions & 2 deletions src/gui/tray/ActivityItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ ItemDelegate {

activityData: model

onShareButtonClicked: Systray.presentShareViewInTray(model.openablePath)

onDismissButtonClicked: activityModel.slotTriggerDismiss(model.activityIndex)
}

Expand Down
11 changes: 0 additions & 11 deletions src/gui/tray/ActivityItemActions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,6 @@ RowLayout {
moreActionsButtonContextMenu.close();
}
}

ActivityItemContextMenu {
id: moreActionsButtonContextMenu

maxActionButtons: root.maxActionButtons
linksContextMenu: root.linksContextMenu

onMenuEntryTriggered: function(entryIndex) {
root.triggerAction(entryIndex)
}
}
}
}
}
16 changes: 7 additions & 9 deletions src/gui/tray/ActivityItemContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,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)
}
}
2 changes: 1 addition & 1 deletion src/gui/tray/Window.qml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ ApplicationWindow {
fileDetailsDrawer.pageToShow);
}
}
sourceComponent:FileDetailsPage {
sourceComponent: FileDetailsPage {
id: fileDetails

anchors.fill: parent
Expand Down
4 changes: 2 additions & 2 deletions src/gui/tray/activitylistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 &&
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/activitylistmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ActivityListModel : public QAbstractListModel
PointInTimeRole,
AccountConnectedRole,
DisplayActions,
ShareableRole,
ShowFileDetailsRole,
IsCurrentUserFileActivityRole,
ThumbnailRole,
TalkNotificationConversationTokenRole,
Expand Down

0 comments on commit a036fe5

Please sign in to comment.