From 12f70572b0f30b5eeb3cc1eac2aca3ee3c7c95d2 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Tue, 16 Jul 2024 20:05:27 -0500 Subject: [PATCH] Remove redundant first tab on floating window. --- Source/Editor/GUI/Docking/DockPanelProxy.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Editor/GUI/Docking/DockPanelProxy.cs b/Source/Editor/GUI/Docking/DockPanelProxy.cs index 1234c7777..5ca4a024a 100644 --- a/Source/Editor/GUI/Docking/DockPanelProxy.cs +++ b/Source/Editor/GUI/Docking/DockPanelProxy.cs @@ -187,6 +187,10 @@ namespace FlaxEditor.GUI.Docking var headerRect = HeaderRectangle; var tabsCount = _panel.TabsCount; + // Return and don't draw tab if only 1 window and it is floating + if (_panel.IsFloating && tabsCount == 1 && _panel.ChildPanelsCount == 0) + return; + // Check if has only one window docked if (tabsCount == 1) { @@ -501,7 +505,10 @@ namespace FlaxEditor.GUI.Docking /// public override void GetDesireClientArea(out Rectangle rect) { - rect = new Rectangle(0, DockPanel.DefaultHeaderHeight, Width, Height - DockPanel.DefaultHeaderHeight); + if (_panel.TabsCount == 1 && _panel.IsFloating && _panel.ChildPanelsCount == 0) + rect = new Rectangle(0, 0, Width, Height); + else + rect = new Rectangle(0, DockPanel.DefaultHeaderHeight, Width, Height - DockPanel.DefaultHeaderHeight); } private DragDropEffect TrySelectTabUnderLocation(ref Float2 location)