Fix memory highlighting of first variable/member.

Give it a color number != 0 and replace the first generated color
(usually very bright) by base color.

Change-Id: I736fa24215974b810f050d8a407ddf4a2432d711
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Friedemann Kleint
2012-11-15 17:24:49 +01:00
parent 0767aab4b9
commit 9deb806b42

View File

@@ -303,6 +303,7 @@ static MemoryMarkupList
MemoryMarkupList result; MemoryMarkupList result;
int colorNumber = 0; int colorNumber = 0;
ColorNumberToolTips ranges(size, ColorNumberToolTip(colorNumber, rootToolTip)); ColorNumberToolTips ranges(size, ColorNumberToolTip(colorNumber, rootToolTip));
colorNumber++;
const int childCount = memberVariableRecursion(model, modelIndex, const int childCount = memberVariableRecursion(model, modelIndex,
rootName, address, address + size, rootName, address, address + size,
&colorNumber, &ranges); &colorNumber, &ranges);
@@ -334,9 +335,10 @@ static MemoryMarkupList
} }
// Assign colors from a list, use base color for 0 (contrast to black text). // Assign colors from a list, use base color for 0 (contrast to black text).
QList<QColor> colors = TextEditor::SyntaxHighlighter::generateColors(colorNumber + 1, // Overwrite the first color (which is usually very bright) by the base color.
QList<QColor> colors = TextEditor::SyntaxHighlighter::generateColors(colorNumber + 2,
QColor(Qt::black)); QColor(Qt::black));
colors.prepend(sizeIsEstimate ? defaultBackground : Qt::lightGray); colors[0] = sizeIsEstimate ? defaultBackground : Qt::lightGray;
const QColor registerColor = Qt::green; const QColor registerColor = Qt::green;
int lastColorNumber = 0; int lastColorNumber = 0;
for (unsigned i = 0; i < size; ++i) { for (unsigned i = 0; i < size; ++i) {