From bf791b78546424dc56703cf51537e8d09d3eea9d Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 1 Jun 2017 18:48:05 +0100 Subject: [PATCH] Use 20% highlight colour instead of window for hovering on tree widgets --- qrenderdoc/Widgets/Extended/RDTreeWidget.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/qrenderdoc/Widgets/Extended/RDTreeWidget.cpp b/qrenderdoc/Widgets/Extended/RDTreeWidget.cpp index 74a78b43e..27f05cc35 100644 --- a/qrenderdoc/Widgets/Extended/RDTreeWidget.cpp +++ b/qrenderdoc/Widgets/Extended/RDTreeWidget.cpp @@ -191,9 +191,13 @@ public: if(item->m_back != QBrush()) return item->m_back; - // otherwise if we're hover-highlighting, use the window color + // otherwise if we're hover-highlighting, use the highlight color at 20% opacity if(widget->m_currentHoverItem == item) - return widget->palette().brush(QPalette::Window); + { + QColor col = widget->palette().color(QPalette::Highlight); + col.setAlphaF(0.2f); + return QBrush(col); + } // otherwise, no special background return QVariant(); @@ -204,9 +208,6 @@ public: if(item->m_fore != QBrush()) return item->m_fore; - if(widget->m_currentHoverItem == item) - return widget->palette().brush(QPalette::WindowText); - return QVariant(); } else if(role == Qt::ToolTipRole && !widget->m_instantTooltips)