Adding elements to the preview in the look tab (#605)

* fixes issue #584

* Added different elements to the preview in the look tab
This commit is contained in:
apa420 2018-07-12 18:58:56 +02:00 committed by fourtf
parent fb0cdf78cb
commit 12093d1bb6
5 changed files with 18 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -74,6 +74,7 @@
<file>avatars/pajlada.png</file>
<file>images/download_update.png</file>
<file>images/download_update_error.png</file>
<file>images/pajaDank.png</file>
</qresource>
<qresource prefix="/qt/etc">
<file>qt.conf</file>

View file

@ -287,6 +287,8 @@ Resources::Resources()
, splitHeaderContext(lli(":/images/tool_moreCollapser_off16.png"))
, buttonBan(lli(":/images/button_ban.png", 0.25))
, buttonTimeout(lli(":/images/button_timeout.png", 0.25))
, pajaDank(lli(":/images/pajaDank.png", 0.25))
, ppHop(new Image("https://fourtf.com/ppHop.gif", 0.25))
{
this->split.left = QIcon(":/images/split/splitleft.png");
this->split.right = QIcon(":/images/split/splitright.png");

View file

@ -86,6 +86,8 @@ public:
Image *buttonBan;
Image *buttonTimeout;
Image *pajaDank;
Image *ppHop;
struct JSONCheermoteSet {
QString prefix;

View file

@ -62,7 +62,7 @@ void LookPage::initializeUi()
auto channelView = layout.emplace<ChannelView>();
auto channel = this->createPreviewChannel();
channelView->setChannel(channel);
channelView->setScaleIndependantHeight(64);
channelView->setScaleIndependantHeight(74);
}
void LookPage::addInterfaceTab(LayoutCreator<QVBoxLayout> layout)
@ -276,24 +276,32 @@ ChannelPtr LookPage::createPreviewChannel()
{
auto message = MessagePtr(new Message());
message->addElement(new TimestampElement(QTime(8, 13, 42)));
message->addElement(new ImageElement(getApp()->resources->badgeModerator,
MessageElement::BadgeChannelAuthority));
message->addElement(new ImageElement(getApp()->resources->badgeSubscriber,
MessageElement::BadgeSubscription));
message->addElement(new TimestampElement(QTime(8, 13, 42)));
message->addElement(new TextElement("username1:", MessageElement::Username,
QColor("#0094FF"), FontStyle::ChatMediumBold));
message->addElement(new TextElement("This is a preview message :)", MessageElement::Text));
message->addElement(new TextElement("This is a preview message", MessageElement::Text));
message->addElement(new EmoteElement(EmoteData(getApp()->resources->pajaDank),
MessageElement::Flags::AlwaysShow));
// message->addElement(new)
channel->addMessage(message);
}
{
auto message = MessagePtr(new Message());
message->addElement(new TimestampElement(QTime(8, 15, 21)));
message->addElement(new ImageElement(getApp()->resources->badgePremium,
MessageElement::BadgeChannelAuthority));
message->addElement(new TimestampElement(QTime(8, 15, 21)));
message->addElement(new TextElement("username2:", MessageElement::Username,
QColor("#FF6A00"), FontStyle::ChatMediumBold));
message->addElement(new TextElement("This is another one :)", MessageElement::Text));
message->addElement(new TextElement("This is another one", MessageElement::Text));
message->addElement(
new EmoteElement(EmoteData(getApp()->resources->ppHop), MessageElement::BttvEmote));
message->addElement(
(new TextElement("www.fourtf.com", MessageElement::Text, MessageColor::Link))
->setLink(Link(Link::Url, "https://www.fourtf.com")));
channel->addMessage(message);
}