From 63a8ac5210f1935c684b74170278b177d2e01561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mo=C5=84?= Date: Thu, 7 May 2020 16:45:14 +0200 Subject: [PATCH] Qt: Respect user preference to hide packet list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of hiding whole packet list widget when freezing, hide only the header. This prevents unwanted column resizes while keeping the widget on screen while capture file is loading. Prevent flickering by showing master_split_ only after all widgets are in correct place. Ping-Bug: 16063 Ping-Bug: 16491 Change-Id: I3bb0763c44b23b1e4118003502d4bf3903591f34 Reviewed-on: https://code.wireshark.org/review/37159 Reviewed-by: Stig Bjørlykke Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- ui/qt/main_window_layout.cpp | 8 ++++---- ui/qt/packet_list.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/qt/main_window_layout.cpp b/ui/qt/main_window_layout.cpp index 0707a35382..aa0db6d71d 100644 --- a/ui/qt/main_window_layout.cpp +++ b/ui/qt/main_window_layout.cpp @@ -91,10 +91,6 @@ void MainWindow::layoutPanes() empty_pane_.setParent(main_ui_->mainStack); extra_split_.setParent(main_ui_->mainStack); - // Show the master splitter here to prevent pending resize events changing packet list columns - // when the master splitter is set as current widget for the first time. - master_split_.show(); - // XXX We should try to preserve geometries if we can, e.g. by // checking to see if the layout type is the same. switch(prefs.gui_layout_type) { @@ -161,6 +157,10 @@ void MainWindow::layoutPanes() proto_tree_->setVisible(ms_children.contains(proto_tree_) && recent.tree_view_show); byte_view_tab_->setVisible(ms_children.contains(byte_view_tab_) && recent.byte_view_show); + // Show the master splitter here to prevent pending resize events changing packet list columns + // when the master splitter is set as current widget for the first time. + master_split_.show(); + packet_list_->thaw(true); cur_layout_ = new_layout; } diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index d936925a8f..78dedda7e3 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -1170,7 +1170,7 @@ void PacketList::captureFileReadFinished() void PacketList::freeze() { column_state_ = header()->saveState(); - setVisible(false); + setHeaderHidden(true); if (currentIndex().isValid()) { frozen_row_ = currentIndex().row(); } else { @@ -1188,7 +1188,7 @@ void PacketList::freeze() void PacketList::thaw(bool restore_selection) { - setVisible(true); + setHeaderHidden(false); setModel(packet_list_model_); // Resetting the model resets our column widths so we restore them here.