diff --git a/resources/styles/nheko-dark.qss b/resources/styles/nheko-dark.qss index 5567f32ce449939d1596fe264f562062c1e56d83..c55960f92a02b5334a0da7c7ddf8e8c57c122cce 100644 --- a/resources/styles/nheko-dark.qss +++ b/resources/styles/nheko-dark.qss @@ -41,6 +41,10 @@ SuggestionsPopup { background-color: #202228; } +ReplyPopup { + background-color: #202228; +} + PopupItem { background-color: #202228; qproperty-hoverColor: rgba(45, 49, 57, 120); diff --git a/resources/styles/nheko.qss b/resources/styles/nheko.qss index 58e83c228f82ddec2b6fdab6cf4f8da748fed56d..c352956ab1160ca7d7352dd20b7cc8776b9a1a69 100644 --- a/resources/styles/nheko.qss +++ b/resources/styles/nheko.qss @@ -46,6 +46,10 @@ SuggestionsPopup { background-color: white; } +ReplyPopup { + background-color: white; +} + PopupItem { background-color: white; qproperty-hoverColor: rgba(192, 193, 195, 120); diff --git a/src/ChatPage.h b/src/ChatPage.h index 09e7a2c6e7fb674c93374d6ec3352a4dc58b133f..f70f5bddd553aa4b63428074b316c88e929c500b 100644 --- a/src/ChatPage.h +++ b/src/ChatPage.h @@ -83,7 +83,9 @@ signals: void connectionLost(); void connectionRestored(); - void messageReply(const QString &username, const QString &msg, const QString &related_event); + void messageReply(const QString &username, + const QString &msg, + const QString &related_event); void notificationsRetrieved(const mtx::responses::Notifications &); diff --git a/src/TextInputWidget.cpp b/src/TextInputWidget.cpp index b4251a0ec6e075dda06005d89876188a582a6162..dc41b4d325916e1d6b35b93ed03b2b5a72adef92 100644 --- a/src/TextInputWidget.cpp +++ b/src/TextInputWidget.cpp @@ -76,7 +76,7 @@ FilteredTextEdit::FilteredTextEdit(QWidget *parent) &FilteredTextEdit::uploadData); connect(this, &FilteredTextEdit::resultsRetrieved, this, &FilteredTextEdit::showResults); - connect(&replyPopup_, &ReplyPopup::userSelected, this, [this](const QString &text) { + connect(&replyPopup_, &ReplyPopup::userSelected, this, [](const QString &text) { // TODO: Show user avatar window. nhlog::ui()->info("User selected: " + text.toStdString()); }); @@ -176,18 +176,16 @@ FilteredTextEdit::keyPressEvent(QKeyEvent *event) } if (replyPopup_.isVisible()) { - switch (event->key()) - { + switch (event->key()) { case Qt::Key_Escape: closeReply(); return; - + default: break; } } - switch (event->key()) { case Qt::Key_At: atTriggerPosition_ = textCursor().position(); diff --git a/src/TextInputWidget.h b/src/TextInputWidget.h index 2936340be2290eed096a517dbf2f474750591dc4..c462de05d693fcb877863e316368edd732d87c0b 100644 --- a/src/TextInputWidget.h +++ b/src/TextInputWidget.h @@ -28,10 +28,10 @@ #include <QTextEdit> #include <QWidget> -#include "popups/SuggestionsPopup.h" -#include "popups/ReplyPopup.h" #include "dialogs/PreviewUploadOverlay.h" #include "emoji/PickButton.h" +#include "popups/ReplyPopup.h" +#include "popups/SuggestionsPopup.h" namespace dialogs { class PreviewUploadOverlay; diff --git a/src/popups/PopupItem.cpp b/src/popups/PopupItem.cpp index b10cd32e4cd042e6cfbab568a374c491349bcbbb..94de3a92c7197ffb4d4854dd8ce2ff5e39763a3a 100644 --- a/src/popups/PopupItem.cpp +++ b/src/popups/PopupItem.cpp @@ -2,9 +2,9 @@ #include <QPainter> #include <QStyleOption> -#include "PopupItem.h" #include "../Utils.h" #include "../ui/Avatar.h" +#include "PopupItem.h" constexpr int PopupHMargin = 4; constexpr int PopupItemMargin = 3; diff --git a/src/popups/ReplyPopup.cpp b/src/popups/ReplyPopup.cpp index a883739f843c40329ecee27254b9b1b6af0b079c..04c3cea517f9ba94736563dd1a36480ca3519e4f 100644 --- a/src/popups/ReplyPopup.cpp +++ b/src/popups/ReplyPopup.cpp @@ -1,5 +1,5 @@ -#include <QPaintEvent> #include <QLabel> +#include <QPaintEvent> #include <QPainter> #include <QStyleOption> @@ -32,7 +32,7 @@ ReplyPopup::setReplyContent(const QString &user, const QString &msg, const QStri // layout position. // if (!item) { auto userItem = new UserItem(this, user); - auto *text = new QLabel(this); + auto *text = new QLabel(this); text->setText(msg); auto *event = new QLabel(this); event->setText(srcEvent); diff --git a/src/popups/ReplyPopup.h b/src/popups/ReplyPopup.h index d8355e537f5b8274b65ca1e09ff2919e9b089b93..57c2bc8a0b4f9896b8e0bb71c8be3d76c36b9ef7 100644 --- a/src/popups/ReplyPopup.h +++ b/src/popups/ReplyPopup.h @@ -28,5 +28,4 @@ signals: private: QVBoxLayout *layout_; - }; diff --git a/src/popups/SuggestionsPopup.cpp b/src/popups/SuggestionsPopup.cpp index 6861a76a02ad72364a8ce29c6b0171c3a956d763..ba1f77b92cc124d5a7da233ec63a298582337f2d 100644 --- a/src/popups/SuggestionsPopup.cpp +++ b/src/popups/SuggestionsPopup.cpp @@ -3,10 +3,10 @@ #include <QStyleOption> #include "../Config.h" -#include "SuggestionsPopup.h" #include "../Utils.h" #include "../ui/Avatar.h" #include "../ui/DropShadow.h" +#include "SuggestionsPopup.h" SuggestionsPopup::SuggestionsPopup(QWidget *parent) : QWidget(parent) diff --git a/src/popups/SuggestionsPopup.h b/src/popups/SuggestionsPopup.h index 4fbb97b3392a910faf22b92f06b397c9f360a31f..1ef720b2f2340588ba6d172b2877aa40a80d4a72 100644 --- a/src/popups/SuggestionsPopup.h +++ b/src/popups/SuggestionsPopup.h @@ -10,7 +10,6 @@ #include "../ChatPage.h" #include "PopupItem.h" - class SuggestionsPopup : public QWidget { Q_OBJECT diff --git a/src/timeline/TimelineView.cpp b/src/timeline/TimelineView.cpp index ee7021d854fe3eaefad8a7899b56940760cfa462..6d947c157188a6fb467cdf9e3edac54604d0f305 100644 --- a/src/timeline/TimelineView.cpp +++ b/src/timeline/TimelineView.cpp @@ -690,7 +690,9 @@ TimelineView::updatePendingMessage(const std::string &txn_id, const QString &eve } void -TimelineView::addUserMessage(mtx::events::MessageType ty, const QString &body, const QString &related_event) +TimelineView::addUserMessage(mtx::events::MessageType ty, + const QString &body, + const QString &related_event) { auto with_sender = (lastSender_ != local_user_) || isDateDifference(lastMsgTimestamp_); diff --git a/src/timeline/TimelineView.h b/src/timeline/TimelineView.h index 450b5dfa17959367dc7745847d6a12eeae748c67..db6087eb59fb4e0bfd27f71846248cd6bed56607 100644 --- a/src/timeline/TimelineView.h +++ b/src/timeline/TimelineView.h @@ -121,7 +121,9 @@ public: // Add new events at the end of the timeline. void addEvents(const mtx::responses::Timeline &timeline); - void addUserMessage(mtx::events::MessageType ty, const QString &body, const QString &related_event); + void addUserMessage(mtx::events::MessageType ty, + const QString &body, + const QString &related_event); void addUserMessage(mtx::events::MessageType ty, const QString &msg); template<class Widget, mtx::events::MessageType MsgType> diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index 10c2d7479c1374913e155a3920ccb6ab07a60374..1ce3794f2e9ea65198d8d9240166ccc99319678f 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -79,8 +79,7 @@ TimelineViewManager::queueEmoteMessage(const QString &msg) } void -TimelineViewManager::queueReplyMessage(const QString &reply, - const QString &related_event) +TimelineViewManager::queueReplyMessage(const QString &reply, const QString &related_event) { if (active_room_.isEmpty()) return;