From e9c176cd7d3074be04542b2bffff4962024ab8b0 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 28 Jun 2021 13:24:40 +0100 Subject: [PATCH] Strike-out and don't colourise ignored expressions --- qrenderdoc/Windows/EventBrowser.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/qrenderdoc/Windows/EventBrowser.cpp b/qrenderdoc/Windows/EventBrowser.cpp index 0d8d50e63..1c3cbe8e7 100644 --- a/qrenderdoc/Windows/EventBrowser.cpp +++ b/qrenderdoc/Windows/EventBrowser.cpp @@ -3228,9 +3228,17 @@ void AddFilterSelections(QTextCursor cursor, int &idx, QColor backCol, QColor fo sel.cursor = cursor; + bool hasMust = false; + for(const FilterExpression &f : exprs) + hasMust |= (f.matchType == MatchType::MustMatch); + for(FilterExpression &f : exprs) { - QColor col = QColor::fromHslF(float(idx++ % 6) / 6.0f, 1.0f, + bool ignored = false; + if(hasMust && f.matchType == MatchType::Normal) + ignored = true; + + QColor col = QColor::fromHslF(float(idx++ % 6) / 6.0f, ignored ? 0.0f : 1.0f, qBound(0.05, 0.2 * 0.5 + 0.8 * backCol.lightnessF(), 0.95)); f.col = col; @@ -3239,9 +3247,12 @@ void AddFilterSelections(QTextCursor cursor, int &idx, QColor backCol, QColor fo sel.cursor.setPosition(f.position + f.length, QTextCursor::KeepAnchor); sel.format.setBackground(QBrush(col)); sel.format.setForeground(QBrush(contrastingColor(col, foreCol))); + sel.format.setFontStrikeOut(ignored); + sels.push_back(sel); - AddFilterSelections(cursor, idx, backCol, foreCol, f.exprs, sels); + if(!ignored) + AddFilterSelections(cursor, idx, backCol, foreCol, f.exprs, sels); } }