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:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user