2024-08-07 22:54:37 +03:00
|
|
|
import QtQml
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
|
|
|
import Style
|
|
|
|
import com.nextcloud.desktopclient
|
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
|
|
|
|
|
2024-08-12 11:18:32 +03:00
|
|
|
property color moreActionsButtonColor: palette.base
|
2022-01-04 17:28:26 +03:00
|
|
|
|
|
|
|
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-06-08 14:26:59 +03:00
|
|
|
visible: verb !== "REPLY" || (verb === "REPLY" && root.talkReplyButtonVisible)
|
2022-01-04 17:28:26 +03:00
|
|
|
}
|
|
|
|
}
|