Qt: Disable collapsible children in the main window.
authorGerald Combs <gerald@wireshark.org>
Tue, 10 Apr 2018 09:25:53 +0000 (17:25 +0800)
committerMartin Kaiser <wireshark@kaiser.cx>
Wed, 11 Apr 2018 01:21:46 +0000 (01:21 +0000)
Set the childrenCollapsible property to false in the main window
splitters. Set the minimum size for the packet list, proto tree, and
byte views to a small (one em), consistent, and nonzero value. Otherwise
it's easy to inadvertently end up with a hidden main window view.

Bug: 14478
Change-Id: I07a352cf2cf0375829ae2e0cb53b2a7d717dbb7d
Reviewed-on: https://code.wireshark.org/review/26847
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
ui/qt/byte_view_tab.cpp
ui/qt/main_window.cpp
ui/qt/packet_list.cpp
ui/qt/proto_tree.cpp

index ab48c75fb3efefa4221855c3fc49acdbdd01f66e..50e194462d2b7a6e2cd0e5daf7d3f04a442d9480 100644 (file)
@@ -38,6 +38,10 @@ ByteViewTab::ByteViewTab(QWidget *parent, epan_dissect_t *edt_fixed) :
     setTabPosition(QTabWidget::South);
     setDocumentMode(true);
 
+    // Shrink down to a small but nonzero size in the main splitter.
+    int one_em = fontMetrics().height();
+    setMinimumSize(one_em, one_em);
+
     if (!edt_fixed) {
         connect(wsApp, SIGNAL(appInitialized()), this, SLOT(connectToMainWindow()));
     }
index d9632b06fca4eeaff3ad96180a0206702b461caa..1d5aebfe7a7c1ef8776147961029e94425bfd4fc 100644 (file)
@@ -484,6 +484,8 @@ MainWindow::MainWindow(QWidget *parent) :
 #endif
     master_split_.setObjectName("splitterMaster");
     extra_split_.setObjectName("splitterExtra");
+    master_split_.setChildrenCollapsible(false);
+    extra_split_.setChildrenCollapsible(false);
     main_ui_->mainStack->addWidget(&master_split_);
 
     empty_pane_.setObjectName("emptyPane");
index a2da5116ef9280ca93515930c5f89eb42c17a7be..a1d1a9857d68a8246347dc19337d7060450e0c72 100644 (file)
@@ -249,6 +249,10 @@ PacketList::PacketList(QWidget *parent) :
     setUniformRowHeights(true);
     setAccessibleName("Packet list");
 
+    // Shrink down to a small but nonzero size in the main splitter.
+    int one_em = fontMetrics().height();
+    setMinimumSize(one_em, one_em);
+
     overlay_sb_ = new OverlayScrollBar(Qt::Vertical, this);
     setVerticalScrollBar(overlay_sb_);
 
index 161b04b8c1a235c5503c88601dff4f54bdbcc2ff..5d5f7509ac2132694bd279e0d24f405b2380941d 100644 (file)
@@ -47,6 +47,10 @@ ProtoTree::ProtoTree(QWidget *parent) :
     // similar to PacketListModel::data.
     setHeaderHidden(true);
 
+    // Shrink down to a small but nonzero size in the main splitter.
+    int one_em = fontMetrics().height();
+    setMinimumSize(one_em, one_em);
+
     setModel(proto_tree_model_);
 
     connect(this, SIGNAL(expanded(QModelIndex)), this, SLOT(syncExpanded(QModelIndex)));