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)
|
void MessageLayout::paint(QPainter &painter, int y, int messageIndex, Selection &selection)
|
||||||
{
|
{
|
||||||
QPixmap *pixmap = this->buffer.get();
|
QPixmap *pixmap = this->buffer.get();
|
||||||
|
singletons::ThemeManager &themeManager = singletons::ThemeManager::getInstance();
|
||||||
|
|
||||||
// create new buffer if required
|
// create new buffer if required
|
||||||
if (!pixmap) {
|
if (!pixmap) {
|
||||||
|
@ -166,6 +167,11 @@ void MessageLayout::paint(QPainter &painter, int y, int messageIndex, Selection
|
||||||
// draw on buffer
|
// draw on buffer
|
||||||
painter.drawPixmap(0, y, pixmap->width(), pixmap->height(), *pixmap);
|
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;
|
this->bufferValid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,10 +184,9 @@ void MessageLayout::updateBuffer(QPixmap *buffer, int messageIndex, Selection &s
|
||||||
painter.setRenderHint(QPainter::SmoothPixmapTransform);
|
painter.setRenderHint(QPainter::SmoothPixmapTransform);
|
||||||
|
|
||||||
// draw background
|
// draw background
|
||||||
painter.fillRect(buffer->rect(),
|
painter.fillRect(buffer->rect(), this->message->hasFlags(Message::Highlighted)
|
||||||
this->message->hasFlags(Message::Highlighted)
|
? themeManager.messages.backgrounds.highlighted
|
||||||
? themeManager.messages.backgrounds.highlighted
|
: themeManager.messages.backgrounds.regular);
|
||||||
: themeManager.messages.backgrounds.regular);
|
|
||||||
|
|
||||||
// draw selection
|
// draw selection
|
||||||
if (!selection.isEmpty()) {
|
if (!selection.isEmpty()) {
|
||||||
|
|
Loading…
Reference in a new issue