Remove redundant first tab on floating window.

This commit is contained in:
Chandler Cox
2024-07-16 20:05:27 -05:00
parent 009e1aaebb
commit 12f70572b0

View File

@@ -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
/// <inheritdoc />
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)