2017-01-18 21:30:23 +01:00
|
|
|
#include "messages/word.h"
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
namespace messages {
|
2017-01-05 16:07:20 +01:00
|
|
|
|
2017-01-05 16:59:01 +01:00
|
|
|
// Image word
|
2017-01-11 18:52:09 +01:00
|
|
|
Word::Word(LazyLoadedImage *image, Type type, const QString ©text,
|
|
|
|
const QString &tooltip, const Link &link)
|
2017-01-18 04:33:30 +01:00
|
|
|
: image(image)
|
|
|
|
, text()
|
|
|
|
, color()
|
|
|
|
, _isImage(true)
|
|
|
|
, type(type)
|
|
|
|
, copyText(copytext)
|
|
|
|
, tooltip(tooltip)
|
|
|
|
, link(link)
|
|
|
|
, characterWidthCache()
|
2017-01-05 16:07:20 +01:00
|
|
|
{
|
2017-01-18 04:33:30 +01:00
|
|
|
image->getWidth(); // professional segfault test
|
2017-01-05 16:07:20 +01:00
|
|
|
}
|
|
|
|
|
2017-01-05 16:59:01 +01:00
|
|
|
// Text word
|
2017-01-11 18:52:09 +01:00
|
|
|
Word::Word(const QString &text, Type type, const QColor &color,
|
|
|
|
const QString ©text, const QString &tooltip, const Link &link)
|
2017-01-18 04:33:30 +01:00
|
|
|
: image(NULL)
|
|
|
|
, text(text)
|
|
|
|
, color(color)
|
|
|
|
, _isImage(false)
|
|
|
|
, type(type)
|
|
|
|
, copyText(copytext)
|
|
|
|
, tooltip(tooltip)
|
|
|
|
, link(link)
|
|
|
|
, characterWidthCache()
|
2017-01-05 16:07:20 +01:00
|
|
|
{
|
|
|
|
}
|
2017-03-11 11:32:19 +01:00
|
|
|
|
|
|
|
} // namespace messages
|
|
|
|
} // namespace chatterino
|