diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2017-12-01 20:14:49 +0000 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-12-04 05:51:55 +0000 |
commit | e5f884c8b0a1af4a84a7f4aeb0b22d033fd1c6fb (patch) | |
tree | 055335d6d7731bdc45f565a28ec5640f7f97f079 /ui | |
parent | 5350fd741f0ceafdea69b3ec6b04565b47146822 (diff) |
Show retx prev and next framenum types as chevrons
Change-Id: I1641c70130a7562db9ea099770d8b5a7fe6e5532
Reviewed-on: https://code.wireshark.org/review/24676
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/models/related_packet_delegate.cpp | 37 | ||||
-rw-r--r-- | ui/qt/models/related_packet_delegate.h | 1 |
2 files changed, 36 insertions, 2 deletions
diff --git a/ui/qt/models/related_packet_delegate.cpp b/ui/qt/models/related_packet_delegate.cpp index 821c4972df..f9656adbb4 100644 --- a/ui/qt/models/related_packet_delegate.cpp +++ b/ui/qt/models/related_packet_delegate.cpp @@ -162,7 +162,6 @@ void RelatedPacketDelegate::paint(QPainter *painter, const QStyleOptionViewItem // Request and response arrows are moved forward one pixel in order to // maximize white space between the heads and the conversation line. case FT_FRAMENUM_REQUEST: - case FT_FRAMENUM_RETRANS_PREV: { int hh = height / 2; QPoint tail(2 - en_w, hh); @@ -171,7 +170,6 @@ void RelatedPacketDelegate::paint(QPainter *painter, const QStyleOptionViewItem break; } case FT_FRAMENUM_RESPONSE: - case FT_FRAMENUM_RETRANS_NEXT: { int hh = height / 2; QPoint tail(en_w - 1, hh); @@ -193,6 +191,22 @@ void RelatedPacketDelegate::paint(QPainter *painter, const QStyleOptionViewItem drawCheckMark(painter, bbox); break; } + case FT_FRAMENUM_RETRANS_PREV: + { + int hh = height / 2; + QPoint tail(2 - en_w, hh); + QPoint head(en_w, hh); + drawChevrons(painter, tail, head, hh / 2); + break; + } + case FT_FRAMENUM_RETRANS_NEXT: + { + int hh = height / 2; + QPoint tail(en_w - 1, hh); + QPoint head(1 - en_w, hh); + drawChevrons(painter, tail, head, hh / 2); + break; + } case FT_FRAMENUM_NONE: default: painter->drawEllipse(QPointF(0.0, option_vi.rect.height() / 2), 2, 2); @@ -221,6 +235,25 @@ void RelatedPacketDelegate::drawArrow(QPainter *painter, const QPoint tail, cons painter->drawPolygon(head_points, 3); } +void RelatedPacketDelegate::drawChevrons(QPainter *painter, const QPoint tail, const QPoint head, int head_size) const +{ + int x_mul = head.x() > tail.x() ? -1 : 1; + QPoint head_points1[] = { + head, + QPoint(head.x() + (head_size * x_mul), head.y() + (head_size / 2)), + QPoint(head.x() + (head_size * x_mul), head.y() - (head_size / 2)), + }; + QPoint head2(head.x() + (head_size * x_mul), head.y()); + QPoint head_points2[] = { + head2, + QPoint(head2.x() + (head_size * x_mul), head2.y() + (head_size / 2)), + QPoint(head2.x() + (head_size * x_mul), head2.y() - (head_size / 2)), + }; + + painter->drawPolygon(head_points1, 3); + painter->drawPolygon(head_points2, 3); +} + void RelatedPacketDelegate::drawCheckMark(QPainter *painter, const QRect bbox) const { QPoint cm_points[] = { diff --git a/ui/qt/models/related_packet_delegate.h b/ui/qt/models/related_packet_delegate.h index 152448dfe6..56c84928f8 100644 --- a/ui/qt/models/related_packet_delegate.h +++ b/ui/qt/models/related_packet_delegate.h @@ -56,6 +56,7 @@ private: guint32 current_frame_; void drawArrow(QPainter *painter, const QPoint tail, const QPoint head, int head_size) const; + void drawChevrons(QPainter *painter, const QPoint tail, const QPoint head, int head_size) const; void drawCheckMark(QPainter *painter, const QRect bbox) const; signals: |