Qt: Fix memory view colours in light themes

This commit is contained in:
Stenzek 2024-09-14 00:44:44 +10:00
parent 350cf7ee32
commit 6d637127f2
No known key found for this signature in database

View File

@ -207,10 +207,13 @@ void MemoryViewWidget::paintEvent(QPaintEvent* event)
if (!m_data)
return;
const QColor alt_fill_color(40, 40, 40);
const QPalette palette = viewport()->palette();
const bool dark = palette.windowText().color().value() > palette.window().color().value();
const QColor alt_fill_color =
dark ? palette.color(QPalette::AlternateBase).darker(130) : palette.color(QPalette::AlternateBase).lighter(100);
const QColor selected_color = dark ? palette.color(QPalette::Highlight) : QColor(190, 190, 190);
const QColor text_color = palette.color(QPalette::WindowText);
const QColor highlight_color(100, 100, 0);
const QColor selected_color = viewport()->palette().color(QPalette::Highlight);
const QColor text_color = viewport()->palette().color(QPalette::WindowText);
const QColor edited_color(240, 30, 30);
const int offsetX = horizontalScrollBar()->value();