From 401e8cf492b01d8f763c318bf2b08dfeed6de8c7 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Fri, 30 Jul 2021 13:50:17 +0200 Subject: [PATCH] Improved initial size of floating dock widget --- src/DockWidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/DockWidget.cpp b/src/DockWidget.cpp index 1d251a0..059f5a2 100644 --- a/src/DockWidget.cpp +++ b/src/DockWidget.cpp @@ -133,7 +133,9 @@ void DockWidgetPrivate::showDockWidget() if (!DockArea) { CFloatingDockContainer* FloatingWidget = new CFloatingDockContainer(_this); - FloatingWidget->resize(_this->size()); + // We use the size hint of the content widget to provide a good + // initial size + FloatingWidget->resize(Widget ? Widget->sizeHint() : _this->sizeHint()); TabWidget->show(); FloatingWidget->show(); }