Fix explain colors in dark mode
This commit is contained in:
parent
2e516c9284
commit
05e9b982cd
4 changed files with 32 additions and 9 deletions
|
|
@ -16,6 +16,7 @@ const int c_NumberOfColumns = 8;
|
|||
QueryExplainModel::QueryExplainModel(QObject *parent, ExplainRoot::SPtr exp)
|
||||
: QAbstractItemModel(parent)
|
||||
, explain(std::move(exp))
|
||||
, theme(GetColorTheme())
|
||||
{}
|
||||
|
||||
QVariant QueryExplainModel::data(const QModelIndex &index, int role) const
|
||||
|
|
@ -67,35 +68,35 @@ if (role == Qt::DisplayRole) {
|
|||
if (tt > 0.000000001f) {
|
||||
float f = t / tt;
|
||||
if (f > 0.9f) {
|
||||
result = QColor(255, 192, 192);
|
||||
result = theme.explainTime[0];
|
||||
}
|
||||
else if (f > 0.63f) {
|
||||
result = QColor(255, 224, 192);
|
||||
result = theme.explainTime[1];
|
||||
}
|
||||
else if (f > 0.36f) {
|
||||
result = QColor(255, 255, 192);
|
||||
result = theme.explainTime[2];
|
||||
}
|
||||
else if (f > 0.09f) {
|
||||
result = QColor(255, 255, 224);
|
||||
result = theme.explainTime[3];
|
||||
}
|
||||
else {
|
||||
result = QColor(Qt::white);
|
||||
result = {};
|
||||
}
|
||||
}
|
||||
}
|
||||
if (col == c_ColumnEstErr) {
|
||||
float e = std::fabs(item->estimateError());
|
||||
if (e > 1000.0f) {
|
||||
result = QColor(255, 192, 192);
|
||||
result = theme.explainEstError[0];
|
||||
}
|
||||
else if (e > 100.0f) {
|
||||
result = QColor(255, 224, 192);
|
||||
result = theme.explainEstError[1];
|
||||
}
|
||||
else if (e > 10.0f) {
|
||||
result = QColor(255, 255, 192);
|
||||
result = theme.explainEstError[2];
|
||||
}
|
||||
else {
|
||||
result = QColor(Qt::white);
|
||||
result = {}; //QColor(Qt::white);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue