Display input once user clicked on Reply.

Signed-off-by: Camila <hello@camila.codes>
This commit is contained in:
Camila 2022-03-24 20:17:11 +01:00
parent b2056187a0
commit 0890a78262
No known key found for this signature in database
GPG key ID: 7A4A6121E88E2AD4
4 changed files with 20 additions and 7 deletions

View file

@ -15,6 +15,16 @@ MouseArea {
property bool isChatActivity: model.objectType === "chat" || model.objectType === "room" || model.objectType === "call"
property bool isTalkReplyPossible: model.conversationToken !== ""
property bool displayTalkReplyOptions: false
Connections {
target: activityModel
function onDisplayTalkReplyOptions(activityIndex) {
if (model.index === activityIndex) {
displayTalkReplyOptions = true;
}
}
}
signal fileActivityButtonClicked(string absolutePath)
enabled: (model.path !== "" || model.link !== "" || model.isCurrentUserFileActivity === true)
@ -73,13 +83,12 @@ MouseArea {
ActivityItemActions {
id: activityActions
visible: !root.isFileActivityList && model.linksForActionButtons.length > 0
visible: !root.isFileActivityList && model.linksForActionButtons.length > 0 && !displayTalkReplyOptions
Layout.preferredHeight: Style.trayWindowHeaderHeight * 0.85
Layout.fillWidth: true
Layout.leftMargin: 40
Layout.bottomMargin: model.links.length > 1 ? 5 : 0
Layout.topMargin: isTalkReplyPossible? 48 : 0
displayActions: model.displayActions
objectType: model.objectType

View file

@ -133,7 +133,8 @@ RowLayout {
Loader {
id: talkReplyTextFieldLoader
active: isChatActivity && isTalkReplyPossible
active: isChatActivity && isTalkReplyPossible && displayTalkReplyOptions
visible: displayTalkReplyOptions
anchors.top: activityTextDateTime.bottom
anchors.topMargin: 10

View file

@ -611,6 +611,12 @@ void ActivityListModel::slotTriggerAction(const int activityIndex, const int act
const auto action = activity._links[actionIndex];
// TODO this will change with https://github.com/nextcloud/desktop/issues/4159
if (action._verb == "WEB" && action._label == tr("View chat")) {
emit displayTalkReplyOptions(activityIndex);
return;
}
if (action._verb == "WEB") {
Utility::openBrowser(QUrl(action._link));
return;
@ -832,7 +838,4 @@ QString ActivityListModel::talkReplyMessageSent(const int activityIndex) const
return _finalList[activityIndex]._talkNotificationData.messageSent;
}
}

View file

@ -120,7 +120,7 @@ signals:
void activityJobStatusCode(int statusCode);
void sendNotificationRequest(const QString &accountName, const QString &link, const QByteArray &verb, int row);
void messageSent();
void displayTalkReplyOptions(const int activityIndex);
protected:
void setup();