added background color to the accountswitchwidget

This commit is contained in:
fourtf 2018-01-17 02:22:57 +01:00
parent 1fe7e652b1
commit e1ff4c818e
6 changed files with 19 additions and 11 deletions

View file

@ -29,10 +29,10 @@ bool Message::hasFlags(MessageFlags _flags) const
return this->flags & _flags; return this->flags & _flags;
} }
void Message::setFlags(MessageFlags _flags) // void Message::setFlags(MessageFlags _flags)
{ //{
this->flags = flags; // this->flags = flags;
} //}
void Message::addFlags(MessageFlags _flags) void Message::addFlags(MessageFlags _flags)
{ {
@ -77,7 +77,7 @@ const QString &Message::getSearchText() const
// _content += word.getCopyText(); // _content += word.getCopyText();
// first = false; // first = false;
// } // }
// this->searchText = _content; // this->searchText = _content;
// } // }

View file

@ -39,7 +39,7 @@ public:
// Message flags // Message flags
MessageFlags getFlags() const; MessageFlags getFlags() const;
bool hasFlags(MessageFlags flags) const; bool hasFlags(MessageFlags flags) const;
void setFlags(MessageFlags flags); // void setFlags(MessageFlags flags);
void addFlags(MessageFlags flags); void addFlags(MessageFlags flags);
void removeFlags(MessageFlags flags); void removeFlags(MessageFlags flags);

View file

@ -113,7 +113,7 @@ void IrcMessageHandler::handleClearChatMessage(Communi::IrcMessage *message)
// disable the messages from the user // disable the messages from the user
for (int i = 0; i < snapshotLength; i++) { for (int i = 0; i < snapshotLength; i++) {
if (!snapshot[i]->hasFlags(Message::Timeout) && snapshot[i]->loginName == username) { 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); this->handleNoticeMessage(message);
} }
} } // namespace helper
} } // namespace singletons
} } // namespace chatterino

View file

@ -4,6 +4,7 @@
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QLayout> #include <QLayout>
#include <QPainter>
#include <QPushButton> #include <QPushButton>
#include <QVBoxLayout> #include <QVBoxLayout>
@ -47,5 +48,11 @@ void AccountSwitchPopupWidget::focusOutEvent(QFocusEvent *)
this->hide(); this->hide();
} }
void AccountSwitchPopupWidget::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
painter.fillRect(this->rect(), QColor(255, 255, 255));
}
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino

View file

@ -18,6 +18,7 @@ public:
protected: protected:
virtual void focusOutEvent(QFocusEvent *event) override final; virtual void focusOutEvent(QFocusEvent *event) override final;
virtual void paintEvent(QPaintEvent *event) override;
private: private:
struct { struct {

View file

@ -93,7 +93,7 @@ void EmotePopup::loadEmojis()
// emojis // emojis
messages::MessageBuilder builder; messages::MessageBuilder builder;
builder.getMessage()->addFlags(Message::Centered); 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) { emojis.each([this, &builder](const QString &key, const util::EmoteData &value) {
builder.appendElement((new EmoteElement(value, MessageElement::Flags::AlwaysShow)) // builder.appendElement((new EmoteElement(value, MessageElement::Flags::AlwaysShow)) //