Qt: Respect user preference to hide packet list

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 <stig@bjorlykke.org>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Tomasz Moń 2020-05-07 16:45:14 +02:00 committed by Anders Broman
parent fd7895d37c
commit 63a8ac5210
2 changed files with 6 additions and 6 deletions

View File

@ -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;
}

View File

@ -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.