From ab9bb2ae2959918e9e9fbb97ed8dd7bab2611c83 Mon Sep 17 00:00:00 2001 From: James Crook Date: Thu, 17 Aug 2017 20:44:49 +0100 Subject: [PATCH] Bug 1532 - Toolbars fail to arrange correctly when maximizing or restoring main window size Layout() needs to be done before and after toolbar packing. See reasons in comments in revised code. --- src/Project.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Project.cpp b/src/Project.cpp index bab32eb4b..bdf7b4ece 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -2041,10 +2041,14 @@ void AudacityProject::UpdateLayout() if (!mTrackPanel) return; - // Layout first to get our NEW width, - // Then and only then we can arrange the toolbars. + // 1. Layout panel, to get widths of the docks. Layout(); + // 2. Layout toolbars to pack the toolbars correctly in docks which + // are now the correct width. mToolManager->LayoutToolBars(); + // 3. Layout panel, to resize docks, in particular reducing the height + // of any empty docks, or increasing the height of docks that need it. + Layout(); // Retrieve size of this projects window wxSize mainsz = GetSize();