Skip to content
Snippets Groups Projects
Verified Commit 096db389 authored by Joe Donofry's avatar Joe Donofry
Browse files

Make closing the reply popup actually clear the reply message

parent 9d90467e
No related branches found
No related tags found
No related merge requests found
...@@ -300,7 +300,7 @@ Item { ...@@ -300,7 +300,7 @@ Item {
ToolTip.visible: closeReplyButton.hovered ToolTip.visible: closeReplyButton.hovered
ToolTip.text: qsTr("Close") ToolTip.text: qsTr("Close")
onClicked: timelineManager.updateReplyingEvent(undefined) onClicked: timelineManager.closeReply()
} }
} }
} }
......
...@@ -524,6 +524,7 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent) ...@@ -524,6 +524,7 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
connect(this, &ChatPage::messageReply, this, [this](const RelatedInfo &related) { connect(this, &ChatPage::messageReply, this, [this](const RelatedInfo &related) {
view_manager_->updateReplyingEvent(QString::fromStdString(related.related_event)); view_manager_->updateReplyingEvent(QString::fromStdString(related.related_event));
}); });
connect(view_manager_, &TimelineViewManager::replyClosed, text_input_, &TextInputWidget::closeReplyPopup);
instance_ = this; instance_ = this;
} }
......
...@@ -164,6 +164,7 @@ public slots: ...@@ -164,6 +164,7 @@ public slots:
void hideUploadSpinner(); void hideUploadSpinner();
void focusLineEdit() { input_->setFocus(); } void focusLineEdit() { input_->setFocus(); }
void addReply(const RelatedInfo &related); void addReply(const RelatedInfo &related);
void closeReplyPopup() { input_->closeReply(); }
private slots: private slots:
void addSelectedEmoji(const QString &emoji); void addSelectedEmoji(const QString &emoji);
......
...@@ -47,6 +47,7 @@ signals: ...@@ -47,6 +47,7 @@ signals:
void activeTimelineChanged(TimelineModel *timeline); void activeTimelineChanged(TimelineModel *timeline);
void initialSyncChanged(bool isInitialSync); void initialSyncChanged(bool isInitialSync);
void replyingEventChanged(QString replyingEvent); void replyingEventChanged(QString replyingEvent);
void replyClosed();
public slots: public slots:
void updateReplyingEvent(const QString &replyingEvent) void updateReplyingEvent(const QString &replyingEvent)
...@@ -56,6 +57,11 @@ public slots: ...@@ -56,6 +57,11 @@ public slots:
emit replyingEventChanged(replyingEvent_); emit replyingEventChanged(replyingEvent_);
} }
} }
void closeReply()
{
this->updateReplyingEvent(nullptr);
emit replyClosed();
}
QString getReplyingEvent() const { return replyingEvent_; } QString getReplyingEvent() const { return replyingEvent_; }
void updateReadReceipts(const QString &room_id, const std::vector<QString> &event_ids); void updateReadReceipts(const QString &room_id, const std::vector<QString> &event_ids);
void initWithMessages(const std::map<QString, mtx::responses::Timeline> &msgs); void initWithMessages(const std::map<QString, mtx::responses::Timeline> &msgs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment