Use 20% highlight colour instead of window for hovering on tree widgets

This commit is contained in:
baldurk
2017-06-01 18:48:05 +01:00
parent b311e65dbd
commit bf791b7854
+6 -5
View File
@@ -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)