forked from osmocom/wireshark
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>
This commit is contained in:
parent
9f55eb4e95
commit
e38d103d30
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue