aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-04-10 17:25:53 +0800
committerMartin Kaiser <wireshark@kaiser.cx>2018-04-11 01:21:46 +0000
commit6208796b9ed08e81c4411e9463e2f9c9c85ef711 (patch)
tree88cc5a0c670f26a1a0974f08ef274fedc8e49f0d
parent0b7c6f03b0f1c2737a16b68c9f689e373bd83b80 (diff)
Qt: Disable collapsible children in the main window.
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>
-rw-r--r--ui/qt/byte_view_tab.cpp4
-rw-r--r--ui/qt/main_window.cpp2
-rw-r--r--ui/qt/packet_list.cpp4
-rw-r--r--ui/qt/proto_tree.cpp4
4 files changed, 14 insertions, 0 deletions
diff --git a/ui/qt/byte_view_tab.cpp b/ui/qt/byte_view_tab.cpp
index ab48c75..50e1944 100644
--- a/ui/qt/byte_view_tab.cpp
+++ b/ui/qt/byte_view_tab.cpp
@@ -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()));
}
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index d9632b0..1d5aebf 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -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");
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index a2da511..a1d1a98 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -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_);
diff --git a/ui/qt/proto_tree.cpp b/ui/qt/proto_tree.cpp
index 161b04b..5d5f750 100644
--- a/ui/qt/proto_tree.cpp
+++ b/ui/qt/proto_tree.cpp
@@ -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)));