diff options
author | Joseph Donofry <joedonofry@gmail.com> | 2019-06-11 21:04:30 -0400 |
---|---|---|
committer | Joseph Donofry <joedonofry@gmail.com> | 2019-06-11 21:04:30 -0400 |
commit | 9159b9ce22efa4972792b5400fd384457c349caa (patch) | |
tree | 2ef9f12d1011ea6a163e177ed7b639b9cbad1bb9 /src/TextInputWidget.h | |
parent | Add initial support for rich replies to nheko (diff) | |
download | nheko-9159b9ce22efa4972792b5400fd384457c349caa.tar.xz |
Initial Support for Rich Replies
Add placeholder UI for showing replies in the text entry widget. Existing quoting capability has been removed (Temporarily), as it was replaced with the new reply capability. Replies sent from nheko do not currently appear correctly in the timeline (this will be fixed in a future commit).
Diffstat (limited to 'src/TextInputWidget.h')
-rw-r--r-- | src/TextInputWidget.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/TextInputWidget.h b/src/TextInputWidget.h index a12183d8..2936340b 100644 --- a/src/TextInputWidget.h +++ b/src/TextInputWidget.h @@ -28,7 +28,8 @@ #include <QTextEdit> #include <QWidget> -#include "SuggestionsPopup.h" +#include "popups/SuggestionsPopup.h" +#include "popups/ReplyPopup.h" #include "dialogs/PreviewUploadOverlay.h" #include "emoji/PickButton.h" @@ -55,6 +56,7 @@ public: void submit(); void setRelatedEvent(const QString &event) { related_event_ = event; } + void showReplyPopup(const QString &user, const QString &msg, const QString &event_id); signals: void heightChanged(int height); @@ -85,7 +87,7 @@ protected: void insertFromMimeData(const QMimeData *source) override; void focusOutEvent(QFocusEvent *event) override { - popup_.hide(); + suggestionsPopup_.hide(); QTextEdit::focusOutEvent(event); } @@ -94,7 +96,8 @@ private: size_t history_index_; QTimer *typingTimer_; - SuggestionsPopup popup_; + SuggestionsPopup suggestionsPopup_; + ReplyPopup replyPopup_; // Used for replies QString related_event_; @@ -109,7 +112,8 @@ private: int anchorWidth(AnchorType anchor) { return static_cast<int>(anchor); } - void closeSuggestions() { popup_.hide(); } + void closeSuggestions() { suggestionsPopup_.hide(); } + void closeReply() { replyPopup_.hide(); } void resetAnchor() { atTriggerPosition_ = -1; } bool isAnchorValid() { return atTriggerPosition_ != -1; } bool hasAnchor(int pos, AnchorType anchor) |