OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkDebuggerGUI.h" | 8 #include "SkDebuggerGUI.h" |
9 #include "SkGraphics.h" | 9 #include "SkGraphics.h" |
10 #include "SkImageDecoder.h" | 10 #include "SkImageDecoder.h" |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 | 952 |
953 void SkDebuggerGUI::setupListWidget(SkTArray<SkString>* command) { | 953 void SkDebuggerGUI::setupListWidget(SkTArray<SkString>* command) { |
954 fListWidget.clear(); | 954 fListWidget.clear(); |
955 int counter = 0; | 955 int counter = 0; |
956 int indent = 0; | 956 int indent = 0; |
957 for (int i = 0; i < command->count(); i++) { | 957 for (int i = 0; i < command->count(); i++) { |
958 QListWidgetItem *item = new QListWidgetItem(); | 958 QListWidgetItem *item = new QListWidgetItem(); |
959 item->setData(Qt::DisplayRole, (*command)[i].c_str()); | 959 item->setData(Qt::DisplayRole, (*command)[i].c_str()); |
960 item->setData(Qt::UserRole + 1, counter++); | 960 item->setData(Qt::UserRole + 1, counter++); |
961 | 961 |
962 if (0 == strcmp("Restore", (*command)[i].c_str())) { | 962 if (0 == strcmp("Restore", (*command)[i].c_str()) || |
| 963 0 == strcmp("EndCommentGroup", (*command)[i].c_str())) { |
963 indent -= 10; | 964 indent -= 10; |
964 } | 965 } |
965 | 966 |
966 item->setData(Qt::UserRole + 3, indent); | 967 item->setData(Qt::UserRole + 3, indent); |
967 | 968 |
968 if (0 == strcmp("Save", (*command)[i].c_str()) || | 969 if (0 == strcmp("Save", (*command)[i].c_str()) || |
969 0 == strcmp("Save Layer", (*command)[i].c_str())) { | 970 0 == strcmp("Save Layer", (*command)[i].c_str()) || |
| 971 0 == strcmp("BeginCommentGroup", (*command)[i].c_str())) { |
970 indent += 10; | 972 indent += 10; |
971 } | 973 } |
972 | 974 |
973 item->setData(Qt::UserRole + 4, -1.0); | 975 item->setData(Qt::UserRole + 4, -1.0); |
974 | 976 |
975 fListWidget.addItem(item); | 977 fListWidget.addItem(item); |
976 } | 978 } |
977 } | 979 } |
978 | 980 |
979 void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes, | 981 void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes, |
(...skipping 19 matching lines...) Expand all Loading... |
999 } | 1001 } |
1000 | 1002 |
1001 // NOTE(chudy): Makes first item unselectable. | 1003 // NOTE(chudy): Makes first item unselectable. |
1002 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( | 1004 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( |
1003 fFilter.model()); | 1005 fFilter.model()); |
1004 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), | 1006 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), |
1005 fFilter.rootModelIndex()); | 1007 fFilter.rootModelIndex()); |
1006 QStandardItem* firstItem = model->itemFromIndex(firstIndex); | 1008 QStandardItem* firstItem = model->itemFromIndex(firstIndex); |
1007 firstItem->setSelectable(false); | 1009 firstItem->setSelectable(false); |
1008 } | 1010 } |
OLD | NEW |