diff --git a/qrenderdoc/Styles/RDStyle/RDStyle.cpp b/qrenderdoc/Styles/RDStyle/RDStyle.cpp index bab9903fd5..cc0a707539 100644 --- a/qrenderdoc/Styles/RDStyle/RDStyle.cpp +++ b/qrenderdoc/Styles/RDStyle/RDStyle.cpp @@ -1551,9 +1551,25 @@ void RDStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *opt, Q group = QPalette::Inactive; if(viewitem->state & QStyle::State_Selected) - p->fillRect(viewitem->rect, viewitem->palette.brush(group, QPalette::Highlight)); - else if(viewitem->backgroundBrush.style() != Qt::NoBrush) - p->fillRect(viewitem->rect, viewitem->backgroundBrush); + { + if(viewitem->backgroundBrush.style() != Qt::NoBrush) + { + p->fillRect(viewitem->rect, viewitem->backgroundBrush); + // If we have a custom color, use the selection color at half opacity over the custom color + QColor col = viewitem->palette.color(group, QPalette::Highlight); + col.setAlphaF(0.5f); + p->fillRect(viewitem->rect, QBrush(col)); + } + else + { + p->fillRect(viewitem->rect, viewitem->palette.brush(group, QPalette::Highlight)); + } + } + else + { + if(viewitem->backgroundBrush.style() != Qt::NoBrush) + p->fillRect(viewitem->rect, viewitem->backgroundBrush); + } return; } diff --git a/qrenderdoc/Widgets/Extended/RDTreeView.cpp b/qrenderdoc/Widgets/Extended/RDTreeView.cpp index 5715a25b8e..31c1ffdb0e 100644 --- a/qrenderdoc/Widgets/Extended/RDTreeView.cpp +++ b/qrenderdoc/Widgets/Extended/RDTreeView.cpp @@ -771,18 +771,11 @@ void RDTreeView::drawBranches(QPainter *painter, const QRect &rect, const QModel idx = idx.parent(); } - opt.rect = rect; - opt.rect.setWidth(depth * indentation()); + opt.rect = allLinesRect; opt.showDecorationSelected = true; + opt.backgroundBrush = index.data(Qt::BackgroundRole).value(); style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, this); - QBrush back = index.data(Qt::BackgroundRole).value(); - - if(!selectionModel()->isSelected(index) && back.style() != Qt::NoBrush) - { - painter->fillRect(allLinesRect, back); - } - if(m_VisibleBranches) { QTreeView::drawBranches(painter, rect, index); @@ -821,12 +814,12 @@ void RDTreeView::drawBranches(QPainter *painter, const QRect &rect, const QModel { parent = parents.pop(); - back = parent.data(RDTreeView::TreeLineColorRole).value(); + QBrush line = parent.data(RDTreeView::TreeLineColorRole).value(); - if(back.style() != Qt::NoBrush) + if(line.style() != Qt::NoBrush) { // draw a centred pen vertically down the middle of branchRect - painter->setPen(QPen(QBrush(back), m_treeColorLineWidth)); + painter->setPen(QPen(line, m_treeColorLineWidth)); QPoint topCentre = QRect(branchRect).center(); QPoint bottomCentre = topCentre;