fix: merge docking resource dictionary and add test layout
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
||||||
<ResourceDictionary Source="/Themes/Generic.xaml" />
|
<ResourceDictionary Source="/Themes/Generic.xaml" />
|
||||||
|
<ResourceDictionary Source="/Themes/DockingDictionary.xaml" />
|
||||||
<core:ControlsDictionary />
|
<core:ControlsDictionary />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
12
src/Editor/Ghost.Editor/Themes/DockingDictionary.xaml
Normal file
12
src/Editor/Ghost.Editor/Themes/DockingDictionary.xaml
Normal 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>
|
||||||
@@ -43,6 +43,41 @@ internal sealed partial class EngineEditorWindow : WindowEx
|
|||||||
|
|
||||||
_notificationService.SetReference(InfoBar, NotificationQueue);
|
_notificationService.SetReference(InfoBar, NotificationQueue);
|
||||||
_progressService.SetReference(ProgressBarContainer);
|
_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)
|
private void MainGrid_Unloaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user