forked from qt-creator/qt-creator
ProjectExplorer: Don't enforce FlatModel::data's ForegroundRole
Only return a concrete color for the "pseudo disabled" state of the node, otherwise return QVariant(). This permits the theming of the projecty tree via palette or stylesheet (as the QmlDesigner does). Task-number: QTCREATORBUG-24402 Change-Id: I510faf4d58a12947dd665eef6f5c9da8845fc2dd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -107,9 +107,6 @@ FlatModel::FlatModel(QObject *parent)
|
||||
|
||||
for (Project *project : SessionManager::projects())
|
||||
handleProjectAdded(project);
|
||||
|
||||
m_disabledTextColor = Utils::creatorTheme()->color(Utils::Theme::TextColorDisabled);
|
||||
m_enabledTextColor = Utils::creatorTheme()->color(Utils::Theme::TextColorNormal);
|
||||
}
|
||||
|
||||
QVariant FlatModel::data(const QModelIndex &index, int role) const
|
||||
@@ -166,7 +163,8 @@ QVariant FlatModel::data(const QModelIndex &index, int role) const
|
||||
return font;
|
||||
}
|
||||
case Qt::ForegroundRole:
|
||||
return node->isEnabled() ? m_enabledTextColor : m_disabledTextColor;
|
||||
return node->isEnabled() ? QVariant()
|
||||
: Utils::creatorTheme()->color(Utils::Theme::TextColorDisabled);
|
||||
case Project::FilePathRole:
|
||||
return node->filePath().toString();
|
||||
case Project::isParsingRole:
|
||||
|
@@ -118,8 +118,6 @@ private:
|
||||
|
||||
QTimer m_timer;
|
||||
QSet<ExpandData> m_toExpand;
|
||||
QColor m_enabledTextColor;
|
||||
QColor m_disabledTextColor;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user