mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
chore: remove dead message element code (#5225)
This commit is contained in:
parent
a041e13d21
commit
3c13e0c6d2
|
@ -169,6 +169,7 @@
|
||||||
- Dev: Added the `launachable` entry to Linux AppData. (#5210)
|
- Dev: Added the `launachable` entry to Linux AppData. (#5210)
|
||||||
- Dev: Cleaned up and optimized resources. (#5222)
|
- Dev: Cleaned up and optimized resources. (#5222)
|
||||||
- Dev: Refactor `StreamerMode`. (#5216)
|
- Dev: Refactor `StreamerMode`. (#5216)
|
||||||
|
- Dev: Cleaned up unused code in `MessageElement` and `MessageLayoutElement`. (#5225)
|
||||||
|
|
||||||
## 2.4.6
|
## 2.4.6
|
||||||
|
|
||||||
|
|
|
@ -51,12 +51,6 @@ MessageElement *MessageElement::setLink(const Link &link)
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageElement *MessageElement::setText(const QString &text)
|
|
||||||
{
|
|
||||||
this->text_ = text;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
MessageElement *MessageElement::setTooltip(const QString &tooltip)
|
MessageElement *MessageElement::setTooltip(const QString &tooltip)
|
||||||
{
|
{
|
||||||
this->tooltip_ = tooltip;
|
this->tooltip_ = tooltip;
|
||||||
|
@ -94,29 +88,11 @@ void MessageElement::addFlags(MessageElementFlags flags)
|
||||||
this->flags_.set(flags);
|
this->flags_.set(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Empty
|
|
||||||
EmptyElement::EmptyElement()
|
|
||||||
: MessageElement(MessageElementFlag::None)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyElement::addToContainer(MessageLayoutContainer &container,
|
|
||||||
MessageElementFlags flags)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
EmptyElement &EmptyElement::instance()
|
|
||||||
{
|
|
||||||
static EmptyElement instance;
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
// IMAGE
|
// IMAGE
|
||||||
ImageElement::ImageElement(ImagePtr image, MessageElementFlags flags)
|
ImageElement::ImageElement(ImagePtr image, MessageElementFlags flags)
|
||||||
: MessageElement(flags)
|
: MessageElement(flags)
|
||||||
, image_(image)
|
, image_(std::move(image))
|
||||||
{
|
{
|
||||||
// this->setTooltip(image->getTooltip());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageElement::addToContainer(MessageLayoutContainer &container,
|
void ImageElement::addToContainer(MessageLayoutContainer &container,
|
||||||
|
@ -136,7 +112,7 @@ CircularImageElement::CircularImageElement(ImagePtr image, int padding,
|
||||||
QColor background,
|
QColor background,
|
||||||
MessageElementFlags flags)
|
MessageElementFlags flags)
|
||||||
: MessageElement(flags)
|
: MessageElement(flags)
|
||||||
, image_(image)
|
, image_(std::move(image))
|
||||||
, padding_(padding)
|
, padding_(padding)
|
||||||
, background_(background)
|
, background_(background)
|
||||||
{
|
{
|
||||||
|
@ -808,7 +784,7 @@ void LinebreakElement::addToContainer(MessageLayoutContainer &container,
|
||||||
ScalingImageElement::ScalingImageElement(ImageSet images,
|
ScalingImageElement::ScalingImageElement(ImageSet images,
|
||||||
MessageElementFlags flags)
|
MessageElementFlags flags)
|
||||||
: MessageElement(flags)
|
: MessageElement(flags)
|
||||||
, images_(images)
|
, images_(std::move(images))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,13 +160,6 @@ using MessageElementFlags = FlagsEnum<MessageElementFlag>;
|
||||||
class MessageElement
|
class MessageElement
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum UpdateFlags : char {
|
|
||||||
Update_Text = 1,
|
|
||||||
Update_Emotes = 2,
|
|
||||||
Update_Images = 4,
|
|
||||||
Update_All = Update_Text | Update_Emotes | Update_Images
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual ~MessageElement();
|
virtual ~MessageElement();
|
||||||
|
|
||||||
MessageElement(const MessageElement &) = delete;
|
MessageElement(const MessageElement &) = delete;
|
||||||
|
@ -176,7 +169,6 @@ public:
|
||||||
MessageElement &operator=(MessageElement &&) = delete;
|
MessageElement &operator=(MessageElement &&) = delete;
|
||||||
|
|
||||||
MessageElement *setLink(const Link &link);
|
MessageElement *setLink(const Link &link);
|
||||||
MessageElement *setText(const QString &text);
|
|
||||||
MessageElement *setTooltip(const QString &tooltip);
|
MessageElement *setTooltip(const QString &tooltip);
|
||||||
|
|
||||||
MessageElement *setTrailingSpace(bool value);
|
MessageElement *setTrailingSpace(bool value);
|
||||||
|
@ -195,27 +187,11 @@ protected:
|
||||||
bool trailingSpace = true;
|
bool trailingSpace = true;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString text_;
|
|
||||||
Link link_;
|
Link link_;
|
||||||
QString tooltip_;
|
QString tooltip_;
|
||||||
MessageElementFlags flags_;
|
MessageElementFlags flags_;
|
||||||
};
|
};
|
||||||
|
|
||||||
// used when layout element doesn't have a creator
|
|
||||||
class EmptyElement : public MessageElement
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
EmptyElement();
|
|
||||||
|
|
||||||
void addToContainer(MessageLayoutContainer &container,
|
|
||||||
MessageElementFlags flags) override;
|
|
||||||
|
|
||||||
static EmptyElement &instance();
|
|
||||||
|
|
||||||
private:
|
|
||||||
ImagePtr image_;
|
|
||||||
};
|
|
||||||
|
|
||||||
// contains a simple image
|
// contains a simple image
|
||||||
class ImageElement : public MessageElement
|
class ImageElement : public MessageElement
|
||||||
{
|
{
|
||||||
|
|
|
@ -162,8 +162,6 @@ public:
|
||||||
const QSize &size, QColor color_, FontStyle style_,
|
const QSize &size, QColor color_, FontStyle style_,
|
||||||
float scale_);
|
float scale_);
|
||||||
|
|
||||||
void listenToLinkChanges();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void addCopyTextToString(QString &str, uint32_t from = 0,
|
void addCopyTextToString(QString &str, uint32_t from = 0,
|
||||||
uint32_t to = UINT32_MAX) const override;
|
uint32_t to = UINT32_MAX) const override;
|
||||||
|
@ -176,8 +174,6 @@ protected:
|
||||||
QColor color_;
|
QColor color_;
|
||||||
FontStyle style_;
|
FontStyle style_;
|
||||||
float scale_;
|
float scale_;
|
||||||
|
|
||||||
pajlada::Signals::SignalHolder managedConnections_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// TEXT ICON
|
// TEXT ICON
|
||||||
|
|
Loading…
Reference in a new issue