feat: Implement LogViewer control and integrate into EditPage
- Added LogViewer control to display log messages with filtering options. - Integrated LogViewer into EditPage for better log management. - Updated EngineEditorWindow to navigate to EditPage. - Enhanced Logger implementation for improved performance and stack trace capturing. - Introduced PathUtility for path normalization. - Refactored AssetManager to correct shader asset type naming. - Removed obsolete AssetHandlerRegistryTests and cleaned up related tests. - Updated ImportCoordinatorTests for streamlined asset import process.
This commit is contained in:
288
src/Editor/Ghost.Editor/Views/Pages/EditPage.xaml
Normal file
288
src/Editor/Ghost.Editor/Views/Pages/EditPage.xaml
Normal file
@@ -0,0 +1,288 @@
|
||||
<Page
|
||||
x:Class="Ghost.Editor.Views.Pages.EditPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:Ghost.Editor.Views.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Background="{ThemeResource LayerFillColorDefaultBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Toolbar -->
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Padding="8,0"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource ControlElevationBorderBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
Orientation="Horizontal">
|
||||
<ComboBox
|
||||
Width="200"
|
||||
VerticalAlignment="Center"
|
||||
SelectedIndex="0">
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||
<TextBlock Text="Selection Mode" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||
<TextBlock Text="Placement Mode" />
|
||||
</StackPanel>
|
||||
</ComboBox>
|
||||
|
||||
<Border Height="12" Style="{StaticResource VerticalDivider}" />
|
||||
|
||||
<MenuBar>
|
||||
<MenuBarItem Title="File">
|
||||
<MenuFlyoutItem Text="New" />
|
||||
<MenuFlyoutItem Text="Open..." />
|
||||
<MenuFlyoutItem Text="Save" />
|
||||
<MenuFlyoutItem Text="Exit" />
|
||||
</MenuBarItem>
|
||||
|
||||
<MenuBarItem Title="Edit">
|
||||
<MenuFlyoutItem Text="Undo" />
|
||||
<MenuFlyoutItem Text="Cut" />
|
||||
<MenuFlyoutItem Text="Copy" />
|
||||
<MenuFlyoutItem Text="Paste" />
|
||||
</MenuBarItem>
|
||||
|
||||
<MenuBarItem Title="Help">
|
||||
<MenuFlyoutItem Text="About" />
|
||||
</MenuBarItem>
|
||||
</MenuBar>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.25*" MaxWidth="350" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="0.25*" MaxWidth="350" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Hierarchy -->
|
||||
<Grid
|
||||
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>
|
||||
|
||||
<!-- Scene and Content -->
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="0.3*" MaxHeight="350" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Scene Toolbar -->
|
||||
<StackPanel
|
||||
Padding="2"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
Orientation="Horizontal">
|
||||
<Button Style="{ThemeResource ToolbarButton}">
|
||||
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||
</Button>
|
||||
<Button Style="{ThemeResource ToolbarButton}">
|
||||
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||
</Button>
|
||||
<Button Style="{ThemeResource ToolbarButton}">
|
||||
<FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Scene -->
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="0,0,0,1">
|
||||
<Image
|
||||
VerticalAlignment="Center"
|
||||
Source="C:/Users/Misaki/OneDrive/Pictures/Screenshots/Screenshot 2023-11-28 000914.png"
|
||||
Stretch="UniformToFill" />
|
||||
</Border>
|
||||
|
||||
|
||||
<!-- Content Brower -->
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{ThemeResource CircleElevationBorderBrush}"
|
||||
BorderThickness="0,0,0,1">
|
||||
<SelectorBar SelectionChanged="SelectorBar_SelectionChanged">
|
||||
<SelectorBarItem IsSelected="True" Text="Project" />
|
||||
<SelectorBarItem Text="Console" />
|
||||
<SelectorBarItem Text="Log" />
|
||||
</SelectorBar>
|
||||
</Border>
|
||||
|
||||
<ContentPresenter x:Name="ContentBrowserPresenter" Grid.Row="3" />
|
||||
</Grid>
|
||||
|
||||
<!-- Inspector -->
|
||||
<Grid
|
||||
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>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Page>
|
||||
37
src/Editor/Ghost.Editor/Views/Pages/EditPage.xaml.cs
Normal file
37
src/Editor/Ghost.Editor/Views/Pages/EditPage.xaml.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Ghost.Editor.Views.Controls;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Ghost.Editor.Views.Pages;
|
||||
|
||||
public sealed partial class EditPage : Page
|
||||
{
|
||||
private readonly ContentBrowser _contentBrowser;
|
||||
private readonly LogViewer _logViewer;
|
||||
|
||||
public EditPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_contentBrowser = new ContentBrowser();
|
||||
_logViewer = new LogViewer();
|
||||
|
||||
ContentBrowserPresenter.Content = _contentBrowser;
|
||||
}
|
||||
|
||||
private void SelectorBar_SelectionChanged(SelectorBar sender, SelectorBarSelectionChangedEventArgs args)
|
||||
{
|
||||
var selectedItem = sender.SelectedItem;
|
||||
var currentSelectedIndex = sender.Items.IndexOf(selectedItem);
|
||||
switch (currentSelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
ContentBrowserPresenter.Content = _contentBrowser;
|
||||
break;
|
||||
case 2:
|
||||
ContentBrowserPresenter.Content = _logViewer;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user