mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 03:00:46 +03:00
Make closing the reply popup actually clear the reply message
This commit is contained in:
parent
9d90467e6a
commit
096db389d1
4 changed files with 9 additions and 1 deletions
|
@ -300,7 +300,7 @@ Item {
|
|||
ToolTip.visible: closeReplyButton.hovered
|
||||
ToolTip.text: qsTr("Close")
|
||||
|
||||
onClicked: timelineManager.updateReplyingEvent(undefined)
|
||||
onClicked: timelineManager.closeReply()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -524,6 +524,7 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
|
|||
connect(this, &ChatPage::messageReply, this, [this](const RelatedInfo &related) {
|
||||
view_manager_->updateReplyingEvent(QString::fromStdString(related.related_event));
|
||||
});
|
||||
connect(view_manager_, &TimelineViewManager::replyClosed, text_input_, &TextInputWidget::closeReplyPopup);
|
||||
|
||||
instance_ = this;
|
||||
}
|
||||
|
|
|
@ -164,6 +164,7 @@ public slots:
|
|||
void hideUploadSpinner();
|
||||
void focusLineEdit() { input_->setFocus(); }
|
||||
void addReply(const RelatedInfo &related);
|
||||
void closeReplyPopup() { input_->closeReply(); }
|
||||
|
||||
private slots:
|
||||
void addSelectedEmoji(const QString &emoji);
|
||||
|
|
|
@ -47,6 +47,7 @@ signals:
|
|||
void activeTimelineChanged(TimelineModel *timeline);
|
||||
void initialSyncChanged(bool isInitialSync);
|
||||
void replyingEventChanged(QString replyingEvent);
|
||||
void replyClosed();
|
||||
|
||||
public slots:
|
||||
void updateReplyingEvent(const QString &replyingEvent)
|
||||
|
@ -56,6 +57,11 @@ public slots:
|
|||
emit replyingEventChanged(replyingEvent_);
|
||||
}
|
||||
}
|
||||
void closeReply()
|
||||
{
|
||||
this->updateReplyingEvent(nullptr);
|
||||
emit replyClosed();
|
||||
}
|
||||
QString getReplyingEvent() const { return replyingEvent_; }
|
||||
void updateReadReceipts(const QString &room_id, const std::vector<QString> &event_ids);
|
||||
void initWithMessages(const std::map<QString, mtx::responses::Timeline> &msgs);
|
||||
|
|
Loading…
Reference in a new issue