Qt: fix richtext_item_delegate palette

We have to use the styled palette instead of the default palette in order to fix the style of lists as seen the pkg installer.
This commit is contained in:
Megamouse 2021-10-24 04:40:53 +02:00
parent c549d7154b
commit d63a712cc5
2 changed files with 4 additions and 6 deletions

View File

@ -135,7 +135,7 @@ log_frame::log_frame(std::shared_ptr<gui_settings> guiSettings, QWidget *parent)
}
else
{
m_tty_input->setPlaceholderText(tr("All User Channels"));
m_tty_input->setPlaceholderText(tr("All user channels"));
}
QVBoxLayout* tty_layout = new QVBoxLayout();

View File

@ -51,16 +51,14 @@ public:
painter->setClipRect(text_rect.translated(-text_rect.topLeft()));
// Create a context for our painter
const QAbstractTextDocumentLayout::PaintContext context;
QAbstractTextDocumentLayout::PaintContext context;
// We can change the text color based on state (Unused because it didn't look good)
//context.palette.setColor(QPalette::Text, option.palette.color(QPalette::Active, (option.state & QStyle::State_Selected) ? QPalette::HighlightedText : QPalette::Text));
// Apply the styled palette
context.palette = opt.palette;
// Draw the text
m_document->documentLayout()->draw(painter, context);
painter->restore();
//QStyledItemDelegate::paint(painter, opt, index); // Unused
}
};