From d63a712cc5f6940d3a58108f8fcf29466f5b882a Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sun, 24 Oct 2021 04:40:53 +0200 Subject: [PATCH] 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. --- rpcs3/rpcs3qt/log_frame.cpp | 2 +- rpcs3/rpcs3qt/richtext_item_delegate.h | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/rpcs3/rpcs3qt/log_frame.cpp b/rpcs3/rpcs3qt/log_frame.cpp index 43af1153e3..8fc0caaf93 100644 --- a/rpcs3/rpcs3qt/log_frame.cpp +++ b/rpcs3/rpcs3qt/log_frame.cpp @@ -135,7 +135,7 @@ log_frame::log_frame(std::shared_ptr 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(); diff --git a/rpcs3/rpcs3qt/richtext_item_delegate.h b/rpcs3/rpcs3qt/richtext_item_delegate.h index 523c728aa0..6590e7801f 100644 --- a/rpcs3/rpcs3qt/richtext_item_delegate.h +++ b/rpcs3/rpcs3qt/richtext_item_delegate.h @@ -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 } };