]> sigrok.org Git - pulseview.git/commitdiff
LogicSignal: Don't paint hover marker if channel is disabled
authorSoeren Apel <redacted>
Thu, 21 Jun 2018 18:23:08 +0000 (20:23 +0200)
committerUwe Hermann <redacted>
Sat, 21 Jul 2018 16:57:21 +0000 (18:57 +0200)
pv/views/trace/logicsignal.cpp

index 79065ebd4740fbb7ffc215abcded4f18d53d15b9..c129559185437879bee31bb51b530f5ad125e586 100644 (file)
@@ -293,41 +293,43 @@ void LogicSignal::paint_mid(QPainter &p, ViewItemPaintParams &pp)
 
 void LogicSignal::paint_fore(QPainter &p, ViewItemPaintParams &pp)
 {
-       // Draw the trigger marker
-       if (base_->enabled() && trigger_match_) {
-               const int y = get_visual_y();
-
-               for (int32_t type_id : trigger_types_) {
-                       const TriggerMatchType *const type =
-                               TriggerMatchType::get(type_id);
-                       if (trigger_match_ != type || type_id < 0 ||
-                               (size_t)type_id >= countof(TriggerMarkerIcons) ||
-                               !TriggerMarkerIcons[type_id])
-                               continue;
+       if (base_->enabled()) {
+               if (trigger_match_) {
+                       // Draw the trigger marker
+                       const int y = get_visual_y();
+
+                       for (int32_t type_id : trigger_types_) {
+                               const TriggerMatchType *const type =
+                                       TriggerMatchType::get(type_id);
+                               if (trigger_match_ != type || type_id < 0 ||
+                                       (size_t)type_id >= countof(TriggerMarkerIcons) ||
+                                       !TriggerMarkerIcons[type_id])
+                                       continue;
 
-                       const QPixmap *const pixmap = get_pixmap(
-                               TriggerMarkerIcons[type_id]);
-                       if (!pixmap)
-                               continue;
+                               const QPixmap *const pixmap = get_pixmap(
+                                       TriggerMarkerIcons[type_id]);
+                               if (!pixmap)
+                                       continue;
 
-                       const float pad = TriggerMarkerPadding - 0.5f;
-                       const QSize size = pixmap->size();
-                       const QPoint point(
-                               pp.right() - size.width() - pad * 2,
-                               y - (signal_height_ + size.height()) / 2);
+                               const float pad = TriggerMarkerPadding - 0.5f;
+                               const QSize size = pixmap->size();
+                               const QPoint point(
+                                       pp.right() - size.width() - pad * 2,
+                                       y - (signal_height_ + size.height()) / 2);
 
-                       p.setPen(QPen(TriggerMarkerBackgroundColor.darker()));
-                       p.setBrush(TriggerMarkerBackgroundColor);
-                       p.drawRoundedRect(QRectF(point, size).adjusted(
-                               -pad, -pad, pad, pad), pad, pad);
-                       p.drawPixmap(point, *pixmap);
+                               p.setPen(QPen(TriggerMarkerBackgroundColor.darker()));
+                               p.setBrush(TriggerMarkerBackgroundColor);
+                               p.drawRoundedRect(QRectF(point, size).adjusted(
+                                       -pad, -pad, pad, pad), pad, pad);
+                               p.drawPixmap(point, *pixmap);
 
-                       break;
+                               break;
+                       }
                }
-       }
 
-       if (show_hover_marker_)
-               paint_hover_marker(p);
+               if (show_hover_marker_)
+                       paint_hover_marker(p);
+       }
 }
 
 void LogicSignal::paint_caps(QPainter &p, QLineF *const lines,