fix: merge docking resource dictionary and add test layout

This commit is contained in:
2026-03-28 23:36:23 +09:00
parent 1c553a55fa
commit 99adf8fc3b
3 changed files with 48 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<ResourceDictionary Source="/Themes/Generic.xaml" />
<ResourceDictionary Source="/Themes/DockingDictionary.xaml" />
<core:ControlsDictionary />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@@ -0,0 +1,12 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/View/Controls/Docking/DockingLayout.xaml" />
<ResourceDictionary Source="/View/Controls/Docking/DockGroup.xaml" />
<ResourceDictionary Source="/View/Controls/Docking/DockPanel.xaml" />
<ResourceDictionary Source="/View/Controls/Docking/DockRegionHighlight.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@@ -43,6 +43,41 @@ internal sealed partial class EngineEditorWindow : WindowEx
_notificationService.SetReference(InfoBar, NotificationQueue);
_progressService.SetReference(ProgressBarContainer);
InitializeDockingLayout();
}
private void InitializeDockingLayout()
{
var sceneDoc = new Ghost.Editor.View.Controls.Docking.DockDocument { Title = "Scene", Content = new Ghost.Editor.View.Pages.EngineEditor.ScenePage() };
var hierarchyDoc = new Ghost.Editor.View.Controls.Docking.DockDocument { Title = "Hierarchy", Content = new Ghost.Editor.View.Controls.Hierarchy() };
var inspectorDoc = new Ghost.Editor.View.Controls.Docking.DockDocument { Title = "Inspector", Content = new Ghost.Editor.View.Pages.EngineEditor.InspectorPage() };
var projectDoc = new Ghost.Editor.View.Controls.Docking.DockDocument { Title = "Project", Content = new Ghost.Editor.View.Controls.ProjectBrowser() };
var consoleDoc = new Ghost.Editor.View.Controls.Docking.DockDocument { Title = "Console", Content = new Ghost.Editor.View.Pages.EngineEditor.ConsolePage() };
var leftGroup = new Ghost.Editor.View.Controls.Docking.DockGroup();
leftGroup.AddChild(hierarchyDoc);
var centerGroup = new Ghost.Editor.View.Controls.Docking.DockGroup();
centerGroup.AddChild(sceneDoc);
var rightGroup = new Ghost.Editor.View.Controls.Docking.DockGroup();
rightGroup.AddChild(inspectorDoc);
var bottomGroup = new Ghost.Editor.View.Controls.Docking.DockGroup();
bottomGroup.AddChild(projectDoc);
bottomGroup.AddChild(consoleDoc);
var topPanel = new Ghost.Editor.View.Controls.Docking.DockPanel { Orientation = Microsoft.UI.Xaml.Controls.Orientation.Horizontal };
topPanel.AddChild(leftGroup);
topPanel.AddChild(centerGroup);
topPanel.AddChild(rightGroup);
var rootPanel = new Ghost.Editor.View.Controls.Docking.DockPanel { Orientation = Microsoft.UI.Xaml.Controls.Orientation.Vertical };
rootPanel.AddChild(topPanel);
rootPanel.AddChild(bottomGroup);
MainDockingLayout.RootModule = rootPanel;
}
private void MainGrid_Unloaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)