forked from qt-creator/qt-creator
Utils: Use themed text color in EnvironmentWidget
Since we also have dark themes, we cannot always use black. Use the application global QPalette colors which originate from the theme. Task-number: QTCREATORBUG-23358 Change-Id: Id997e3b0d125d8e39fe7951b5dc827288b8086bb Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -30,9 +30,9 @@
|
|||||||
#include <utils/namevaluedictionary.h>
|
#include <utils/namevaluedictionary.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QBrush>
|
|
||||||
#include <QColor>
|
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QPalette>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
@@ -179,9 +179,11 @@ QVariant NameValueModel::data(const QModelIndex &index, int role) const
|
|||||||
f.setStrikeOut(!d->m_resultNameValueDictionary.isEnabled(resultIterator));
|
f.setStrikeOut(!d->m_resultNameValueDictionary.isEnabled(resultIterator));
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
case Qt::ForegroundRole:
|
case Qt::ForegroundRole: {
|
||||||
return changes(d->m_resultNameValueDictionary.key(resultIterator))
|
const QPalette p = QGuiApplication::palette();
|
||||||
? QBrush(Qt::blue) : QBrush();
|
return p.color(changes(d->m_resultNameValueDictionary.key(resultIterator))
|
||||||
|
? QPalette::Link : QPalette::Text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user