2022-01-04 17:28:26 +03:00
|
|
|
import QtQml 2.15
|
|
|
|
import QtQuick 2.15
|
2023-05-16 17:48:30 +03:00
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2022-01-04 17:28:26 +03:00
|
|
|
import Style 1.0
|
2022-01-28 19:03:39 +03:00
|
|
|
import com.nextcloud.desktopclient 1.0
|
2022-01-04 17:28:26 +03:00
|
|
|
|
2023-05-17 16:31:47 +03:00
|
|
|
Repeater {
|
2022-01-04 17:28:26 +03:00
|
|
|
id: root
|
|
|
|
|
|
|
|
property string objectType: ""
|
|
|
|
property variant linksForActionButtons: []
|
|
|
|
property variant linksContextMenu: []
|
|
|
|
property bool displayActions: false
|
|
|
|
|
|
|
|
property color moreActionsButtonColor: "transparent"
|
|
|
|
|
|
|
|
property int maxActionButtons: 0
|
|
|
|
|
|
|
|
property Flickable flickable
|
|
|
|
|
2023-06-08 14:26:59 +03:00
|
|
|
property bool talkReplyButtonVisible: true
|
|
|
|
|
2022-01-04 17:28:26 +03:00
|
|
|
signal triggerAction(int actionIndex)
|
2022-05-02 20:08:35 +03:00
|
|
|
signal showReplyField()
|
2022-01-04 17:28:26 +03:00
|
|
|
|
2023-05-17 16:31:47 +03:00
|
|
|
model: root.linksForActionButtons
|
2022-01-04 17:28:26 +03:00
|
|
|
|
2023-05-17 16:31:47 +03:00
|
|
|
CustomButton {
|
|
|
|
id: activityActionButton
|
2022-01-04 17:28:26 +03:00
|
|
|
|
2023-05-17 16:31:47 +03:00
|
|
|
property string verb: model.modelData.verb
|
|
|
|
property bool isTalkReplyButton: verb === "REPLY"
|
2022-01-04 17:28:26 +03:00
|
|
|
|
2023-05-17 16:31:47 +03:00
|
|
|
Layout.alignment: Qt.AlignTop | Qt.AlignRight
|
2022-01-04 17:28:26 +03:00
|
|
|
|
2023-05-17 16:31:47 +03:00
|
|
|
hoverEnabled: true
|
|
|
|
padding: Style.smallSpacing
|
|
|
|
display: Button.TextOnly
|
2022-01-04 17:28:26 +03:00
|
|
|
|
2023-05-17 16:31:47 +03:00
|
|
|
text: model.modelData.label
|
2022-01-04 17:28:26 +03:00
|
|
|
|
2023-05-17 16:31:47 +03:00
|
|
|
icon.source: model.modelData.imageSource ? model.modelData.imageSource + Style.adjustedCurrentUserHeaderColor : ""
|
2022-01-04 17:28:26 +03:00
|
|
|
|
2023-05-17 16:31:47 +03:00
|
|
|
onClicked: isTalkReplyButton ? root.showReplyField() : root.triggerAction(model.index)
|
2022-01-04 17:28:26 +03:00
|
|
|
|
2023-05-17 16:31:47 +03:00
|
|
|
textColor: Style.adjustedCurrentUserHeaderColor
|
|
|
|
textColorHovered: Style.currentUserHeaderTextColor
|
|
|
|
contentsFont.bold: true
|
|
|
|
bgColor: Style.currentUserHeaderColor
|
2023-06-08 14:26:59 +03:00
|
|
|
|
|
|
|
visible: verb !== "REPLY" || (verb === "REPLY" && root.talkReplyButtonVisible)
|
2022-01-04 17:28:26 +03:00
|
|
|
}
|
|
|
|
}
|