From e1ff4c818e3727519f1aaf757a70c9f2414fc927 Mon Sep 17 00:00:00 2001 From: fourtf Date: Wed, 17 Jan 2018 02:22:57 +0100 Subject: [PATCH] added background color to the accountswitchwidget --- src/messages/message.cpp | 10 +++++----- src/messages/message.hpp | 2 +- src/singletons/helper/ircmessagehandler.cpp | 8 ++++---- src/widgets/accountswitchpopupwidget.cpp | 7 +++++++ src/widgets/accountswitchpopupwidget.hpp | 1 + src/widgets/emotepopup.cpp | 2 +- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/messages/message.cpp b/src/messages/message.cpp index 640c0f850..8c8a4b43d 100644 --- a/src/messages/message.cpp +++ b/src/messages/message.cpp @@ -29,10 +29,10 @@ bool Message::hasFlags(MessageFlags _flags) const return this->flags & _flags; } -void Message::setFlags(MessageFlags _flags) -{ - this->flags = flags; -} +// void Message::setFlags(MessageFlags _flags) +//{ +// this->flags = flags; +//} void Message::addFlags(MessageFlags _flags) { @@ -77,7 +77,7 @@ const QString &Message::getSearchText() const // _content += word.getCopyText(); // first = false; - // } + // } // this->searchText = _content; // } diff --git a/src/messages/message.hpp b/src/messages/message.hpp index 51a290ad0..902980cf0 100644 --- a/src/messages/message.hpp +++ b/src/messages/message.hpp @@ -39,7 +39,7 @@ public: // Message flags MessageFlags getFlags() const; bool hasFlags(MessageFlags flags) const; - void setFlags(MessageFlags flags); + // void setFlags(MessageFlags flags); void addFlags(MessageFlags flags); void removeFlags(MessageFlags flags); diff --git a/src/singletons/helper/ircmessagehandler.cpp b/src/singletons/helper/ircmessagehandler.cpp index 5ac578cfc..12c8ef0e1 100644 --- a/src/singletons/helper/ircmessagehandler.cpp +++ b/src/singletons/helper/ircmessagehandler.cpp @@ -113,7 +113,7 @@ void IrcMessageHandler::handleClearChatMessage(Communi::IrcMessage *message) // disable the messages from the user for (int i = 0; i < snapshotLength; i++) { if (!snapshot[i]->hasFlags(Message::Timeout) && snapshot[i]->loginName == username) { - snapshot[i]->setFlags(Message::Disabled); + snapshot[i]->addFlags(Message::Disabled); } } @@ -191,6 +191,6 @@ void IrcMessageHandler::handleWriteConnectionNoticeMessage(Communi::IrcNoticeMes this->handleNoticeMessage(message); } -} -} -} +} // namespace helper +} // namespace singletons +} // namespace chatterino diff --git a/src/widgets/accountswitchpopupwidget.cpp b/src/widgets/accountswitchpopupwidget.cpp index 7e0ac6a51..0b69066c0 100644 --- a/src/widgets/accountswitchpopupwidget.cpp +++ b/src/widgets/accountswitchpopupwidget.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -47,5 +48,11 @@ void AccountSwitchPopupWidget::focusOutEvent(QFocusEvent *) this->hide(); } +void AccountSwitchPopupWidget::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + + painter.fillRect(this->rect(), QColor(255, 255, 255)); +} } // namespace widgets } // namespace chatterino diff --git a/src/widgets/accountswitchpopupwidget.hpp b/src/widgets/accountswitchpopupwidget.hpp index cb252f823..f2a45a988 100644 --- a/src/widgets/accountswitchpopupwidget.hpp +++ b/src/widgets/accountswitchpopupwidget.hpp @@ -18,6 +18,7 @@ public: protected: virtual void focusOutEvent(QFocusEvent *event) override final; + virtual void paintEvent(QPaintEvent *event) override; private: struct { diff --git a/src/widgets/emotepopup.cpp b/src/widgets/emotepopup.cpp index 75fc71577..8e8ee1118 100644 --- a/src/widgets/emotepopup.cpp +++ b/src/widgets/emotepopup.cpp @@ -93,7 +93,7 @@ void EmotePopup::loadEmojis() // emojis messages::MessageBuilder builder; builder.getMessage()->addFlags(Message::Centered); - builder.getMessage()->setFlags(Message::DisableCompactEmotes); + builder.getMessage()->addFlags(Message::DisableCompactEmotes); emojis.each([this, &builder](const QString &key, const util::EmoteData &value) { builder.appendElement((new EmoteElement(value, MessageElement::Flags::AlwaysShow)) //