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

This commit is contained in:
Joseph Donofry 2019-06-12 19:09:05 -04:00
commit 9f310fed09
No known key found for this signature in database
GPG key ID: E8A1D78EF044B0CB
13 changed files with 27 additions and 18 deletions

View file

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

View file

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

View file

@ -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 &);

View file

@ -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();

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

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

View file

@ -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)

View file

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

View file

@ -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_);

View file

@ -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>

View file

@ -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;