<?xml version="1.0" encoding="utf-8" ?>
<UserControl
    x:Class="BetterLyrics.WinUI3.Controls.LyricsBackgroundSettingsControl"
    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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:uc="using:BetterLyrics.WinUI3.Controls"
    xmlns:ui="using:CommunityToolkit.WinUI"
    mc:Ignorable="d">

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

                    <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />

                    <controls:SettingsCard x:Uid="SettingsPageTheme" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=&#xE790;}">
                        <ComboBox x:Name="ThemeComboBox" SelectedIndex="{x:Bind LyricsBackgroundSettings.LyricsBackgroundTheme, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
                            <ComboBoxItem x:Uid="SettingsPageFollowSystem" />
                            <ComboBoxItem x:Uid="SettingsPageLight" />
                            <ComboBoxItem x:Uid="SettingsPageDark" />
                        </ComboBox>
                    </controls:SettingsCard>

                    <controls:SettingsExpander
                        x:Uid="SettingsPagePureLayer"
                        HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
                                                 Glyph=&#xEB42;}"
                        IsExpanded="{x:Bind LyricsBackgroundSettings.IsPureColorOverlayEnabled, Mode=OneWay}">
                        <ToggleSwitch IsOn="{x:Bind LyricsBackgroundSettings.IsPureColorOverlayEnabled, Mode=TwoWay}" />
                        <controls:SettingsExpander.Items>

                            <controls:SettingsCard x:Uid="SettingsPageOpacity" IsEnabled="{x:Bind LyricsBackgroundSettings.IsPureColorOverlayEnabled, Mode=OneWay}">
                                <uc:ExtendedSlider
                                    Default="100"
                                    Frequency="1"
                                    Maximum="100"
                                    Minimum="0"
                                    Unit="%"
                                    Value="{x:Bind LyricsBackgroundSettings.PureColorOverlayOpacity, Mode=TwoWay}" />
                            </controls:SettingsCard>

                        </controls:SettingsExpander.Items>
                    </controls:SettingsExpander>

                    <controls:SettingsExpander
                        x:Uid="SettingsPageAlbumArtLayer"
                        HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
                                                 Glyph=&#xE93C;}"
                        IsExpanded="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
                        <ToggleSwitch IsOn="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=TwoWay}" />
                        <controls:SettingsExpander.Items>

                            <controls:SettingsCard x:Uid="SettingsPageOpacity" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
                                <uc:ExtendedSlider
                                    Default="100"
                                    Frequency="1"
                                    Maximum="100"
                                    Minimum="0"
                                    Unit="%"
                                    Value="{x:Bind LyricsBackgroundSettings.CoverOverlayOpacity, Mode=TwoWay}" />
                            </controls:SettingsCard>

                            <controls:SettingsCard x:Uid="SettingsPageSpeed" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
                                <uc:ExtendedSlider
                                    Default="50"
                                    Frequency="1"
                                    Maximum="100"
                                    Minimum="0"
                                    Unit="%"
                                    Value="{x:Bind LyricsBackgroundSettings.CoverOverlaySpeed, Mode=TwoWay}" />
                            </controls:SettingsCard>

                            <controls:SettingsCard x:Uid="SettingsPageBlurAmount" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
                                <uc:ExtendedSlider
                                    Default="100"
                                    Frequency="1"
                                    Maximum="100"
                                    Minimum="0"
                                    Value="{x:Bind LyricsBackgroundSettings.CoverOverlayBlurAmount, Mode=TwoWay}" />
                            </controls:SettingsCard>

                            <controls:SettingsCard x:Uid="SettingsPageBackgroundAcrylicEffectAmount" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
                                <uc:ExtendedSlider
                                    Default="0"
                                    Frequency="1"
                                    Maximum="10"
                                    Minimum="0"
                                    Value="{x:Bind LyricsBackgroundSettings.CoverAcrylicEffectAmount, Mode=TwoWay}" />
                            </controls:SettingsCard>

                        </controls:SettingsExpander.Items>
                    </controls:SettingsExpander>

                    <controls:SettingsExpander
                        x:Uid="SettingsPageFluidLayer"
                        HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
                                                 Glyph=&#xEDA8;}"
                        IsExpanded="{x:Bind LyricsBackgroundSettings.IsFluidOverlayEnabled, Mode=OneWay}">
                        <ToggleSwitch IsOn="{x:Bind LyricsBackgroundSettings.IsFluidOverlayEnabled, Mode=TwoWay}" />
                        <controls:SettingsExpander.Items>

                            <controls:SettingsCard x:Uid="SettingsPageOpacity" IsEnabled="{x:Bind LyricsBackgroundSettings.IsFluidOverlayEnabled, Mode=OneWay}">
                                <uc:ExtendedSlider
                                    Default="100"
                                    Frequency="1"
                                    Maximum="100"
                                    Minimum="0"
                                    Unit="%"
                                    Value="{x:Bind LyricsBackgroundSettings.FluidOverlayOpacity, Mode=TwoWay}" />
                            </controls:SettingsCard>

                        </controls:SettingsExpander.Items>
                    </controls:SettingsExpander>

                    <controls:SettingsExpander
                        x:Uid="SettingsPageSpectrumLayer"
                        HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
                                                 Glyph=&#xF61F;}"
                        IsExpanded="{x:Bind LyricsBackgroundSettings.IsSpectrumOverlayEnabled, Mode=OneWay}">
                        <ToggleSwitch IsOn="{x:Bind LyricsBackgroundSettings.IsSpectrumOverlayEnabled, Mode=TwoWay}" />
                    </controls:SettingsExpander>

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