<?xml version="1.0" encoding="utf-8" ?>
<Window
    x:Class="BetterLyrics.WinUI3.Views.LyricsWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:behaviors="using:CommunityToolkit.WinUI.Behaviors"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="using:BetterLyrics.WinUI3.Views"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:media="using:CommunityToolkit.WinUI.Media"
    xmlns:scontrols="using:ShadowViewer.Controls"
    xmlns:uc="using:BetterLyrics.WinUI3.Controls"
    xmlns:ui="using:CommunityToolkit.WinUI"
    mc:Ignorable="d">

    <Grid x:Name="RootGrid" RequestedTheme="{x:Bind ViewModel.ThemeType, Mode=OneWay}">
        <Grid
            x:Name="PlaceholderGrid"
            Width="1"
            Height="1"
            HorizontalAlignment="Left"
            VerticalAlignment="Top" />

        <local:LyricsPage />

        <!--  Top command  -->
        <Grid
            x:Name="TopCommandGrid"
            Margin="6"
            VerticalAlignment="Top"
            Background="Transparent"
            Opacity="{x:Bind ViewModel.TopCommandGridOpacity, Mode=OneWay}"
            PointerEntered="TopCommandGrid_PointerEntered"
            PointerExited="TopCommandGrid_PointerExited">
            <Grid.OpacityTransition>
                <ScalarTransition />
            </Grid.OpacityTransition>

            <Grid Padding="3" HorizontalAlignment="Left">
                <StackPanel
                    x:Name="TopLeftCommandStackPanel"
                    HorizontalAlignment="Left"
                    Orientation="Horizontal"
                    Spacing="3">
                    <StackPanel.OpacityTransition>
                        <ScalarTransition />
                    </StackPanel.OpacityTransition>

                    <!--  More  -->
                    <Button Click="MusicGalleryButton_Click" Style="{StaticResource TitleBarButtonStyle}">
                        <FontIcon
                            FontFamily="{StaticResource IconFontFamily}"
                            FontSize="{x:Bind ViewModel.TitleBarFontSize, Mode=OneWay}"
                            Glyph="&#xE8F1;" />
                        <ToolTipService.ToolTip>
                            <ToolTip x:Uid="HostWindowMusicGalleryButtonToolTip" />
                        </ToolTipService.ToolTip>
                    </Button>
                    <!--  Immersive mode  -->
                    <ToggleButton
                        x:Name="ImmersiveButton"
                        Command="{x:Bind ViewModel.ImmersiveToggleButtonEnabledChangedCommand}"
                        IsChecked="{x:Bind ViewModel.IsImmersiveMode, Mode=TwoWay}"
                        Style="{StaticResource TitleBarToggleButtonStyle}">
                        <ToolTipService.ToolTip>
                            <ToolTip x:Uid="LyricsWindowImmersiveButtonToolTip" />
                        </ToolTipService.ToolTip>
                        <FontIcon
                            FontFamily="{StaticResource IconFontFamily}"
                            FontSize="{x:Bind ViewModel.TitleBarFontSize}"
                            Glyph="&#xED1A;" />
                    </ToggleButton>

                </StackPanel>
            </Grid>

            <Grid Padding="3" HorizontalAlignment="Right">
                <StackPanel
                    x:Name="TopRightCommandStackPanel"
                    Orientation="Horizontal"
                    Spacing="3">
                    <StackPanel.OpacityTransition>
                        <ScalarTransition />
                    </StackPanel.OpacityTransition>

                    <!--  Window Close  -->
                    <Button
                        x:Name="CloseButton"
                        Click="CloseButton_Click"
                        Style="{StaticResource TitleBarButtonStyle}"
                        Visibility="{x:Bind ViewModel.CloseButtonVisibility, Mode=OneWay}">
                        <FontIcon
                            FontFamily="{StaticResource IconFontFamily}"
                            FontSize="{x:Bind ViewModel.TitleBarFontSize, Mode=OneWay}"
                            Glyph="&#xE653;" />
                    </Button>

                </StackPanel>
            </Grid>

        </Grid>

        <scontrols:NotificationPanel
            x:Name="TipContainerCenter"
            Margin="0,0,0,52"
            HorizontalAlignment="Center"
            VerticalAlignment="Bottom"
            Canvas.ZIndex="1"
            FlowDirection="RightToLeft"
            Loaded="TipContainerCenter_Loaded"
            Orientation="Vertical"
            Visibility="Collapsed" />

    </Grid>
</Window>
