diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-06 16:45:36 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-06 16:45:36 +0000 |
commit | 30d35f23ae390043462e2aa5fc6863a4621aa74d (patch) | |
tree | 132d3cbb111a1eab5fffab0b43c701e020819062 /debugger/QT | |
parent | 566dab6ca7fbd3e80f113a7e9ed5323d9a79ce3f (diff) |
Enhanced debugger with command indenting and Path Bound print out
https://codereview.appspot.com/6820099/
git-svn-id: http://skia.googlecode.com/svn/trunk@6309 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'debugger/QT')
-rw-r--r-- | debugger/QT/SkDebuggerGUI.cpp | 13 | ||||
-rw-r--r-- | debugger/QT/SkListWidget.cpp | 10 |
2 files changed, 19 insertions, 4 deletions
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp index a03c87876d..df3489177c 100644 --- a/debugger/QT/SkDebuggerGUI.cpp +++ b/debugger/QT/SkDebuggerGUI.cpp @@ -607,10 +607,23 @@ void SkDebuggerGUI::loadPicture(QString fileName) { void SkDebuggerGUI::setupListWidget(SkTDArray<SkString*>* command) { fListWidget.clear(); int counter = 0; + int indent = 0; for (int i = 0; i < command->count(); i++) { QListWidgetItem *item = new QListWidgetItem(); item->setData(Qt::DisplayRole, (*command)[i]->c_str()); item->setData(Qt::UserRole + 1, counter++); + + if (0 == strcmp("Restore", (*command)[i]->c_str())) { + indent -= 10; + } + + item->setData(Qt::UserRole + 3, indent); + + if (0 == strcmp("Save", (*command)[i]->c_str()) || + 0 == strcmp("Save Layer", (*command)[i]->c_str())) { + indent += 10; + } + fListWidget.addItem(item); } } diff --git a/debugger/QT/SkListWidget.cpp b/debugger/QT/SkListWidget.cpp index 669f2258f5..2d8d2da9a4 100644 --- a/debugger/QT/SkListWidget.cpp +++ b/debugger/QT/SkListWidget.cpp @@ -61,6 +61,7 @@ void SkListWidget::paint (QPainter *painter, QIcon(qvariant_cast<QPixmap>(index.data(Qt::DecorationRole))); QIcon deleteIcon = QIcon(qvariant_cast<QPixmap>(index.data(Qt::UserRole + 2))); + int indent = index.data(Qt::UserRole + 3).toInt(); QString drawCommandText = index.data(Qt::DisplayRole).toString(); QString drawCommandNumber = index.data(Qt::UserRole + 1).toString(); @@ -74,7 +75,8 @@ void SkListWidget::paint (QPainter *painter, * spot act as a margin for the bottom and right sides. Positive values in * x1,y1 act as a margin for the top and left. The target area will not * affect size of text but will scale icons. */ - int imageSpace = 35; + static const int kImageSpace = 35; + static const int kCommandNumberSpace = 30; // Breakpoint Icon r = option.rect.adjusted(5, 10, -10, -10); @@ -85,12 +87,12 @@ void SkListWidget::paint (QPainter *painter, deleteIcon.paint(painter, r, Qt::AlignVCenter|Qt::AlignLeft); // Draw Command - r = option.rect.adjusted(imageSpace, 0, -10, -7); + r = option.rect.adjusted(kImageSpace+kCommandNumberSpace+indent, 0, -10, -7); painter->drawText(r.left(), r.top(), r.width(), r.height(), - Qt::AlignBottom|Qt::AlignRight, drawCommandText, &r); + Qt::AlignBottom|Qt::AlignLeft, drawCommandText, &r); // Draw Command Number - r = option.rect.adjusted(imageSpace, 0, -10, -7); + r = option.rect.adjusted(kImageSpace, 0, -10, -7); painter->drawText(r.left(), r.top(), r.width(), r.height(), Qt::AlignBottom|Qt::AlignLeft, drawCommandNumber, &r); } |