diff --git a/src/popups/ReplyPopup.cpp b/src/popups/ReplyPopup.cpp
index 3c7c482a..0ebf7c88 100644
--- a/src/popups/ReplyPopup.cpp
+++ b/src/popups/ReplyPopup.cpp
@@ -7,6 +7,7 @@
#include "../Utils.h"
#include "../ui/Avatar.h"
#include "../ui/DropShadow.h"
+#include "../ui/TextLabel.h"
#include "ReplyPopup.h"
ReplyPopup::ReplyPopup(QWidget *parent)
@@ -42,7 +43,7 @@ ReplyPopup::ReplyPopup(QWidget *parent)
closeBtn_ = new FlatButton(this);
closeBtn_->setToolTip(tr("Logout"));
- closeBtn_->setCornerRadius(buttonSize_ / 2);
+ closeBtn_->setCornerRadius(buttonSize_ / 4);
closeBtn_->setText("X");
QIcon icon;
@@ -57,7 +58,8 @@ ReplyPopup::ReplyPopup(QWidget *parent)
topLayout_->addLayout(buttonLayout_);
mainLayout_->addLayout(topLayout_);
- msgLabel_ = new QLabel(this);
+ msgLabel_ = new TextLabel(this);
+ msgLabel_->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextBrowserInteraction);
mainLayout_->addWidget(msgLabel_);
eventLabel_ = new QLabel(this);
mainLayout_->addWidget(eventLabel_);
@@ -66,14 +68,16 @@ ReplyPopup::ReplyPopup(QWidget *parent)
}
void
-ReplyPopup::setReplyContent(const QString &user, const QString &msg, const QString &srcEvent)
+ReplyPopup::setReplyContent(const RelatedInfo &related)
{
// Update the current widget with the new data.
- userItem_->updateItem(user);
+ userItem_->updateItem(related.quoted_user);
- msgLabel_->setText(msg);
+ msgLabel_->setText(utils::getFormattedQuoteBody(related, "")
+ .replace("<mx-reply>", "")
+ .replace("</mx-reply>", ""));
- eventLabel_->setText(srcEvent);
+ // eventLabel_->setText(srcEvent);
adjustSize();
}
diff --git a/src/popups/ReplyPopup.h b/src/popups/ReplyPopup.h
index 829f707b..b28cd0cf 100644
--- a/src/popups/ReplyPopup.h
+++ b/src/popups/ReplyPopup.h
@@ -9,7 +9,9 @@
#include "../AvatarProvider.h"
#include "../Cache.h"
#include "../ChatPage.h"
+#include "../Utils.h"
#include "../ui/FlatButton.h"
+#include "../ui/TextLabel.h"
#include "PopupItem.h"
class ReplyPopup : public QWidget
@@ -20,7 +22,7 @@ public:
explicit ReplyPopup(QWidget *parent = nullptr);
public slots:
- void setReplyContent(const QString &user, const QString &msg, const QString &srcEvent);
+ void setReplyContent(const RelatedInfo &related);
protected:
void paintEvent(QPaintEvent *event) override;
@@ -38,7 +40,7 @@ private:
UserItem *userItem_;
FlatButton *closeBtn_;
- QLabel *msgLabel_;
+ TextLabel *msgLabel_;
QLabel *eventLabel_;
int buttonSize_;
|