Update Editor UI to use empty Pivot after fa68a5f572

#3031
This commit is contained in:
Wojtek Figat
2025-03-16 23:06:08 +01:00
parent fa68a5f572
commit a4082934b8
26 changed files with 45 additions and 4 deletions

View File

@@ -79,6 +79,7 @@ namespace FlaxEditor.CustomEditors
_presenter = presenter;
AnchorPreset = AnchorPresets.StretchAll;
Offsets = Margin.Zero;
Pivot = Float2.Zero;
IsScrollable = true;
}

View File

@@ -56,6 +56,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
var bottomLeftCell = new VerticalPanel
{
Pivot = Float2.Zero,
Spacing = 0,
TopMargin = 0,
BottomMargin = 0,

View File

@@ -232,6 +232,7 @@ namespace FlaxEditor.CustomEditors.Editors
public void Setup(CollectionEditor editor, int index, bool canReorder = true)
{
Pivot = Float2.Zero;
HeaderHeight = 18;
_canReorder = canReorder;
EnableDropDownIcon = true;
@@ -884,6 +885,11 @@ namespace FlaxEditor.CustomEditors.Editors
set => _pickerValidator.FileExtension = value;
}
public DragAreaControl()
{
Pivot = Float2.Zero;
}
/// <inheritdoc />
public override void Draw()
{

View File

@@ -18,6 +18,7 @@ namespace FlaxEditor.CustomEditors.Elements
/// </summary>
public readonly DropPanel Panel = new DropPanel
{
Pivot = Float2.Zero,
ArrowImageClosed = new SpriteBrush(Style.Current.ArrowRight),
ArrowImageOpened = new SpriteBrush(Style.Current.ArrowDown),
EnableDropDownIcon = true,

View File

@@ -1,5 +1,6 @@
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.CustomEditors.Elements
@@ -13,7 +14,10 @@ namespace FlaxEditor.CustomEditors.Elements
/// <summary>
/// The panel.
/// </summary>
public readonly HorizontalPanel Panel = new HorizontalPanel();
public readonly HorizontalPanel Panel = new HorizontalPanel
{
Pivot = Float2.Zero,
};
/// <inheritdoc />
public override ContainerControl ContainerControl => Panel;

View File

@@ -1,5 +1,6 @@
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.CustomEditors.Elements
@@ -13,7 +14,10 @@ namespace FlaxEditor.CustomEditors.Elements
/// <summary>
/// The panel.
/// </summary>
public readonly VerticalPanel Panel = new VerticalPanel();
public readonly VerticalPanel Panel = new VerticalPanel
{
Pivot = Float2.Zero,
};
/// <inheritdoc />
public override ContainerControl ContainerControl => Panel;

View File

@@ -276,6 +276,7 @@ namespace FlaxEditor.GUI
Parent = _scrollPanel,
AnchorPreset = AnchorPresets.HorizontalStretchTop,
IsScrollable = true,
Pivot = Float2.Zero,
};
}

View File

@@ -833,6 +833,7 @@ namespace FlaxEditor.GUI.Timeline
{
AutoFocus = false,
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Pivot = Float2.Zero,
Offsets = Margin.Zero,
IsScrollable = true,
BottomMargin = 40.0f,

View File

@@ -235,6 +235,7 @@ namespace FlaxEditor.Surface.ContextMenu
{
Parent = panel1,
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Pivot = Float2.Zero,
IsScrollable = true,
};
_groupsPanel = panel2;
@@ -292,6 +293,7 @@ namespace FlaxEditor.Surface.ContextMenu
X = 8,
Width = Width * 0.5f - 16,
AutoSize = true,
Pivot = Float2.Zero,
};
_descriptionOutputPanel = new VerticalPanel()
@@ -300,6 +302,7 @@ namespace FlaxEditor.Surface.ContextMenu
X = Width * 0.5f + 8,
Width = Width * 0.5f - 16,
AutoSize = true,
Pivot = Float2.Zero,
};
}

View File

@@ -43,6 +43,7 @@ namespace FlaxEditor.Surface.ContextMenu
/// <param name="archetype">The group archetype.</param>
public VisjectCMGroup(VisjectCM cm, GroupArchetype archetype)
{
Pivot = Float2.Zero;
ContextMenu = cm;
Archetypes.Add(archetype);
Name = archetype.Name;

View File

@@ -352,6 +352,7 @@ namespace FlaxEditor.Tools.Foliage
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Offsets = new Margin(4, 4, 4, 0),
Pivot = Float2.Zero,
IsScrollable = true,
Parent = splitPanel.Panel1
};

View File

@@ -204,6 +204,7 @@ namespace FlaxEditor.Tools.Foliage
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Offsets = new Margin(4, 4, 4, 0),
Pivot = Float2.Zero,
IsScrollable = true,
Parent = splitPanel.Panel1
};

View File

@@ -1211,6 +1211,7 @@ namespace FlaxEditor.Utilities
{
Parent = panel1,
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Pivot = Float2.Zero,
IsScrollable = true,
};
tree = new Tree(false)

View File

@@ -390,6 +390,7 @@ namespace FlaxEditor.Windows
_entriesPanel = new VerticalPanel
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Pivot = Float2.Zero,
Offsets = Margin.Zero,
IsScrollable = true,
Parent = _split.Panel1,

View File

@@ -162,11 +162,13 @@ namespace FlaxEditor.Windows
{
AnchorPreset = AnchorPresets.StretchAll,
Offsets = Margin.Zero,
Pivot = Float2.Zero,
Parent = this,
};
var panel = new VerticalPanel
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Pivot = Float2.Zero,
Offsets = Margin.Zero,
IsScrollable = true,
Parent = scroll,
@@ -187,6 +189,7 @@ namespace FlaxEditor.Windows
var vp = new Panel
{
AnchorPreset = AnchorPresets.StretchAll,
Offsets = Margin.Zero,
Parent = this,
};
_addPluginProjectButton = new Button

View File

@@ -67,6 +67,7 @@ namespace FlaxEditor.Windows.Profiler
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Offsets = Margin.Zero,
Pivot = Float2.Zero,
IsScrollable = true,
Parent = panel,
};

View File

@@ -87,6 +87,7 @@ namespace FlaxEditor.Windows.Profiler
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Offsets = Margin.Zero,
Pivot = Float2.Zero,
IsScrollable = true,
Parent = panel,
};

View File

@@ -64,6 +64,7 @@ namespace FlaxEditor.Windows.Profiler
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Offsets = Margin.Zero,
Pivot = Float2.Zero,
IsScrollable = true,
Parent = panel,
};

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.Windows.Profiler
@@ -28,6 +28,7 @@ namespace FlaxEditor.Windows.Profiler
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Offsets = Margin.Zero,
Pivot = Float2.Zero,
IsScrollable = true,
Parent = panel,
};

View File

@@ -68,6 +68,7 @@ namespace FlaxEditor.Windows.Profiler
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Offsets = Margin.Zero,
Pivot = Float2.Zero,
IsScrollable = true,
Parent = panel,
};

View File

@@ -61,6 +61,7 @@ namespace FlaxEditor.Windows.Profiler
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Offsets = Margin.Zero,
Pivot = Float2.Zero,
IsScrollable = true,
Parent = panel,
};

View File

@@ -32,6 +32,7 @@ namespace FlaxEditor.Windows.Profiler
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Offsets = Margin.Zero,
Pivot = Float2.Zero,
IsScrollable = true,
Parent = panel,
};

View File

@@ -32,6 +32,7 @@ namespace FlaxEditor.Windows.Profiler
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
Offsets = Margin.Zero,
Pivot = Float2.Zero,
IsScrollable = true,
Parent = panel,
};

View File

@@ -92,6 +92,7 @@ namespace FlaxEditor.Windows
Parent = this,
AnchorPreset = AnchorPresets.StretchAll,
Offset = Vector2.Zero,
Pivot = Float2.Zero,
AutoSize = false,
Bounds = Rectangle.Empty
};

View File

@@ -473,6 +473,7 @@ namespace FlaxEngine.GUI
{
AnchorPreset = AnchorPresets.StretchAll,
BackgroundColor = Color.Transparent,
Pivot = Float2.Zero,
IsScrollable = true,
AutoSize = true,
Parent = popup.MainPanel,

View File

@@ -314,7 +314,8 @@ namespace FlaxEngine
{
_guiRoot = new CanvasRootControl(this)
{
IsLayoutLocked = false
IsLayoutLocked = false,
Pivot = Float2.Zero,
};
}