aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJim Young <jyoung@gsu.edu>2021-04-18 20:28:21 -0400
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-04-21 08:36:27 +0000
commitd42042fcbbb0f22fa3ec5bcfb6849e1c73679f90 (patch)
tree308802d0cca5b33415567ca37fdc4ebc9d2bb2c3 /ui
parent6d809554a471827dde7b109eb89f06726086899f (diff)
Qt: Add checkbox for enabling/disabling packet-list hover_style
At times the presence of the packet-list hover_style colorization can make it difficult to determine the state of the packet directly under the mouse cursor. This forces the user to move the mouse cursor away from the packet-list row to reveal the next colorization state. The packet-list row colorization style precedence, from highest to lowest, is: hover_style, Selected, Ignored, Marked and then coloring rules. This patch adds a new 'Packet List settings:' checkbox option 'Enable mouse-over colorization'. By default the supporting preference `gui.packet_list_hover_style.enabled` will be enabled (TRUE). When this checkbox is disabled, the packet-list hover_style (mouse-over) colorization will not be used.
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/layout_preferences_frame.cpp10
-rw-r--r--ui/qt/layout_preferences_frame.h2
-rw-r--r--ui/qt/layout_preferences_frame.ui7
-rw-r--r--ui/qt/packet_list.cpp6
4 files changed, 24 insertions, 1 deletions
diff --git a/ui/qt/layout_preferences_frame.cpp b/ui/qt/layout_preferences_frame.cpp
index 1fee8d86fd..c0edcdcd64 100644
--- a/ui/qt/layout_preferences_frame.cpp
+++ b/ui/qt/layout_preferences_frame.cpp
@@ -47,6 +47,7 @@ LayoutPreferencesFrame::LayoutPreferencesFrame(QWidget *parent) :
).arg(ui->packetListSeparatorCheckBox->style()->subElementRect(QStyle::SE_CheckBoxContents, &style_opt).left());
ui->packetListSeparatorCheckBox->setStyleSheet(indent_ss);
ui->packetListHeaderShowColumnDefinition->setStyleSheet(indent_ss);
+ ui->packetListHoverStyleCheckbox->setStyleSheet(indent_ss);
ui->statusBarShowSelectedPacketCheckBox->setStyleSheet(indent_ss);
ui->statusBarShowFileLoadTimeCheckBox->setStyleSheet(indent_ss);
@@ -56,6 +57,9 @@ LayoutPreferencesFrame::LayoutPreferencesFrame(QWidget *parent) :
pref_packet_header_column_definition_ = prefFromPrefPtr(&prefs.gui_qt_packet_header_column_definition);
ui->packetListHeaderShowColumnDefinition->setChecked(prefs_get_bool_value(pref_packet_header_column_definition_, pref_stashed));
+ pref_packet_list_hover_style_ = prefFromPrefPtr(&prefs.gui_qt_packet_list_hover_style);
+ ui->packetListHoverStyleCheckbox->setChecked(prefs_get_bool_value(pref_packet_list_hover_style_, pref_stashed));
+
pref_show_selected_packet_ = prefFromPrefPtr(&prefs.gui_qt_show_selected_packet);
ui->statusBarShowSelectedPacketCheckBox->setChecked(prefs_get_bool_value(pref_show_selected_packet_, pref_stashed));
@@ -337,6 +341,7 @@ void LayoutPreferencesFrame::on_restoreButtonBox_clicked(QAbstractButton *)
ui->packetListSeparatorCheckBox->setChecked(prefs_get_bool_value(pref_packet_list_separator_, pref_default));
ui->packetListHeaderShowColumnDefinition->setChecked(prefs_get_bool_value(pref_packet_header_column_definition_, pref_default));
+ ui->packetListHoverStyleCheckbox->setChecked(prefs_get_bool_value(pref_packet_list_hover_style_, pref_default));
ui->statusBarShowSelectedPacketCheckBox->setChecked(prefs_get_bool_value(pref_show_selected_packet_, pref_default));
ui->statusBarShowFileLoadTimeCheckBox->setChecked(prefs_get_bool_value(pref_show_file_load_time_, pref_default));
}
@@ -351,6 +356,11 @@ void LayoutPreferencesFrame::on_packetListHeaderShowColumnDefinition_toggled(boo
prefs_set_bool_value(pref_packet_header_column_definition_, (gboolean) checked, pref_stashed);
}
+void LayoutPreferencesFrame::on_packetListHoverStyleCheckbox_toggled(bool checked)
+{
+ prefs_set_bool_value(pref_packet_list_hover_style_, (gboolean) checked, pref_stashed);
+}
+
void LayoutPreferencesFrame::on_statusBarShowSelectedPacketCheckBox_toggled(bool checked)
{
prefs_set_bool_value(pref_show_selected_packet_, (gboolean) checked, pref_stashed);
diff --git a/ui/qt/layout_preferences_frame.h b/ui/qt/layout_preferences_frame.h
index 342f3cf5b4..0ffb319aca 100644
--- a/ui/qt/layout_preferences_frame.h
+++ b/ui/qt/layout_preferences_frame.h
@@ -39,6 +39,7 @@ private:
pref_t *pref_layout_content_3_;
pref_t *pref_packet_list_separator_;
pref_t *pref_packet_header_column_definition_;
+ pref_t *pref_packet_list_hover_style_;
pref_t *pref_show_selected_packet_;
pref_t *pref_show_file_load_time_;
@@ -69,6 +70,7 @@ private slots:
void on_restoreButtonBox_clicked(QAbstractButton *button);
void on_packetListSeparatorCheckBox_toggled(bool checked);
void on_packetListHeaderShowColumnDefinition_toggled(bool checked);
+ void on_packetListHoverStyleCheckbox_toggled(bool checked);
void on_statusBarShowSelectedPacketCheckBox_toggled(bool checked);
void on_statusBarShowFileLoadTimeCheckBox_toggled(bool checked);
};
diff --git a/ui/qt/layout_preferences_frame.ui b/ui/qt/layout_preferences_frame.ui
index 0ce09cad74..163b880556 100644
--- a/ui/qt/layout_preferences_frame.ui
+++ b/ui/qt/layout_preferences_frame.ui
@@ -396,6 +396,13 @@
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="packetListHoverStyleCheckbox">
+ <property name="text">
+ <string>Enable mouse-over colorization</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index d01dfaa05f..f86dc1b5b9 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -370,7 +370,11 @@ void PacketList::colorsChanged()
}
// Set the style sheet
- setStyleSheet(active_style + inactive_style + hover_style);
+ if(prefs.gui_qt_packet_list_hover_style) {
+ setStyleSheet(active_style + inactive_style + hover_style);
+ } else {
+ setStyleSheet(active_style + inactive_style);
+ }
}
QString PacketList::joinSummaryRow(QStringList col_parts, int row, SummaryCopyType type)