Commit bb02fba9 authored by hjk's avatar hjk

Debugger: Fix WatchItem color display

Name and type columns were not properly grayed out.

Change-Id: I4120329e6d8f4e6fa33859056cafd07f69b642bd
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 6936d46b
......@@ -219,7 +219,7 @@ ToolTipWatchItem::ToolTipWatchItem(WatchItem *item)
value = item->displayValue();
type = item->displayType();
iname = item->iname;
valueColor = item->valueColor();
valueColor = item->valueColor(1);
expandable = item->hasChildren();
expression = item->expression();
foreach (TreeItem *child, item->children())
......
......@@ -776,21 +776,24 @@ QString WatchItem::displayType() const
return result;
}
QColor WatchItem::valueColor() const
{
using Utils::Theme;
Theme *theme = Utils::creatorTheme();
if (watchModel()) {
if (!valueEnabled)
return theme->color(Theme::Debugger_WatchItem_ValueInvalid);
if (!watchModel()->m_contentsValid && !isInspect())
return theme->color(Theme::Debugger_WatchItem_ValueInvalid);
if (value.isEmpty()) // This might still show 0x...
return theme->color(Theme::Debugger_WatchItem_ValueInvalid);
if (value != watchModel()->m_valueCache.value(iname))
return theme->color(Theme::Debugger_WatchItem_ValueChanged);
QColor WatchItem::valueColor(int column) const
{
Theme::Color color = Theme::Debugger_WatchItem_ValueNormal;
if (const WatchModel *model = watchModel()) {
if (!model->m_contentsValid && !isInspect()) {
color = Theme::Debugger_WatchItem_ValueInvalid;
} else if (column == 1) {
if (!valueEnabled)
color = Theme::Debugger_WatchItem_ValueInvalid;
else if (!model->m_contentsValid && !isInspect())
color = Theme::Debugger_WatchItem_ValueInvalid;
else if (column == 1 && value.isEmpty()) // This might still show 0x...
color = Theme::Debugger_WatchItem_ValueInvalid;
else if (column == 1 && value != model->m_valueCache.value(iname))
color = Theme::Debugger_WatchItem_ValueChanged;
}
}
return theme->color(Theme::Debugger_WatchItem_ValueNormal);
return creatorTheme()->color(color);
}
QVariant WatchItem::data(int column, int role) const
......@@ -837,8 +840,7 @@ QVariant WatchItem::data(int column, int role) const
? toToolTip() : QVariant();
case Qt::ForegroundRole:
if (column == 1)
return valueColor();
return valueColor(column);
case LocalsExpressionRole:
return expression();
......
......@@ -107,7 +107,7 @@ public:
QVariant editValue() const;
int editType() const;
QColor valueColor() const;
QColor valueColor(int column) const;
int requestedFormat() const;
WatchItem *findItem(const QByteArray &iname);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment