]> git.cworth.org Git - apitrace/blobdiff - gui/apicalldelegate.cpp
Lots of various cosmetic changes to the call editing.
[apitrace] / gui / apicalldelegate.cpp
index 4eb542be2171bce1c410da3397fb8eb7592356c1..c2a1b23f54f47172fcc59885989011b2c68c7d58 100644 (file)
@@ -11,7 +11,8 @@
 
 ApiCallDelegate::ApiCallDelegate(QWidget *parent)
     : QStyledItemDelegate(parent),
-      m_stateEmblem(":/resources/dialog-information.png")
+      m_stateEmblem(":/resources/dialog-information.png"),
+      m_editEmblem(":/resources/document-edit.png")
 {
 }
 
@@ -32,10 +33,21 @@ void ApiCallDelegate::paint(QPainter *painter,
         QStyle *style = QApplication::style();
         style->drawControl(QStyle::CE_ItemViewItem, &option, painter, 0);
         if (!event->state().isEmpty()) {
-            QPixmap px = m_stateEmblem.pixmap(option.rect.height(), option.rect.height());
+            QPixmap px = m_stateEmblem.pixmap(option.rect.height(),
+                                              option.rect.height());
             painter->drawPixmap(option.rect.topLeft(), px);
             offset = QPoint(option.rect.height() + 5, 0);
         }
+        if (event->type() == ApiTraceEvent::Call) {
+            ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
+            if (call->edited()) {
+                QPixmap px = m_editEmblem.pixmap(option.rect.height(),
+                                                 option.rect.height());
+                painter->drawPixmap(option.rect.topLeft() + offset, px);
+                offset += QPoint(option.rect.height() + 5, 0);
+            }
+        }
+
         painter->drawStaticText(option.rect.topLeft() + offset, text);
     } else {
         QStyledItemDelegate::paint(painter, option, index);