Refactor UI panels, shader logic, and project settings
Refactored Hierarchy and Inspector panels into separate controls with improved styling and modularity. Cached EngineCore in EditorShaderCompilerBridge and updated shader cache logic for correctness. Renamed static field in PropertyField for consistency. Enhanced test coverage and fixed IDisposable implementation. Added XAML debugging properties for Debug_Editor and cleaned up obsolete scripts.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Views\Controls\Hierarchy.xaml" />
|
||||
<None Remove="Views\Controls\Inspector.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||
@@ -140,6 +141,9 @@
|
||||
<None Update="Assets\icon.ico">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<Page Update="Views\Controls\Inspector.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Update="Views\Controls\LogViewer.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
@@ -214,6 +218,11 @@
|
||||
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug_Editor'">
|
||||
<XamlDebuggingInformation>True</XamlDebuggingInformation>
|
||||
<DisableXbfLineInfo>False</DisableXbfLineInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Publish Properties -->
|
||||
<PropertyGroup>
|
||||
<PublishReadyToRun Condition="'$(Configuration)'=='Debug_Editor'">False</PublishReadyToRun>
|
||||
|
||||
@@ -14,49 +14,55 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Height="40"
|
||||
Padding="8,8,8,4"
|
||||
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="0,0,0,1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
Padding="8,2,4,4"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<AutoSuggestBox
|
||||
Grid.Column="0"
|
||||
PlaceholderText="Search"
|
||||
QueryIcon="Find" />
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||
<AppBarSeparator />
|
||||
<Button Style="{ThemeResource ToolbarButton}">
|
||||
<FontIcon FontSize="{StaticResource ToolbarIconSize}" Glyph="" />
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
|
||||
Style="{StaticResource BodyLargeStrongTextBlockStyle}"
|
||||
Text="Hierarchy" />
|
||||
<Button
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
Style="{ThemeResource ToolbarButton}">
|
||||
<FontIcon Glyph="" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Border Grid.Row="1" Padding="4">
|
||||
<ListView>
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<FontIcon FontSize="{StaticResource ToolbarIconSize}" Glyph="" />
|
||||
<TextBlock Text="Test" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<FontIcon FontSize="{StaticResource ToolbarIconSize}" Glyph="" />
|
||||
<TextBlock Text="Test" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<FontIcon FontSize="{StaticResource ToolbarIconSize}" Glyph="" />
|
||||
<TextBlock Text="Test" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<FontIcon FontSize="{StaticResource ToolbarIconSize}" Glyph="" />
|
||||
<TextBlock Text="Test" />
|
||||
</StackPanel>
|
||||
</ListView>
|
||||
</Border>
|
||||
<Grid Margin="0,2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<FontIcon
|
||||
Grid.Column="0"
|
||||
Margin="0,0,4,0"
|
||||
FontSize="{StaticResource ToolbarFontIconFontSize}"
|
||||
Glyph="" />
|
||||
<TextBox Grid.Column="1" PlaceholderText="Sreach item..." />
|
||||
</Grid>
|
||||
|
||||
<Border Margin="-8,8,-4,-4" Style="{StaticResource HorizontalStrongDivider}" />
|
||||
</StackPanel>
|
||||
|
||||
<ListView Grid.Row="1" Padding="4,2,0,2">
|
||||
<ListViewItem Content="Test" />
|
||||
<ListViewItem Content="Test" />
|
||||
<ListViewItem Content="Test" />
|
||||
<ListViewItem Content="Test" />
|
||||
<ListViewItem Content="Test" />
|
||||
<ListViewItem Content="Test" />
|
||||
</ListView>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
107
src/Editor/Ghost.Editor/Views/Controls/Inspector.xaml
Normal file
107
src/Editor/Ghost.Editor/Views/Controls/Inspector.xaml
Normal file
@@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<UserControl
|
||||
x:Class="Ghost.Editor.Views.Controls.Inspector"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:Ghost.Editor.Views.Controls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Inspector Header -->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Padding="12,12,8,12"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
ColumnSpacing="8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<FontIcon
|
||||
Grid.Column="0"
|
||||
FontSize="18"
|
||||
Glyph="" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
FontSize="14"
|
||||
Text="Name" />
|
||||
<DropDownButton
|
||||
Grid.Column="2"
|
||||
Padding="2"
|
||||
Style="{ThemeResource ToolbarButton}">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem Text="Send" />
|
||||
<MenuFlyoutItem Text="Reply" />
|
||||
<MenuFlyoutItem Text="Reply All" />
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
<FontIcon FontSize="12" Glyph="" />
|
||||
</DropDownButton>
|
||||
</Grid>
|
||||
|
||||
<!-- Content -->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" MaxHeight="150" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Padding="8,2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource BodyStrongTextBlockStyle}"
|
||||
Text="Components" />
|
||||
<Button Grid.Column="1" Style="{ThemeResource ToolbarButton}">
|
||||
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||
</Button>
|
||||
<Button Grid.Column="2" Style="{ThemeResource ToolbarButton}">
|
||||
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<AutoSuggestBox
|
||||
Grid.Row="1"
|
||||
Margin="8,0"
|
||||
PlaceholderText="Search components..." />
|
||||
|
||||
<!-- Components List -->
|
||||
<ListView
|
||||
Grid.Row="2"
|
||||
Padding="4,2,0,2"
|
||||
SelectionMode="Extended">
|
||||
<TextBlock Text="Test" />
|
||||
<TextBlock Text="Test" />
|
||||
<TextBlock Text="Test" />
|
||||
</ListView>
|
||||
|
||||
<!-- Component Properties for Selected Component -->
|
||||
<ScrollView
|
||||
Grid.Row="3"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="0,1,0,0">
|
||||
<ItemsRepeater />
|
||||
</ScrollView>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
27
src/Editor/Ghost.Editor/Views/Controls/Inspector.xaml.cs
Normal file
27
src/Editor/Ghost.Editor/Views/Controls/Inspector.xaml.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace Ghost.Editor.Views.Controls;
|
||||
|
||||
public sealed partial class Inspector : UserControl
|
||||
{
|
||||
public Inspector()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -95,67 +95,12 @@
|
||||
<ColumnDefinition Width="0.25*" MaxWidth="350" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Hierarchy -->
|
||||
<Grid
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="0,0,1,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Padding="8,2,4,4"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
|
||||
Style="{StaticResource BodyLargeStrongTextBlockStyle}"
|
||||
Text="Hierarchy" />
|
||||
<Button
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
Style="{ThemeResource ToolbarButton}">
|
||||
<FontIcon Glyph="" />
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<Grid Margin="0,2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<FontIcon
|
||||
Grid.Column="0"
|
||||
Margin="0,0,4,0"
|
||||
FontSize="{StaticResource ToolbarFontIconFontSize}"
|
||||
Glyph="" />
|
||||
<TextBox Grid.Column="1" PlaceholderText="Sreach item..." />
|
||||
</Grid>
|
||||
|
||||
<Border Margin="-8,8,-4,-4" Style="{StaticResource HorizontalStrongDivider}" />
|
||||
</StackPanel>
|
||||
|
||||
<ListView Grid.Row="1" Padding="4,2,0,2">
|
||||
<ListViewItem Content="Test" />
|
||||
<ListViewItem Content="Test" />
|
||||
<ListViewItem Content="Test" />
|
||||
<ListViewItem Content="Test" />
|
||||
<ListViewItem Content="Test" />
|
||||
<ListViewItem Content="Test" />
|
||||
</ListView>
|
||||
</Grid>
|
||||
<controls:Hierarchy />
|
||||
</Border>
|
||||
|
||||
<!-- Scene and Content -->
|
||||
<Grid Grid.Column="1">
|
||||
@@ -195,7 +140,6 @@
|
||||
Stretch="UniformToFill" />
|
||||
</Border>
|
||||
|
||||
|
||||
<!-- Content Brower -->
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
@@ -213,105 +157,12 @@
|
||||
</Grid>
|
||||
|
||||
<!-- Inspector -->
|
||||
<Grid
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="1,0,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Inspector Header -->
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Padding="12,12,8,12"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
ColumnSpacing="8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<FontIcon
|
||||
Grid.Column="0"
|
||||
FontSize="18"
|
||||
Glyph="" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
FontSize="14"
|
||||
Text="Name" />
|
||||
<DropDownButton
|
||||
Grid.Column="2"
|
||||
Padding="2"
|
||||
Style="{ThemeResource ToolbarButton}">
|
||||
<DropDownButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem Text="Send" />
|
||||
<MenuFlyoutItem Text="Reply" />
|
||||
<MenuFlyoutItem Text="Reply All" />
|
||||
</MenuFlyout>
|
||||
</DropDownButton.Flyout>
|
||||
<FontIcon FontSize="12" Glyph="" />
|
||||
</DropDownButton>
|
||||
</Grid>
|
||||
|
||||
<!-- Content -->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" MaxHeight="150" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Padding="8,2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource BodyStrongTextBlockStyle}"
|
||||
Text="Components" />
|
||||
<Button Grid.Column="1" Style="{ThemeResource ToolbarButton}">
|
||||
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||
</Button>
|
||||
<Button Grid.Column="2" Style="{ThemeResource ToolbarButton}">
|
||||
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<AutoSuggestBox
|
||||
Grid.Row="1"
|
||||
Margin="8,0"
|
||||
PlaceholderText="Search components..." />
|
||||
|
||||
<!-- Components List -->
|
||||
<ListView
|
||||
Grid.Row="2"
|
||||
Padding="4,2,0,2"
|
||||
SelectionMode="Extended">
|
||||
<TextBlock Text="Test" />
|
||||
<TextBlock Text="Test" />
|
||||
<TextBlock Text="Test" />
|
||||
</ListView>
|
||||
|
||||
<!-- Component Properties for Selected Component -->
|
||||
<ScrollView
|
||||
Grid.Row="3"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="0,1,0,0">
|
||||
<ItemsRepeater />
|
||||
</ScrollView>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<controls:Inspector />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
Reference in New Issue
Block a user