<commit_before>﻿<UserControl x:Class="Espera.View.Views.SettingsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
             xmlns:ViewModels="clr-namespace:Espera.View.ViewModels"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             d:DataContext="{d:DesignInstance ViewModels:DesignTimeSettingsViewModel,
                                              IsDesignTimeCreatable=True}"
             d:DesignHeight="600"
             d:DesignWidth="800"
             mc:Ignorable="d">
    <UserControl.Resources>
        <ResourceDictionary>
            <Style x:Key="ColorPickerButtonStyle" TargetType="{x:Type Button}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Border Width="150"
                                    Height="150"
                                    Margin="0, 0, 20, 20"
                                    Background="{TemplateBinding Background}">
                                <ContentPresenter />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Opacity" Value="0.8" />
                    </Trigger>
                    <Trigger Property="IsPressed" Value="True">
                        <Setter Property="Opacity" Value="0.6" />
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="SettingsHeaderStyle" TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="64" />
                <Setter Property="FontFamily" Value="{DynamicResource HeaderFontFamily}" />
                <!--  For some reason the foreground has to be set manually, otherwise it would be black.  -->
                <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
            </Style>
            <Style BasedOn="{StaticResource {x:Type Controls:ToggleSwitch}}" TargetType="{x:Type Controls:ToggleSwitch}">
                <Setter Property="Margin" Value="0, 10, 0, 0" />
                <Setter Property="OnLabel" Value="Yes" />
                <Setter Property="OffLabel" Value="No" />
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <TabControl Padding="15, 0, 15, 0">
            <TabItem Header="appearance">
                <StackPanel>
                    <TextBlock Style="{StaticResource SettingsHeaderStyle}" Text="accent color" />
                    <StackPanel Margin="0, 10, 0, 0"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Top">
                        <StackPanel Orientation="Horizontal">
                            <Button Background="#FF1C739D"
                                    Command="{Binding Path=ChangeAccentColorCommand}"
                                    CommandParameter="Blue"
                                    Style="{StaticResource ColorPickerButtonStyle}" />
                            <Button Background="#CC48CB00"
                                    Command="{Binding Path=ChangeAccentColorCommand}"
                                    CommandParameter="Green"
                                    Style="{StaticResource ColorPickerButtonStyle}" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Button Background="#CCB400FF"
                                    Command="{Binding Path=ChangeAccentColorCommand}"
                                    CommandParameter="Purple"
                                    Style="{StaticResource ColorPickerButtonStyle}" />
                            <Button Background="#CCCB0000"
                                    Command="{Binding Path=ChangeAccentColorCommand}"
                                    CommandParameter="Red"
                                    Style="{StaticResource ColorPickerButtonStyle}" />
                        </StackPanel>
                        <Button HorizontalAlignment="Left"
                                Background="#FFDE872A"
                                Command="{Binding Path=ChangeAccentColorCommand}"
                                CommandParameter="Orange"
                                Style="{StaticResource ColorPickerButtonStyle}" />
                    </StackPanel>
                </StackPanel>
            </TabItem>
            <TabItem Header="party mode">
                <StackPanel>
                    <Controls:ToggleSwitch Header="Lock play/pause" IsChecked="{Binding Path=LockPlayPause}" />
                    <Controls:ToggleSwitch Header="Lock volume" IsChecked="{Binding Path=LockVolume}" />
                    <Controls:ToggleSwitch Header="Lock time" IsChecked="{Binding Path=LockTime}" />
                    <Controls:ToggleSwitch Header="Lock playlist switching" IsChecked="{Binding Path=LockPlaylistSwitching}" />
                    <Controls:ToggleSwitch Header="Lock song removal from playlist" IsChecked="{Binding Path=LockPlaylistRemoval}" />
                    <Controls:ToggleSwitch Header="Lock song removal from library" IsChecked="{Binding Path=LockLibraryRemoval}" />
                    <Controls:ToggleSwitch Header="Enable timeout when adding songs to the playlist" IsChecked="{Binding Path=EnablePlaylistTimeout}" />
                    <StackPanel Margin="30, 5, 0, 0"
                                IsEnabled="{Binding Path=EnablePlaylistTimeout}"
                                Orientation="Horizontal">
                        <TextBlock VerticalAlignment="Center" Text="Timeout:" />
                        <TextBox Width="30"
                                 Margin="5, 0, 0, 0"
                                 VerticalAlignment="Center"
                                 VerticalContentAlignment="Center"
                                 Text="{Binding Path=PlaylistTimeout}" />
                        <TextBlock Margin="5, 0, 0, 0"
                                   VerticalAlignment="Center"
                                   Text="Seconds" />
                    </StackPanel>
                    <Controls:ToggleSwitch Header="Lock window (minimize, maximize, close)" IsChecked="{Binding Path=LockWindow}" />
                    <Controls:ToggleSwitch Margin="30, 0, 0, 0"
                                           Header="Make window fullscreen"<commit_msg>Prevent initial focus on the textbox<commit_after>﻿<UserControl x:Class="Espera.View.Views.SettingsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
             xmlns:ViewModels="clr-namespace:Espera.View.ViewModels"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             d:DataContext="{d:DesignInstance ViewModels:DesignTimeSettingsViewModel,
                                              IsDesignTimeCreatable=True}"
             d:DesignHeight="600"
             d:DesignWidth="800"
             mc:Ignorable="d">
    <UserControl.Resources>
        <ResourceDictionary>
            <Style x:Key="ColorPickerButtonStyle" TargetType="{x:Type Button}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Border Width="150"
                                    Height="150"
                                    Margin="0, 0, 20, 20"
                                    Background="{TemplateBinding Background}">
                                <ContentPresenter />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Opacity" Value="0.8" />
                    </Trigger>
                    <Trigger Property="IsPressed" Value="True">
                        <Setter Property="Opacity" Value="0.6" />
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="SettingsHeaderStyle" TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="64" />
                <Setter Property="FontFamily" Value="{DynamicResource HeaderFontFamily}" />
                <!--  For some reason the foreground has to be set manually, otherwise it would be black.  -->
                <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
            </Style>
            <Style BasedOn="{StaticResource {x:Type Controls:ToggleSwitch}}" TargetType="{x:Type Controls:ToggleSwitch}">
                <Setter Property="Margin" Value="0, 10, 0, 0" />
                <Setter Property="OnLabel" Value="Yes" />
                <Setter Property="OffLabel" Value="No" />
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <TabControl Padding="15, 0, 15, 0">
            <TabItem Header="appearance">
                <StackPanel>
                    <TextBlock Style="{StaticResource SettingsHeaderStyle}" Text="accent color" />
                    <StackPanel Margin="0, 10, 0, 0"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Top">
                        <StackPanel Orientation="Horizontal">
                            <Button Background="#FF1C739D"
                                    Command="{Binding Path=ChangeAccentColorCommand}"
                                    CommandParameter="Blue"
                                    Style="{StaticResource ColorPickerButtonStyle}" />
                            <Button Background="#CC48CB00"
                                    Command="{Binding Path=ChangeAccentColorCommand}"
                                    CommandParameter="Green"
                                    Style="{StaticResource ColorPickerButtonStyle}" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Button Background="#CCB400FF"
                                    Command="{Binding Path=ChangeAccentColorCommand}"
                                    CommandParameter="Purple"
                                    Style="{StaticResource ColorPickerButtonStyle}" />
                            <Button Background="#CCCB0000"
                                    Command="{Binding Path=ChangeAccentColorCommand}"
                                    CommandParameter="Red"
                                    Style="{StaticResource ColorPickerButtonStyle}" />
                        </StackPanel>
                        <Button HorizontalAlignment="Left"
                                Background="#FFDE872A"
                                Command="{Binding Path=ChangeAccentColorCommand}"
                                CommandParameter="Orange"
                                Style="{StaticResource ColorPickerButtonStyle}" />
                    </StackPanel>
                </StackPanel>
            </TabItem>
            <TabItem Header="party mode">
                <StackPanel>
                    <Controls:ToggleSwitch Header="Lock play/pause" IsChecked="{Binding Path=LockPlayPause}" />
                    <Controls:ToggleSwitch Header="Lock volume" IsChecked="{Binding Path=LockVolume}" />
                    <Controls:ToggleSwitch Header="Lock time" IsChecked="{Binding Path=LockTime}" />
                    <Controls:ToggleSwitch Header="Lock playlist switching" IsChecked="{Binding Path=LockPlaylistSwitching}" />
                    <Controls:ToggleSwitch Header="Lock song removal from playlist" IsChecked="{Binding Path=LockPlaylistRemoval}" />
                    <Controls:ToggleSwitch Header="Lock song removal from library" IsChecked="{Binding Path=LockLibraryRemoval}" />
                    <Controls:ToggleSwitch Header="Enable timeout when adding songs to the playlist" IsChecked="{Binding Path=EnablePlaylistTimeout}" />
                    <StackPanel Margin="30, 5, 0, 0"
                                IsEnabled="{Binding Path=EnablePlaylistTimeout}"
                                Orientation="Horizontal">
                        <TextBlock VerticalAlignment="Center" Text="Timeout:" />
                        <TextBox Width="30"
                                 Margin="5, 0, 0, 0"
                                 VerticalAlignment="Center"
                                 VerticalContentAlignment="Center"
                                 Text="{Binding Path=PlaylistTimeout}"
                                 IsTabStop="False" />
                        <TextBlock Margin="5, 0, 0, 0"
                                   VerticalAlignment="Center"
                                   Text="Seconds" />
                    </StackPanel>
                    <Controls:ToggleSwitch Header="Lock window (minimize, maximize, close)" IsChecked="{Binding Path=LockWindow}" />
                    <Controls:ToggleSwitch Margin="30, 0, 0, 0"
                                           Header="Make window fullscreen"
{'fraction_non_alphanumeric': 0.10117765331035473, 'fraction_numerical': 0.01349992819187132, 'mean_word_length': 1.409515570934256, 'pattern_counts': {'":': 0, '<': 141, '<?xml version=': 0, '>': 139, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 51, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4141004', 'n_tokens_mistral': 3295, 'n_tokens_neox': 2884, 'n_words': 547}