fix scroll to bottom issue

This commit is contained in:
Rasmus Karlsson
2017-06-06 21:18:05 +02:00
parent 768b3db27a
commit b66dc479e6
10 changed files with 34 additions and 20 deletions
+1
View File
@@ -12,6 +12,7 @@
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QTimer>
#include <functional>
namespace chatterino {
+2 -4
View File
@@ -1,5 +1,4 @@
#ifndef LAZYLOADEDIMAGE_H
#define LAZYLOADEDIMAGE_H
#pragma once
#include <QPixmap>
#include <QString>
@@ -103,7 +102,6 @@ private:
void gifUpdateTimout();
};
} // namespace messages
} // namespace chatterino
#endif // LAZYLOADEDIMAGE_H
+3 -1
View File
@@ -21,13 +21,15 @@ namespace messages {
Message::Message(const QString &text)
: _words()
, _text(text)
{
_words.push_back(
Word(text, Word::Text, ColorScheme::getInstance().SystemMessageColor, text, QString()));
}
Message::Message(const std::vector<Word> &words)
Message::Message(const QString &text, const std::vector<Word> &words)
: _words(words)
, _text(text)
{
}
+3 -1
View File
@@ -25,7 +25,7 @@ class Message
{
public:
Message(const QString &text);
Message(const std::vector<messages::Word> &words);
Message(const QString &text, const std::vector<messages::Word> &words);
bool getCanHighlightTab() const;
const QString &getTimeoutUser() const;
@@ -38,6 +38,8 @@ public:
bool isDisabled() const;
const QString &getId() const;
const QString _text;
private:
static LazyLoadedImage *badgeStaff;
static LazyLoadedImage *badgeAdmin;
+1 -1
View File
@@ -14,7 +14,7 @@ MessageBuilder::MessageBuilder()
SharedMessage MessageBuilder::build()
{
return SharedMessage(new Message(_words));
return SharedMessage(new Message(this->originalMessage, _words));
}
void MessageBuilder::appendWord(const Word &word)
+6 -5
View File
@@ -1,7 +1,7 @@
#ifndef MESSAGEBUILDER_H
#define MESSAGEBUILDER_H
#pragma once
#include "messages/message.h"
#include <ctime>
namespace chatterino {
@@ -20,11 +20,12 @@ public:
QString matchLink(const QString &string);
QString originalMessage;
private:
std::vector<Word> _words;
std::chrono::time_point<std::chrono::system_clock> _parseTime;
};
}
}
#endif // MESSAGEBUILDER_H
} // namespace messages
} // namespace chatterino