mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed disabled messages not being greyed out
This commit is contained in:
parent
2073447df7
commit
40733ca312
1 changed files with 9 additions and 4 deletions
|
@ -142,6 +142,7 @@ void MessageLayout::actuallyLayout(int width)
|
|||
void MessageLayout::paint(QPainter &painter, int y, int messageIndex, Selection &selection)
|
||||
{
|
||||
QPixmap *pixmap = this->buffer.get();
|
||||
singletons::ThemeManager &themeManager = singletons::ThemeManager::getInstance();
|
||||
|
||||
// create new buffer if required
|
||||
if (!pixmap) {
|
||||
|
@ -166,6 +167,11 @@ void MessageLayout::paint(QPainter &painter, int y, int messageIndex, Selection
|
|||
// draw on buffer
|
||||
painter.drawPixmap(0, y, pixmap->width(), pixmap->height(), *pixmap);
|
||||
|
||||
// draw disabled
|
||||
if (this->message->hasFlags(Message::Disabled)) {
|
||||
painter.fillRect(0, y, pixmap->width(), pixmap->height(), themeManager.messages.disabled);
|
||||
}
|
||||
|
||||
this->bufferValid = true;
|
||||
}
|
||||
|
||||
|
@ -178,8 +184,7 @@ void MessageLayout::updateBuffer(QPixmap *buffer, int messageIndex, Selection &s
|
|||
painter.setRenderHint(QPainter::SmoothPixmapTransform);
|
||||
|
||||
// draw background
|
||||
painter.fillRect(buffer->rect(),
|
||||
this->message->hasFlags(Message::Highlighted)
|
||||
painter.fillRect(buffer->rect(), this->message->hasFlags(Message::Highlighted)
|
||||
? themeManager.messages.backgrounds.highlighted
|
||||
: themeManager.messages.backgrounds.regular);
|
||||
|
||||
|
|
Loading…
Reference in a new issue