<Page
    x:Class="Microsoft.PowerToys.QuickAccess.Flyout.LaunchPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:animatedVisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"
    xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls"
    xmlns:tkconverters="using:CommunityToolkit.WinUI.Converters"
    xmlns:ui="using:CommunityToolkit.WinUI"
    xmlns:viewModels="using:Microsoft.PowerToys.QuickAccess.ViewModels"
    mc:Ignorable="d">
    <Page.Resources>
        <Style
            x:Key="FlyoutButtonStyle"
            BasedOn="{StaticResource SubtleButtonStyle}"
            TargetType="Button">
            <Setter Property="Padding" Value="6" />
            <Setter Property="Width" Value="32" />
            <Setter Property="Height" Value="32" />
            <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
        </Style>
    </Page.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="48" />
        </Grid.RowDefinitions>
        <Grid
            Background="{ThemeResource LayerOnAcrylicFillColorDefaultBrush}"
            BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
            BorderThickness="0,0,0,1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Grid Padding="36,32,36,0">
                <TextBlock
                    x:Uid="QuickAccessTxt"
                    VerticalAlignment="Center"
                    Style="{StaticResource BodyStrongTextBlockStyle}" />
                <Button
                    x:Uid="MoreBtn"
                    Padding="8,4,8,4"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Center"
                    Click="AllAppButton_Click">
                    <Button.Content>
                        <StackPanel
                            VerticalAlignment="Center"
                            Orientation="Horizontal"
                            Spacing="12">
                            <TextBlock x:Uid="MoreLabel" Style="{StaticResource CaptionTextBlockStyle}" />
                            <FontIcon
                                Margin="0,2,0,0"
                                FontSize="12"
                                Glyph="&#xe76c;" />
                        </StackPanel>
                    </Button.Content>
                </Button>
            </Grid>
            <Grid Grid.Row="1">
                <ScrollViewer>
                    <controls:QuickAccessList
                        Margin="12,26,12,24"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Top"
                        ItemsSource="{x:Bind ViewModel.FlyoutMenuItems}"
                        TabNavigation="Local" />
                </ScrollViewer>
            </Grid>
        </Grid>
        <Grid Grid.Row="2">
            <InfoBar
                x:Uid="UpdateAvailableInfoBar"
                IsClosable="False"
                IsOpen="{x:Bind ViewModel.IsUpdateAvailable, Mode=OneWay}"
                Severity="Warning"
                Tapped="UpdateInfoBar_Tapped" />

            <StackPanel
                Grid.Row="1"
                Margin="0,0,12,0"
                HorizontalAlignment="Right"
                Orientation="Horizontal"
                Spacing="8">
                <Button
                    x:Name="DocsBtn"
                    x:Uid="DocsBtn"
                    Click="DocsBtn_Click"
                    Content="{ui:FontIcon Glyph=&#xE8A5;,
                                          FontSize=16}"
                    Style="{StaticResource FlyoutButtonStyle}">
                    <ToolTipService.ToolTip>
                        <TextBlock x:Uid="DocsTooltip" />
                    </ToolTipService.ToolTip>
                </Button>
                <Button
                    x:Name="ReportBugBtn"
                    x:Uid="BugReportBtn"
                    Click="ReportBugBtn_Click"
                    Content="{ui:FontIcon Glyph=&#xebe8;,
                                          FontSize=16}"
                    Style="{StaticResource FlyoutButtonStyle}">
                    <ToolTipService.ToolTip>
                        <TextBlock x:Uid="BugReportTooltip" />
                    </ToolTipService.ToolTip>
                </Button>
                <Button
                    x:Name="SettingsBtn"
                    x:Uid="SettingsBtn"
                    Click="SettingsBtn_Click"
                    Style="{StaticResource FlyoutButtonStyle}">
                    <ToolTipService.ToolTip>
                        <TextBlock x:Uid="SettingsTooltip" />
                    </ToolTipService.ToolTip>
                    <AnimatedIcon x:Name="SettingsAnimatedIcon">
                        <AnimatedIcon.Source>
                            <animatedVisuals:AnimatedSettingsVisualSource />
                        </AnimatedIcon.Source>
                        <AnimatedIcon.FallbackIconSource>
                            <SymbolIconSource Symbol="Setting" />
                        </AnimatedIcon.FallbackIconSource>
                    </AnimatedIcon>
                </Button>
            </StackPanel>
        </Grid>
    </Grid>
</Page>
