|
|
@@ -6,7 +6,7 @@ import QtGraphicalEffects 1.15
|
|
|
import Style 1.0
|
|
|
import com.nextcloud.desktopclient 1.0
|
|
|
|
|
|
-RowLayout {
|
|
|
+Item {
|
|
|
id: root
|
|
|
|
|
|
property variant activityData: {{}}
|
|
|
@@ -23,17 +23,20 @@ RowLayout {
|
|
|
|
|
|
signal dismissButtonClicked()
|
|
|
|
|
|
- spacing: Style.trayHorizontalMargin
|
|
|
-
|
|
|
Item {
|
|
|
id: thumbnailItem
|
|
|
- Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
|
|
- Layout.preferredWidth: root.iconSize
|
|
|
- Layout.preferredHeight: model.thumbnail && model.thumbnail.isMimeTypeIcon ? root.iconSize * 0.9 : root.iconSize
|
|
|
+
|
|
|
readonly property int imageWidth: width * (1 - Style.thumbnailImageSizeReduction)
|
|
|
readonly property int imageHeight: height * (1 - Style.thumbnailImageSizeReduction)
|
|
|
readonly property int thumbnailRadius: model.thumbnail && model.thumbnail.isUserAvatar ? width / 2 : 3
|
|
|
|
|
|
+ anchors.left: parent.left
|
|
|
+ anchors.top: parent.top
|
|
|
+ anchors.bottom: parent.bottom
|
|
|
+
|
|
|
+ implicitHeight: model.thumbnail && model.thumbnail.isMimeTypeIcon ? root.iconSize * 0.9 : root.iconSize
|
|
|
+ implicitWidth: root.iconSize
|
|
|
+
|
|
|
Loader {
|
|
|
id: thumbnailImageLoader
|
|
|
anchors.fill: parent
|
|
|
@@ -112,110 +115,183 @@ RowLayout {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Column {
|
|
|
- id: activityTextColumn
|
|
|
-
|
|
|
- Layout.topMargin: Style.activityContentSpace
|
|
|
- Layout.fillWidth: true
|
|
|
- Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
|
|
|
-
|
|
|
- spacing: Style.activityContentSpace
|
|
|
-
|
|
|
- EnforcedPlainTextLabel {
|
|
|
- id: activityTextTitle
|
|
|
- text: (root.activityData.type === "Activity" || root.activityData.type === "Notification") ? root.activityData.subject : root.activityData.message
|
|
|
- height: (text === "") ? 0 : implicitHeight
|
|
|
- width: parent.width
|
|
|
- elide: Text.ElideRight
|
|
|
- wrapMode: Text.Wrap
|
|
|
- maximumLineCount: 2
|
|
|
- font.pixelSize: Style.topLinePixelSize
|
|
|
- color: Style.ncTextColor
|
|
|
- visible: text !== ""
|
|
|
- }
|
|
|
+ ColumnLayout {
|
|
|
+ id: activityContentLayout
|
|
|
|
|
|
- EnforcedPlainTextLabel {
|
|
|
- id: activityTextInfo
|
|
|
- text: (root.activityData.type === "Sync") ? root.activityData.displayPath
|
|
|
- : (root.activityData.type === "File") ? root.activityData.subject
|
|
|
- : (root.activityData.type === "Notification") ? root.activityData.message
|
|
|
- : ""
|
|
|
- height: (text === "") ? 0 : implicitHeight
|
|
|
- width: parent.width
|
|
|
- elide: Text.ElideRight
|
|
|
- wrapMode: Text.Wrap
|
|
|
- maximumLineCount: 2
|
|
|
- font.pixelSize: Style.subLinePixelSize
|
|
|
- color: Style.ncTextColor
|
|
|
- visible: text !== ""
|
|
|
- }
|
|
|
+ anchors.left: thumbnailItem.right
|
|
|
+ anchors.right: parent.right
|
|
|
+ anchors.top: parent.top
|
|
|
+ anchors.bottom: parent.bottom
|
|
|
|
|
|
- EnforcedPlainTextLabel {
|
|
|
- id: activityTextDateTime
|
|
|
- text: root.activityData.dateTime
|
|
|
- height: (text === "") ? 0 : implicitHeight
|
|
|
- width: parent.width
|
|
|
- elide: Text.ElideRight
|
|
|
- wrapMode: Text.Wrap
|
|
|
- maximumLineCount: 2
|
|
|
- font.pixelSize: Style.subLinePixelSize
|
|
|
- color: Style.ncSecondaryTextColor
|
|
|
- visible: text !== ""
|
|
|
- }
|
|
|
+ spacing: Style.smallSpacing
|
|
|
+
|
|
|
+ RowLayout {
|
|
|
+ Layout.fillWidth: true
|
|
|
+ Layout.maximumWidth: activityContentLayout.width
|
|
|
+
|
|
|
+ spacing: Style.trayHorizontalMargin
|
|
|
+
|
|
|
+ EnforcedPlainTextLabel {
|
|
|
+ id: activityTextTitle
|
|
|
+ text: (root.activityData.type === "Activity" || root.activityData.type === "Notification") ? root.activityData.subject : root.activityData.message
|
|
|
+ height: (text === "") ? 0 : implicitHeight
|
|
|
+
|
|
|
+ Layout.maximumWidth: activityContentLayout.width - Style.trayHorizontalMargin -
|
|
|
+ (activityTextDateTime.visible ? activityTextDateTime.width + Style.trayHorizontalMargin : 0) -
|
|
|
+ (dismissActionButton.visible ? dismissActionButton.width + Style.trayHorizontalMargin : 0)
|
|
|
+ Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
|
|
+
|
|
|
+ elide: Text.ElideRight
|
|
|
+ wrapMode: Text.Wrap
|
|
|
+ maximumLineCount: 1
|
|
|
+ font.pixelSize: Style.topLinePixelSize
|
|
|
+ color: Style.ncTextColor
|
|
|
+ visible: text !== ""
|
|
|
+
|
|
|
+ NCToolTip {
|
|
|
+ text: parent.text
|
|
|
+ visible: parent.hovered
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Item {
|
|
|
+ Layout.fillWidth: true
|
|
|
+ Layout.leftMargin: -Style.trayHorizontalMargin
|
|
|
+ }
|
|
|
+
|
|
|
+ EnforcedPlainTextLabel {
|
|
|
+ id: activityTextDateTime
|
|
|
+
|
|
|
+ Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
|
|
|
+ height: (text === "") ? 0 : implicitHeight
|
|
|
+ width: parent.width
|
|
|
+
|
|
|
+ text: root.activityData.dateTime
|
|
|
+ elide: Text.ElideRight
|
|
|
+ wrapMode: Text.Wrap
|
|
|
+ maximumLineCount: 2
|
|
|
+ font.pixelSize: Style.subLinePixelSize
|
|
|
+ color: Style.ncSecondaryTextColor
|
|
|
+ visible: text !== ""
|
|
|
+ }
|
|
|
+
|
|
|
+ RoundButton {
|
|
|
+ id: dismissActionButton
|
|
|
|
|
|
- EnforcedPlainTextLabel {
|
|
|
- id: talkReplyMessageSent
|
|
|
- text: root.activityData.messageSent
|
|
|
- height: (text === "") ? 0 : implicitHeight
|
|
|
- width: parent.width
|
|
|
- elide: Text.ElideRight
|
|
|
- wrapMode: Text.Wrap
|
|
|
- maximumLineCount: 2
|
|
|
- font.pixelSize: Style.topLinePixelSize
|
|
|
- color: Style.ncSecondaryTextColor
|
|
|
- visible: text !== ""
|
|
|
+ Layout.preferredWidth: Style.dismissButtonSize
|
|
|
+ Layout.preferredHeight: Style.dismissButtonSize
|
|
|
+ Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
|
|
|
+
|
|
|
+ visible: root.showDismissButton && !fileDetailsButton.visible
|
|
|
+
|
|
|
+ icon.source: "image://svgimage-custom-color/clear.svg" + "/" + Style.ncTextColor
|
|
|
+
|
|
|
+ flat: true
|
|
|
+ display: Button.IconOnly
|
|
|
+ hoverEnabled: true
|
|
|
+ padding: 0
|
|
|
+
|
|
|
+ NCToolTip {
|
|
|
+ text: qsTr("Dismiss")
|
|
|
+ visible: parent.hovered
|
|
|
+ }
|
|
|
+
|
|
|
+ onClicked: root.dismissButtonClicked()
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- RoundButton {
|
|
|
- id: dismissActionButton
|
|
|
+ RowLayout {
|
|
|
+ Layout.fillWidth: true
|
|
|
+ Layout.fillHeight: true
|
|
|
+ Layout.minimumHeight: Style.minimumActivityItemHeight
|
|
|
+ Layout.maximumWidth: root.width - thumbnailItem.width
|
|
|
+ spacing: Style.trayHorizontalMargin
|
|
|
+
|
|
|
+ EnforcedPlainTextLabel {
|
|
|
+ id: activityTextInfo
|
|
|
+
|
|
|
+ Layout.fillWidth: true
|
|
|
+ Layout.fillHeight: true
|
|
|
+ Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
|
|
+
|
|
|
+ text: (root.activityData.type === "Sync") ? root.activityData.displayPath
|
|
|
+ : (root.activityData.type === "File") ? root.activityData.subject
|
|
|
+ : (root.activityData.type === "Notification") ? root.activityData.message
|
|
|
+ : ""
|
|
|
+ height: (text === "") ? 0 : implicitHeight
|
|
|
+ elide: Text.ElideRight
|
|
|
+ wrapMode: Text.Wrap
|
|
|
+ maximumLineCount: 2
|
|
|
+ font.pixelSize: Style.subLinePixelSize
|
|
|
+ color: Style.ncTextColor
|
|
|
+ visible: text !== ""
|
|
|
+ }
|
|
|
+
|
|
|
+ Item {
|
|
|
+ Layout.fillWidth: true
|
|
|
+ }
|
|
|
+
|
|
|
+ Button {
|
|
|
+ id: fileDetailsButton
|
|
|
|
|
|
- Layout.preferredWidth: Style.headerButtonIconSize
|
|
|
- Layout.preferredHeight: Style.headerButtonIconSize
|
|
|
+ Layout.preferredWidth: Style.headerButtonIconSize
|
|
|
+ Layout.preferredHeight: Style.headerButtonIconSize
|
|
|
+ Layout.alignment: Qt.AlignTop | Qt.AlignRight
|
|
|
|
|
|
- visible: root.showDismissButton && !fileDetailsButton.visible
|
|
|
+ icon.source: "image://svgimage-custom-color/more.svg" + "/" + Style.adjustedCurrentUserHeaderColor
|
|
|
|
|
|
- icon.source: "image://svgimage-custom-color/clear.svg" + "/" + Style.ncTextColor
|
|
|
- //imageSourceHover: "image://svgimage-custom-color/clear.svg" + "/" + UserModel.currentUser.headerTextColor
|
|
|
+ NCToolTip {
|
|
|
+ text: qsTr("Open file details")
|
|
|
+ visible: parent.hovered
|
|
|
+ }
|
|
|
|
|
|
- flat: true
|
|
|
- display: Button.IconOnly
|
|
|
- hoverEnabled: true
|
|
|
- padding: 0
|
|
|
- //toolTipText: qsTr("Dismiss")
|
|
|
+ flat: true
|
|
|
+ display: Button.IconOnly
|
|
|
+ hoverEnabled: true
|
|
|
+ padding: 0
|
|
|
|
|
|
- //bgColor: Style.menuBorder
|
|
|
+ visible: model.showFileDetails
|
|
|
|
|
|
- onClicked: root.dismissButtonClicked()
|
|
|
- }
|
|
|
+ onClicked: Systray.presentShareViewInTray(model.openablePath)
|
|
|
+ }
|
|
|
+
|
|
|
+ EnforcedPlainTextLabel {
|
|
|
+ id: talkReplyMessageSent
|
|
|
|
|
|
- Button {
|
|
|
- id: fileDetailsButton
|
|
|
+ height: (text === "") ? 0 : implicitHeight
|
|
|
+ width: parent.width
|
|
|
+ Layout.alignment: Qt.AlignTop | Qt.AlignRight
|
|
|
|
|
|
- Layout.preferredWidth: Style.headerButtonIconSize
|
|
|
- Layout.preferredHeight: Style.headerButtonIconSize
|
|
|
+ text: root.activityData.messageSent
|
|
|
+ elide: Text.ElideRight
|
|
|
+ wrapMode: Text.Wrap
|
|
|
+ maximumLineCount: 2
|
|
|
+ font.pixelSize: Style.topLinePixelSize
|
|
|
+ color: Style.ncSecondaryTextColor
|
|
|
+ visible: text !== ""
|
|
|
+ }
|
|
|
|
|
|
- icon.source: "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
|
|
|
+ ActivityItemActions {
|
|
|
+ id: activityActions
|
|
|
|
|
|
- flat: true
|
|
|
- display: Button.IconOnly
|
|
|
- padding: 0
|
|
|
+ visible: !isFileActivityList && activityData.linksForActionButtons.length > 0 && !isTalkReplyOptionVisible
|
|
|
|
|
|
- visible: model.showFileDetails
|
|
|
+ Layout.fillWidth: true
|
|
|
+ Layout.leftMargin: Style.trayListItemIconSize + Style.trayHorizontalMargin
|
|
|
+ Layout.preferredHeight: Style.standardPrimaryButtonHeight
|
|
|
+ Layout.alignment: Qt.AlignTop | Qt.AlignRight
|
|
|
|
|
|
- onClicked: Systray.presentShareViewInTray(model.openablePath)
|
|
|
+ displayActions: activityData.displayActions
|
|
|
+ objectType: activityData.objectType
|
|
|
+ linksForActionButtons: activityData.linksForActionButtons
|
|
|
+ linksContextMenu: activityData.linksContextMenu
|
|
|
+
|
|
|
+ maxActionButtons: activityModel.maxActionButtons
|
|
|
+
|
|
|
+ onTriggerAction: activityModel.slotTriggerAction(model.activityIndex, actionIndex)
|
|
|
+
|
|
|
+ onShowReplyField: isTalkReplyOptionVisible = true
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|