2017-01-01 02:30:42 +01:00
|
|
|
#ifndef CHATVIEW_H
|
|
|
|
#define CHATVIEW_H
|
|
|
|
|
2017-01-05 16:07:20 +01:00
|
|
|
#include "channel.h"
|
2017-02-07 00:03:15 +01:00
|
|
|
#include "messages/lazyloadedimage.h"
|
2017-02-02 22:15:09 +01:00
|
|
|
#include "messages/messageref.h"
|
2017-01-22 12:46:35 +01:00
|
|
|
#include "messages/word.h"
|
2017-01-18 21:30:23 +01:00
|
|
|
#include "widgets/scrollbar.h"
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
#include <QPaintEvent>
|
2017-01-26 04:26:40 +01:00
|
|
|
#include <QScroller>
|
|
|
|
#include <QWheelEvent>
|
2017-01-18 04:33:30 +01:00
|
|
|
#include <QWidget>
|
|
|
|
|
2017-01-18 21:30:23 +01:00
|
|
|
namespace chatterino {
|
|
|
|
namespace widgets {
|
2017-01-17 00:15:44 +01:00
|
|
|
class ChatWidget;
|
|
|
|
|
2017-01-01 02:30:42 +01:00
|
|
|
class ChatWidgetView : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-01-18 21:30:23 +01:00
|
|
|
explicit ChatWidgetView(ChatWidget *parent);
|
2017-01-22 12:46:35 +01:00
|
|
|
~ChatWidgetView();
|
2017-01-05 16:07:20 +01:00
|
|
|
|
2017-01-16 03:15:07 +01:00
|
|
|
bool layoutMessages();
|
|
|
|
|
2017-02-07 00:03:15 +01:00
|
|
|
void
|
|
|
|
updateGifEmotes()
|
|
|
|
{
|
|
|
|
this->onlyUpdateEmotes = true;
|
|
|
|
this->update();
|
|
|
|
}
|
|
|
|
|
2017-01-03 21:19:33 +01:00
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent *);
|
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
void paintEvent(QPaintEvent *);
|
2017-01-26 04:26:40 +01:00
|
|
|
void wheelEvent(QWheelEvent *event);
|
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
private:
|
2017-02-07 00:03:15 +01:00
|
|
|
struct GifEmoteData {
|
|
|
|
messages::LazyLoadedImage *image;
|
|
|
|
QRect rect;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<GifEmoteData> gifEmotes;
|
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
ChatWidget *chatWidget;
|
2017-01-05 16:07:20 +01:00
|
|
|
|
2017-01-18 04:33:30 +01:00
|
|
|
ScrollBar scrollbar;
|
2017-02-07 00:03:15 +01:00
|
|
|
bool onlyUpdateEmotes;
|
2017-01-22 12:46:35 +01:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void
|
|
|
|
wordTypeMaskChanged()
|
|
|
|
{
|
2017-02-07 00:03:15 +01:00
|
|
|
update();
|
2017-01-22 12:46:35 +01:00
|
|
|
}
|
2017-01-01 02:30:42 +01:00
|
|
|
};
|
2017-01-18 21:30:23 +01:00
|
|
|
}
|
|
|
|
}
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-01-11 18:52:09 +01:00
|
|
|
#endif // CHATVIEW_H
|