Add support for plugin links (#6386)
Co-authored-by: Nerixyz <nerixdev@outlook.de>
This commit is contained in:
@@ -9,13 +9,9 @@ public:
|
||||
enum Type {
|
||||
None,
|
||||
Url,
|
||||
CloseCurrentSplit,
|
||||
UserInfo,
|
||||
UserTimeout,
|
||||
UserBan,
|
||||
UserWhisper,
|
||||
InsertText,
|
||||
ShowMessage,
|
||||
UserAction,
|
||||
AutoModAllow,
|
||||
AutoModDeny,
|
||||
|
||||
@@ -1106,6 +1106,7 @@ void TimestampElement::addToContainer(MessageLayoutContainer &container,
|
||||
{
|
||||
if (ctx.flags.hasAny(this->getFlags()))
|
||||
{
|
||||
this->setTooltip(this->getTooltip());
|
||||
if (getSettings()->timestampFormat != this->format_)
|
||||
{
|
||||
this->format_ = getSettings()->timestampFormat.getValue();
|
||||
@@ -1122,8 +1123,19 @@ TextElement *TimestampElement::formatTime(const QTime &time)
|
||||
|
||||
QString format = locale.toString(time, getSettings()->timestampFormat);
|
||||
|
||||
return new TextElement(format, MessageElementFlag::Timestamp,
|
||||
MessageColor::System, FontStyle::TimestampMedium);
|
||||
auto *text =
|
||||
new TextElement(format, MessageElementFlag::Timestamp,
|
||||
MessageColor::System, FontStyle::TimestampMedium);
|
||||
text->setLink(this->getLink());
|
||||
text->setTooltip(this->getTooltip());
|
||||
return text;
|
||||
}
|
||||
|
||||
MessageElement *TimestampElement::setLink(const Link &link)
|
||||
{
|
||||
MessageElement::setLink(link);
|
||||
this->element_->setLink(link);
|
||||
return this;
|
||||
}
|
||||
|
||||
QJsonObject TimestampElement::toJson() const
|
||||
|
||||
@@ -508,6 +508,7 @@ public:
|
||||
const MessageLayoutContext &ctx) override;
|
||||
|
||||
TextElement *formatTime(const QTime &time);
|
||||
MessageElement *setLink(const Link &link) override;
|
||||
|
||||
QJsonObject toJson() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user