aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/packet_list.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-06-11 15:53:51 -0700
committerGerald Combs <gerald@wireshark.org>2015-07-16 22:57:31 +0000
commit255d53dfc11fa49eadd30fefe3ed5950b03e6659 (patch)
tree1404c49ffb41d4f1245889f24e0e260e4cc011fd /ui/qt/packet_list.h
parent3e059c9d1fedf9c890f910fa88cc2ef99fb1e470 (diff)
Draw packet colors in the packet list scrollbar.
Inspired by (but not as fancy as) Packet Fence, an enhancement written for Ethereal a loooong time ago by Martin Visser: https://www.wireshark.org/lists/ethereal-dev/200011/msg00122.html Several text editors call this a "minimap". Color each scrollbar raster line to match the color of up to 7 packets. Note in the comments why this number was chosen. If we have any flagged frames (marked, ignored, time ref) indicate them on either side of the scrolbar. Handle HiDPI (retina) displays. This means that your window size depends on the height of your scrollbar *and* your monitor resolution. Qt's idea of the slider rect doesn't match up with the slider on OS X. This might be local to my build -- I can replicate it Qt Creator. Change-Id: Ia089d2d766ce37bab11e22d1a5721b4908935304 Reviewed-on: https://code.wireshark.org/review/8982 Reviewed-by: Gerald Combs <gerald@wireshark.org> Tested-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/packet_list.h')
-rw-r--r--ui/qt/packet_list.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/ui/qt/packet_list.h b/ui/qt/packet_list.h
index d1059aabc1..ae7b751281 100644
--- a/ui/qt/packet_list.h
+++ b/ui/qt/packet_list.h
@@ -33,6 +33,8 @@
#include <QTime>
#include <QTreeView>
+class OverlayScrollBar;
+
class QAction;
class QTimerEvent;
@@ -62,6 +64,7 @@ public:
void writeRecent(FILE *rf);
bool contextMenuActive();
QString &getFilterFromRowAndColumn();
+ void resetColorized();
QString packetComment();
void setPacketComment(QString new_comment);
QString allPacketComments();
@@ -70,10 +73,11 @@ public:
void setCaptureInProgress(bool in_progress = false) { capture_in_progress_ = in_progress; tail_at_end_ = in_progress; }
protected:
- void showEvent (QShowEvent *);
- void selectionChanged (const QItemSelection & selected, const QItemSelection & deselected);
+ void showEvent(QShowEvent *);
+ void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
void contextMenuEvent(QContextMenuEvent *event);
void timerEvent(QTimerEvent *event);
+ void paintEvent(QPaintEvent *event);
protected slots:
void rowsInserted(const QModelIndex &parent, int start, int end);
@@ -89,6 +93,11 @@ private:
QAction *decode_as_;
int ctx_column_;
QByteArray column_state_;
+ OverlayScrollBar *overlay_sb_;
+ int overlay_timer_id_;
+ bool create_near_overlay_;
+ bool create_far_overlay_;
+ QVector<QRgb> overlay_colors_;
RelatedPacketDelegate related_packet_delegate_;
QMenu header_ctx_menu_;
@@ -142,6 +151,8 @@ private slots:
void sectionResized(int col, int, int new_width);
void sectionMoved(int, int, int);
void vScrollBarActionTriggered(int);
+ void drawFarOverlay();
+ void drawNearOverlay();
};
#endif // PACKET_LIST_H