diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2016-10-02 16:41:08 +0200 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2016-10-02 17:55:40 +0000 |
commit | e38d103d30f8131efd22742d6b03d7f34a226936 (patch) | |
tree | 1e13ba2feb9fabe25e9035765a8e08f24cc0b0ae /ui | |
parent | 9f55eb4e954dd125e229bc94892e1571abd2cd65 (diff) | |
download | wireshark-e38d103d30f8131efd22742d6b03d7f34a226936.tar.gz |
Qt: Only color sequence analysis items having color filter
Packets without a color filter will end up with fg_color and
bg_color = 0, so avoid drawing all in black.
Bug: 12065
Change-Id: I76bcabcfa3281fcece08f1b2af66274c808b80bb
Reviewed-on: https://code.wireshark.org/review/18018
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/sequence_diagram.cpp | 10 | ||||
-rw-r--r-- | ui/tap-sequence-analysis.c | 1 | ||||
-rw-r--r-- | ui/tap-sequence-analysis.h | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/ui/qt/sequence_diagram.cpp b/ui/qt/sequence_diagram.cpp index bc69a55ea9..5aef1b45eb 100644 --- a/ui/qt/sequence_diagram.cpp +++ b/ui/qt/sequence_diagram.cpp @@ -265,8 +265,10 @@ void SequenceDiagram::draw(QCPPainter *painter) bg_color = sel_pal.color(QPalette::Highlight); selected_key_ = cur_key; } else if (sainfo_->type == SEQ_ANALYSIS_ANY) { - fg_pen.setColor(QColor().fromRgb(sai->fg_color)); - bg_color = QColor().fromRgb(sai->bg_color); + if (sai->has_color_filter) { + fg_pen.setColor(QColor().fromRgb(sai->fg_color)); + bg_color = QColor().fromRgb(sai->bg_color); + } } else { // SEQ_ANALYSIS_VOIP, SEQ_ANALYSIS_TCP fg_pen.setColor(Qt::black); bg_color = ColorUtils::sequenceColor(sai->conv_num); @@ -277,7 +279,9 @@ void SequenceDiagram::draw(QCPPainter *painter) QRect bg_rect( QPoint(coordsToPixels(cur_key - 0.5, value_axis_->range().lower).toPoint()), QPoint(coordsToPixels(cur_key + 0.5, value_axis_->range().upper).toPoint())); - painter->fillRect(bg_rect, bg_color); + if (bg_color.isValid()) { + painter->fillRect(bg_rect, bg_color); + } // painter->restore(); // Highlighted lifelines diff --git a/ui/tap-sequence-analysis.c b/ui/tap-sequence-analysis.c index 48cd9fd436..d93385154b 100644 --- a/ui/tap-sequence-analysis.c +++ b/ui/tap-sequence-analysis.c @@ -112,6 +112,7 @@ seq_analysis_frame_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U if (pinfo->fd->color_filter) { sai->bg_color = color_t_to_rgb(&pinfo->fd->color_filter->bg_color); sai->fg_color = color_t_to_rgb(&pinfo->fd->color_filter->fg_color); + sai->has_color_filter = TRUE; } sai->port_src=pinfo->srcport; diff --git a/ui/tap-sequence-analysis.h b/ui/tap-sequence-analysis.h index e505940720..fff6a46257 100644 --- a/ui/tap-sequence-analysis.h +++ b/ui/tap-sequence-analysis.h @@ -61,6 +61,7 @@ typedef struct _seq_analysis_item { guint16 conv_num; /**< The conversation number. Used for coloring VoIP calls. */ unsigned fg_color; /**< Foreground color, 0xRRGGBB. Qt only. */ unsigned bg_color; /**< Background color, 0xRRGGBB. Qt only. */ + gboolean has_color_filter; /**< Set if packet has color filter. Qt only. */ gboolean display; /**< indicate if the packet is displayed or not in the graph */ guint src_node; /**< this is used by graph_analysis.c to identify the node */ guint dst_node; /**< a node is an IP address that will be displayed in columns */ |