Merge branch '0.7.0-dev' of ssh://github.com/Nheko-Reborn/nheko into 0.7.0-dev

remotes/origin/0.7.0-dev
Joseph Donofry 6 years ago
commit 9f310fed09
No known key found for this signature in database
GPG Key ID: E8A1D78EF044B0CB
  1. 4
      resources/styles/nheko-dark.qss
  2. 4
      resources/styles/nheko.qss
  3. 4
      src/ChatPage.h
  4. 6
      src/TextInputWidget.cpp
  5. 4
      src/TextInputWidget.h
  6. 2
      src/popups/PopupItem.cpp
  7. 4
      src/popups/ReplyPopup.cpp
  8. 1
      src/popups/ReplyPopup.h
  9. 2
      src/popups/SuggestionsPopup.cpp
  10. 1
      src/popups/SuggestionsPopup.h
  11. 4
      src/timeline/TimelineView.cpp
  12. 4
      src/timeline/TimelineView.h
  13. 3
      src/timeline/TimelineViewManager.cpp

@ -41,6 +41,10 @@ SuggestionsPopup {
background-color: #202228; background-color: #202228;
} }
ReplyPopup {
background-color: #202228;
}
PopupItem { PopupItem {
background-color: #202228; background-color: #202228;
qproperty-hoverColor: rgba(45, 49, 57, 120); qproperty-hoverColor: rgba(45, 49, 57, 120);

@ -46,6 +46,10 @@ SuggestionsPopup {
background-color: white; background-color: white;
} }
ReplyPopup {
background-color: white;
}
PopupItem { PopupItem {
background-color: white; background-color: white;
qproperty-hoverColor: rgba(192, 193, 195, 120); qproperty-hoverColor: rgba(192, 193, 195, 120);

@ -83,7 +83,9 @@ signals:
void connectionLost(); void connectionLost();
void connectionRestored(); 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 &); void notificationsRetrieved(const mtx::responses::Notifications &);

@ -76,7 +76,7 @@ FilteredTextEdit::FilteredTextEdit(QWidget *parent)
&FilteredTextEdit::uploadData); &FilteredTextEdit::uploadData);
connect(this, &FilteredTextEdit::resultsRetrieved, this, &FilteredTextEdit::showResults); 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. // TODO: Show user avatar window.
nhlog::ui()->info("User selected: " + text.toStdString()); nhlog::ui()->info("User selected: " + text.toStdString());
}); });
@ -176,8 +176,7 @@ FilteredTextEdit::keyPressEvent(QKeyEvent *event)
} }
if (replyPopup_.isVisible()) { if (replyPopup_.isVisible()) {
switch (event->key()) switch (event->key()) {
{
case Qt::Key_Escape: case Qt::Key_Escape:
closeReply(); closeReply();
return; return;
@ -187,7 +186,6 @@ FilteredTextEdit::keyPressEvent(QKeyEvent *event)
} }
} }
switch (event->key()) { switch (event->key()) {
case Qt::Key_At: case Qt::Key_At:
atTriggerPosition_ = textCursor().position(); atTriggerPosition_ = textCursor().position();

@ -28,10 +28,10 @@
#include <QTextEdit> #include <QTextEdit>
#include <QWidget> #include <QWidget>
#include "popups/SuggestionsPopup.h"
#include "popups/ReplyPopup.h"
#include "dialogs/PreviewUploadOverlay.h" #include "dialogs/PreviewUploadOverlay.h"
#include "emoji/PickButton.h" #include "emoji/PickButton.h"
#include "popups/ReplyPopup.h"
#include "popups/SuggestionsPopup.h"
namespace dialogs { namespace dialogs {
class PreviewUploadOverlay; class PreviewUploadOverlay;

@ -2,9 +2,9 @@
#include <QPainter> #include <QPainter>
#include <QStyleOption> #include <QStyleOption>
#include "PopupItem.h"
#include "../Utils.h" #include "../Utils.h"
#include "../ui/Avatar.h" #include "../ui/Avatar.h"
#include "PopupItem.h"
constexpr int PopupHMargin = 4; constexpr int PopupHMargin = 4;
constexpr int PopupItemMargin = 3; constexpr int PopupItemMargin = 3;

@ -1,5 +1,5 @@
#include <QPaintEvent>
#include <QLabel> #include <QLabel>
#include <QPaintEvent>
#include <QPainter> #include <QPainter>
#include <QStyleOption> #include <QStyleOption>
@ -32,7 +32,7 @@ ReplyPopup::setReplyContent(const QString &user, const QString &msg, const QStri
// layout position. // layout position.
// if (!item) { // if (!item) {
auto userItem = new UserItem(this, user); auto userItem = new UserItem(this, user);
auto *text = new QLabel(this); auto *text = new QLabel(this);
text->setText(msg); text->setText(msg);
auto *event = new QLabel(this); auto *event = new QLabel(this);
event->setText(srcEvent); event->setText(srcEvent);

@ -28,5 +28,4 @@ signals:
private: private:
QVBoxLayout *layout_; QVBoxLayout *layout_;
}; };

@ -3,10 +3,10 @@
#include <QStyleOption> #include <QStyleOption>
#include "../Config.h" #include "../Config.h"
#include "SuggestionsPopup.h"
#include "../Utils.h" #include "../Utils.h"
#include "../ui/Avatar.h" #include "../ui/Avatar.h"
#include "../ui/DropShadow.h" #include "../ui/DropShadow.h"
#include "SuggestionsPopup.h"
SuggestionsPopup::SuggestionsPopup(QWidget *parent) SuggestionsPopup::SuggestionsPopup(QWidget *parent)
: QWidget(parent) : QWidget(parent)

@ -10,7 +10,6 @@
#include "../ChatPage.h" #include "../ChatPage.h"
#include "PopupItem.h" #include "PopupItem.h"
class SuggestionsPopup : public QWidget class SuggestionsPopup : public QWidget
{ {
Q_OBJECT Q_OBJECT

@ -690,7 +690,9 @@ TimelineView::updatePendingMessage(const std::string &txn_id, const QString &eve
} }
void 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_); auto with_sender = (lastSender_ != local_user_) || isDateDifference(lastMsgTimestamp_);

@ -121,7 +121,9 @@ public:
// Add new events at the end of the timeline. // Add new events at the end of the timeline.
void addEvents(const mtx::responses::Timeline &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); void addUserMessage(mtx::events::MessageType ty, const QString &msg);
template<class Widget, mtx::events::MessageType MsgType> template<class Widget, mtx::events::MessageType MsgType>

@ -79,8 +79,7 @@ TimelineViewManager::queueEmoteMessage(const QString &msg)
} }
void void
TimelineViewManager::queueReplyMessage(const QString &reply, TimelineViewManager::queueReplyMessage(const QString &reply, const QString &related_event)
const QString &related_event)
{ {
if (active_room_.isEmpty()) if (active_room_.isEmpty())
return; return;

Loading…
Cancel
Save