forked from qt-creator/qt-creator
ProjectTree: Do not use disabled state for disabled nodes
Rendering disabled nodes using the disabled state in the painter breaks themes as it introduces a discrepancy between the actual state of the node and its graphical representation. IIRC this was introduced since there was no easy way to find what color was supposed to be used for disabled items. That is no longer the case, so let's clean this up. Change-Id: Ic5653cd970e07eb680cb1d28d1feefd70aded540 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -93,12 +93,10 @@ public:
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
|
||||
{
|
||||
QStyleOptionViewItem opt = option;
|
||||
if (!index.data(Project::EnabledRole).toBool())
|
||||
opt.state &= ~QStyle::State_Enabled;
|
||||
QStyledItemDelegate::paint(painter, opt, index);
|
||||
QStyledItemDelegate::paint(painter, option, index);
|
||||
|
||||
if (index.data(Project::isParsingRole).toBool()) {
|
||||
QStyleOptionViewItem opt = option;
|
||||
initStyleOption(&opt, index);
|
||||
ProgressIndicatorPainter *indicator = findOrCreateIndicatorPainter(index);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user