@ 261105.1

261103.2 · 424156375b1327475197d8023300dd47ac7f76b8

qt-gui: fixed syntax palette selection caption color in dark mode

reading declarations

Changes to src/gui-qt/. All files

src/gui-qt/thememodel.cpp

@@ -136,7 +136,7 @@ ThemeFilterProxyModel::ThemeFilterProxyModel(QObject *parent) void ThemeFilterProxyModel::setSearchText(const QString &text) {     searchTerms = text.split(' ', Qt::SkipEmptyParts);-    invalidateFilter();+    invalidate(); }  bool ThemeFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const

src/gui-qt/themeswatchdelegate.cpp

@@ -116,7 +116,11 @@ void ThemeSwatchDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o     QString name = option.fontMetrics.elidedText(index.data(Qt::DisplayRole).toString(),                                                  Qt::ElideRight, int(textRect.width()));     QPalette::ColorGroup group = enabled ? QPalette::Normal : QPalette::Disabled;-    painter->setPen(pal.color(group, QPalette::Text));+    // When selected the card background is Highlight.lighter(170) – a pale colour.+    // In dark mode QPalette::Text is near-white, which is unreadable on that background,+    // so force a dark caption colour for the selected state.+    QColor captionColor = selected ? QColor(Qt::black) : pal.color(group, QPalette::Text);+    painter->setPen(captionColor);     painter->setFont(option.font);     painter->drawText(textRect, Qt::AlignHCenter | Qt::AlignVCenter, name);