<?xml version="1.0" encoding="utf-8" ?>
<winex:WindowEx
    x:Class="Ghost.Editor.Views.Windows.EngineEditorWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ctc="using:CommunityToolkit.WinUI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="using:Ghost.Editor.Views.Windows"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:winex="using:WinUIEx"
    Title="EditorWindow"
    mc:Ignorable="d">

    <winex:WindowEx.SystemBackdrop>
        <MicaBackdrop />
    </winex:WindowEx.SystemBackdrop>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!--  Title Bar  -->
        <StackPanel
            x:Name="TitleBar"
            Grid.Row="0"
            Padding="8,0,200,0"
            BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
            BorderThickness="0,0,0,1"
            Orientation="Horizontal">
            <TextBlock
                Margin="0,0,12,0"
                VerticalAlignment="Center"
                FontFamily="Arial"
                Style="{StaticResource SubtitleTextBlockStyle}"
                Text="GHOST ENGINE" />

            <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>

            <Border Height="12" Style="{StaticResource VerticalDivider}" />

            <SelectorBar SelectionChanged="SelectorBar_SelectionChanged">
                <SelectorBarItem
                    x:Name="EditSelectorItem"
                    IsSelected="True"
                    Text="Edit" />
                <SelectorBarItem x:Name="AnalysisSelectorItem" Text="Analysis" />
                <SelectorBarItem x:Name="BuildSelectorItem" Text="Build" />
                <SelectorBarItem x:Name="SettingsSelectorItem" Text="Settings" />
            </SelectorBar>
        </StackPanel>

        <Frame
            x:Name="ContentFrame"
            Grid.Row="1"
            IsNavigationStackEnabled="False" />

        <!--  Status Bar  -->
        <Grid
            Grid.Row="2"
            Padding="8,4"
            Background="{ThemeResource SolidBackgroundFillColorSecondaryBrush}"
            BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
            BorderThickness="0,1,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Grid.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondaryBrush}" />
                    <Setter Property="FontSize" Value="12" />
                </Style>
            </Grid.Resources>

            <TextBlock Grid.Column="0" Text="Ghost Engine v1.0.0 - Test" />

            <StackPanel
                Grid.Column="2"
                Orientation="Horizontal"
                Spacing="4">
                <FontIcon FontSize="16" Glyph="&#xEEA1;" />
                <TextBlock Margin="0,0,12,0" Text="Mem: 4.0 GB" />

                <FontIcon
                    FontSize="16"
                    Foreground="{ThemeResource SystemFillColorSuccessBrush}"
                    Glyph="&#xE930;"
                    Visibility="Visible" />

                <StackPanel
                    Orientation="Horizontal"
                    Spacing="4"
                    Visibility="Collapsed">
                    <FontIcon
                        Margin="4,0,0,0"
                        VerticalAlignment="Center"
                        FontSize="16"
                        Foreground="{ThemeResource SystemFillColorAttentionBrush}"
                        Glyph="&#xE946;" />
                    <TextBlock
                        VerticalAlignment="Center"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        Text="0" />
                    <FontIcon
                        Margin="4,0,0,0"
                        VerticalAlignment="Center"
                        FontSize="16"
                        Foreground="{ThemeResource SystemFillColorCautionBrush}"
                        Glyph="&#xE7BA;" />
                    <TextBlock
                        VerticalAlignment="Center"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        Text="0" />
                    <FontIcon
                        Margin="4,0,0,0"
                        VerticalAlignment="Center"
                        FontSize="16"
                        Foreground="{ThemeResource SystemFillColorCriticalBrush}"
                        Glyph="&#xE783;" />
                    <TextBlock
                        VerticalAlignment="Center"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        Text="0" />
                </StackPanel>
            </StackPanel>
        </Grid>
    </Grid>
</winex:WindowEx>
