<?xml version="1.0" encoding="utf-8" ?>
<UserControl
    x:Class="BetterLyrics.WinUI3.Controls.AlbumArtLayoutSettingsControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:CommunityToolkit.WinUI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="using:BetterLyrics.WinUI3.Controls"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ui="using:CommunityToolkit.WinUI"
    mc:Ignorable="d">

    <Grid>
        <ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
            <Grid Style="{StaticResource SettingsGridStyle}">
                <StackPanel Spacing="{StaticResource SettingsCardSpacing}">

                    <TextBlock x:Uid="SettingsPageAlbumArt" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />

                    <controls:SettingsExpander
                        x:Uid="SettingsPageAlbumArtSize"
                        HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
                                                 Glyph=&#xE744;}"
                        IsExpanded="True">
                        <controls:SettingsExpander.Items>
                            <controls:SettingsCard x:Uid="SettingsPageAutoSize">
                                <ToggleSwitch IsOn="{x:Bind AlbumArtLayoutSettings.AutoAlbumArtSize, Mode=TwoWay}" />
                            </controls:SettingsCard>
                            <controls:SettingsCard IsEnabled="{x:Bind AlbumArtLayoutSettings.AutoAlbumArtSize, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}">
                                <local:ExtendedSlider
                                    Frequency="2"
                                    Maximum="800"
                                    Minimum="10"
                                    ResetButtonVisibility="Collapsed"
                                    Unit="px"
                                    Value="{x:Bind AlbumArtLayoutSettings.AlbumArtSize, Mode=TwoWay}" />
                            </controls:SettingsCard>
                        </controls:SettingsExpander.Items>
                    </controls:SettingsExpander>

                    <controls:SettingsCard x:Uid="SettingsPageAlbumRadius" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=&#xEA3A;}">
                        <local:ExtendedSlider
                            Default="12"
                            Frequency="1"
                            Maximum="100"
                            Minimum="0"
                            Unit="%"
                            Value="{x:Bind AlbumArtLayoutSettings.CoverImageRadius, Mode=TwoWay}" />
                    </controls:SettingsCard>

                    <controls:SettingsCard x:Uid="SettingsPageAlbumShadowAmount" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=&#xF5EF;}">
                        <local:ExtendedSlider
                            Default="12"
                            Frequency="1"
                            Maximum="64"
                            Minimum="0"
                            Value="{x:Bind AlbumArtLayoutSettings.CoverImageShadowAmount, Mode=TwoWay}" />
                    </controls:SettingsCard>

                    <TextBlock x:Uid="SettingsPageSongInfo" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />

                    <controls:SettingsCard x:Uid="SettingsPageSongInfoAlignment" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=&#xE8E3;}">
                        <ComboBox SelectedIndex="{x:Bind AlbumArtLayoutSettings.SongInfoAlignmentType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
                            <ComboBoxItem x:Uid="SettingsPageSongInfoLeft" />
                            <ComboBoxItem x:Uid="SettingsPageSongInfoCenter" />
                            <ComboBoxItem x:Uid="SettingsPageSongInfoRight" />
                        </ComboBox>
                    </controls:SettingsCard>

                    <controls:SettingsCard x:Uid="SettingsPageLyricsFontSize" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=&#xE8E9;}">
                        <local:ExtendedSlider
                            Default="18"
                            Frequency="2"
                            Maximum="72"
                            Minimum="8"
                            Value="{x:Bind AlbumArtLayoutSettings.SongInfoFontSize, Mode=TwoWay}" />
                    </controls:SettingsCard>

                    <controls:SettingsExpander
                        x:Uid="SettingsPageShowTitle"
                        HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
                                                 Glyph=&#xEF3D;}"
                        IsExpanded="True">
                        <ToggleSwitch IsOn="{x:Bind AlbumArtLayoutSettings.ShowTitle, Mode=TwoWay}" />
                        <controls:SettingsExpander.Items>
                            <controls:SettingsCard x:Uid="SettingsPageShowArtists">
                                <ToggleSwitch IsEnabled="{x:Bind AlbumArtLayoutSettings.ShowTitle, Mode=OneWay}" IsOn="{x:Bind AlbumArtLayoutSettings.ShowArtists, Mode=TwoWay}" />
                            </controls:SettingsCard>
                        </controls:SettingsExpander.Items>
                    </controls:SettingsExpander>

                </StackPanel>
            </Grid>
        </ScrollViewer>
    </Grid>
</UserControl>
