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 14, 2022
1 parent 18876bc commit 04a3baa
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 29 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)
}
}
}
}
}
21 changes: 9 additions & 12 deletions src/gui/tray/ActivityItemContent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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)
}
}
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 04a3baa

Please sign in to comment.