<ui:Page xmlns:props="clr-namespace:Ink_Canvas.Properties" x:Class="Ink_Canvas.Windows.SettingsViews.Pages.SidebarPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews.Pages"
      xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
      xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
      xmlns:sys="clr-namespace:System;assembly=mscorlib"
      xmlns:controls="clr-namespace:Ink_Canvas.Controls;assembly=InkCanvas.Controls"
      mc:Ignorable="d"
      Title="{x:Static props:ThemeStrings.Theme_SidebarGroupTitle}">

    <ScrollViewer PanningMode="VerticalFirst">
        <Grid Margin="59,0,59,0">
            <FrameworkElement.Resources>
                <sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
                <Style x:Key="SettingsSectionHeaderTextBlockStyle"
                    BasedOn="{StaticResource BodyStrongTextBlockStyle}"
                    TargetType="TextBlock">
                    <Style.Setters>
                        <Setter Property="Margin" Value="1,30,0,6" />
                    </Style.Setters>
                </Style>
            </FrameworkElement.Resources>
            <Grid>
                <ikw:SimpleStackPanel MaxWidth="1000"
                    HorizontalAlignment="Stretch"
                    Spacing="{StaticResource SettingsCardSpacing}">

                    <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
                        Text="{x:Static props:ThemeStrings.Theme_SidebarGroupTitle}" />

                    <ui:SettingsExpander Header="{x:Static props:ThemeStrings.Theme_EnableQuickPanel}"
                            IsExpanded="{Binding IsOn, ElementName=ToggleSwitchEnableQuickPanel, Mode=OneWay}">
                        <ui:SettingsExpander.HeaderIcon>
                            <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Pinned}" />
                        </ui:SettingsExpander.HeaderIcon>
                        <ui:ToggleSwitch x:Name="ToggleSwitchEnableQuickPanel" d:IsOn="True"
                                        Toggled="ToggleSwitchEnableQuickPanel_Toggled" />
                        <ui:SettingsExpander.Items>
                            <ui:SettingsCard Header="{x:Static props:ThemeStrings.Theme_QuickPanelBottomOffset}"
                                    Description="{x:Static props:ThemeStrings.Theme_QuickPanelBottomOffset_Description}">
                                <ui:SettingsCard.HeaderIcon>
                                    <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.ChevronDown}" />
                                </ui:SettingsCard.HeaderIcon>
                                <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                                    <TextBlock x:Name="QuickPanelBottomOffsetText"
                                               VerticalAlignment="Center" FontFamily="Consolas" TextAlignment="Right"/>
                                    <Slider x:Name="QuickPanelBottomOffsetSlider" Minimum="-600"
                                            Maximum="600" Width="200"
                                            IsSnapToTickEnabled="True" Value="-150" TickFrequency="10"
                                            TickPlacement="None" AutoToolTipPlacement="None"
                                            ValueChanged="QuickPanelBottomOffsetSlider_ValueChanged" />
                                </ikw:SimpleStackPanel>
                            </ui:SettingsCard>

                            <ui:SettingsCard Header="{x:Static props:ThemeStrings.Theme_AllowDragSidePanel}">
                                <ui:SettingsCard.HeaderIcon>
                                    <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Touch}" />
                                </ui:SettingsCard.HeaderIcon>
                                <ui:ToggleSwitch x:Name="ToggleSwitchAllowDragSidePanel"
                                                Toggled="ToggleSwitchAllowDragSidePanel_Toggled" />
                            </ui:SettingsCard>

                            <ui:SettingsCard Header="{x:Static props:ThemeStrings.Theme_UnfoldButtonIcon}">
                                <ui:SettingsCard.HeaderIcon>
                                    <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.ChevronRight}" />
                                </ui:SettingsCard.HeaderIcon>
                                <ComboBox x:Name="ComboBoxUnFoldBtnImg"
                                          SelectedIndex="0"
                                          SelectionChanged="ComboBoxUnFoldBtnImg_SelectionChanged">
                                    <ComboBoxItem Content="{x:Static props:ThemeStrings.Theme_UnfoldIcon_ClassicArrow}" />
                                    <ComboBoxItem Content="{x:Static props:ThemeStrings.Theme_UnfoldIcon_ClassicPen}" />
                                    <ComboBoxItem Content="{x:Static props:ThemeStrings.Theme_UnfoldIcon_Stripe}" />
                                </ComboBox>
                            </ui:SettingsCard>

                            <ui:SettingsCard Header="{x:Static props:ThemeStrings.Theme_QuickPanelOpacity}">
                                <ui:SettingsCard.HeaderIcon>
                                    <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.View}" />
                                </ui:SettingsCard.HeaderIcon>
                                <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                                    <TextBlock x:Name="QuickPanelOpacityText"
                                               VerticalAlignment="Center" FontFamily="Consolas" TextAlignment="Right"/>
                                    <Slider x:Name="QuickPanelOpacitySlider" Minimum="0.1"
                                            Maximum="1.0" Width="200"
                                            IsSnapToTickEnabled="True" Value="1.0" TickFrequency="0.1"
                                            TickPlacement="None" AutoToolTipPlacement="None"
                                            ValueChanged="QuickPanelOpacitySlider_ValueChanged" />
                                </ikw:SimpleStackPanel>
                            </ui:SettingsCard>
                        </ui:SettingsExpander.Items>
                    </ui:SettingsExpander>

                    <ui:SettingsExpander Header="{x:Static props:ThemeStrings.Theme_AutoCollapseQuickPanel}"
                            IsExpanded="{Binding IsOn, ElementName=ToggleSwitchAutoCollapseQuickPanel, Mode=OneWay}">
                        <ui:SettingsExpander.HeaderIcon>
                            <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.ChevronDown}" />
                        </ui:SettingsExpander.HeaderIcon>
                        <ui:ToggleSwitch x:Name="ToggleSwitchAutoCollapseQuickPanel" d:IsOn="True"
                                        Toggled="ToggleSwitchAutoCollapseQuickPanel_Toggled" />
                        <ui:SettingsExpander.Items>
                            <ui:SettingsCard Header="{x:Static props:ThemeStrings.Theme_AutoCollapseQuickPanelDelay}">
                                <ui:SettingsCard.HeaderIcon>
                                    <ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.History}" />
                                </ui:SettingsCard.HeaderIcon>
                                <ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8">
                                    <TextBlock x:Name="AutoCollapseDelayText"
                                               VerticalAlignment="Center" FontFamily="Consolas" TextAlignment="Right"/>
                                    <Slider x:Name="AutoCollapseDelaySlider" Minimum="1"
                                            Maximum="10" Width="200"
                                            IsSnapToTickEnabled="True" Value="3.0" TickFrequency="1"
                                            TickPlacement="None" AutoToolTipPlacement="None"
                                            ValueChanged="AutoCollapseDelaySlider_ValueChanged" />
                                </ikw:SimpleStackPanel>
                            </ui:SettingsCard>
                        </ui:SettingsExpander.Items>
                    </ui:SettingsExpander>

                    <Rectangle Height="48" />
                </ikw:SimpleStackPanel>
            </Grid>
        </Grid>
    </ScrollViewer>
</ui:Page>
