<commit_before>﻿<UserControl x:Class="MiniPie.Views.ShellView"
             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" 
             wpf:ResxExtension.DefaultResxName="MiniPie.Properties.Resources"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
             xmlns:im="clr-namespace:Microsoft.Expression.Interactivity.Media;assembly=Microsoft.Expression.Interactions"
             xmlns:interactivity="clr-namespace:MiniPie.Interactivity"
             xmlns:controls="clr-namespace:MiniPie.Controls"
             xmlns:wpf="clr-namespace:Infralution.Localization.Wpf"
             xmlns:cal="http://www.caliburnproject.org"
             xmlns:circularProgressButton="clr-namespace:MiniPie.Converter.CircularProgressButton"
             xmlns:circularProgressButton1="clr-namespace:MiniPie.Controls.CircularProgressButton"
             mc:Ignorable="d" 
             MinHeight="{Binding ApplicationSize, Converter={StaticResource ApplicationSizeConverter}}"
             MinWidth="{Binding ApplicationSize, Converter={StaticResource ApplicationSizeConverter}}"
             MaxWidth="{Binding ApplicationSize, Converter={StaticResource ApplicationSizeConverter}}"
             Padding="0"
             Background="#000000" FontFamily="Segoe UI"
             Foreground="#FFFFFF" BorderBrush="#000000"
             DataContextChanged="ShellView_OnDataContextChanged"
             UseLayoutRounding="True">
    <UserControl.Resources>
        <circularProgressButton:ProgressToAngleConverter x:Key="ProgressConverter"/>
        <Storyboard x:Key="StbFadeout">
            <DoubleAnimation AutoReverse="False"
                             From="1" To="0.0"
                             Storyboard.TargetName="CoverDisplay"
                             Storyboard.TargetProperty="Opacity"
                             Duration="0:0:0:01"/>
        </Storyboard>
        <Storyboard x:Key="StbFadein">
            <DoubleAnimation AutoReverse="False"
                             From="0.0" To="1"
                             Storyboard.TargetName="CoverDisplay"
                             Storyboard.TargetProperty="Opacity"
                             Duration="0:0:0:01"/>
        </Storyboard>
        <Storyboard x:Key="StbFadeoutPlayer">
            <DoubleAnimation AutoReverse="False"
                             To="0.0"
                             Storyboard.TargetName="PlayerButtons"
                             Storyboard.TargetProperty="Opacity"
                             Duration="0:0:.3"/>
        </Storyboard>
        <Storyboard x:Key="StbFadeinPlayer">
            <DoubleAnimation AutoReverse="False"
                             From="0.0" To="1"
                             Storyboard.TargetName="PlayerButtons"
                             Storyboard.TargetProperty="Opacity"
                             Duration="0:0:.3"/>
        </Storyboard>
        <Style TargetType="circularProgressButton1:PropgressButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type circularProgressButton1:PropgressButton}">
                        <Grid Background="Transparent">
                            <!--TODO Someone should fix this awful markup-->
                            <Ellipse Name="BorderEllipse"  Stroke="{TemplateBinding Foreground}" StrokeThickness="2" Margin="0"
                                     Fill="#222326" Opacity="0.95" />
                            <circularProgressButton1:Arc UseLayoutRounding="True" StrokeThickness="2"
                                                         Stroke="{TemplateBinding BorderBrush}" Margin="0">
                                <circularProgressButton1:Arc.StartAngle>
                                    <MultiBinding Converter="{StaticResource ProgressConverter}">
                                        <Binding Path="Minimum" RelativeSource="{RelativeSource TemplatedParent}" />
                                        <Binding Path="." RelativeSource="{RelativeSource TemplatedParent}" />
                                    </MultiBinding>
                                </circularProgressButton1:Arc.StartAngle>
                                <circularProgressButton1:Arc.EndAngle>
                                    <MultiBinding Converter="{StaticResource ProgressConverter}">
                                        <Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
                                        <Binding Path="." RelativeSource="{RelativeSource TemplatedParent}" />
                                    </MultiBinding>
                                </circularProgressButton1:Arc.EndAngle>
                            </circularProgressButton1:Arc>
                            <Rectangle UseLayoutRounding="True" Width="2" Height="15" Stroke="#DFE0E6"
                                       Margin="7,0,0,0" Visibility="{Binding IsPlaying, Converter={StaticResource VisibilityConverter}}"/>
                            <Rectangle UseLayoutRounding="True" Width="2" Height="15" Stroke="#DFE0E6"
                                           Margin="-7,0,0,0" Visibility="{Binding IsPlaying, Converter={StaticResource VisibilityConverter}}"/>

                            <Polygon UseLayoutRounding="True" Points="4,2 15,9 4,15" HorizontalAlignment="Center" VerticalAlignment="Center" 
                                     Stroke="#DFE0E6" Fill="#DFE0E6" 
                                Visibility="{Binding IsPlaying, Converter={StaticResource VisibilityConverter}, 
                                ConverterParameter={StaticResource True}}"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="BorderBrush" Value="#6BDB92"/>
                                <Setter Property="Foreground" Value="#808080"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="BorderBrush" Value="#1FD861"></Setter>
            <!--In reality this is a color for second ellipse-->
            <Setter Property="Foreground" Value="#6B6870"></Setter>
        </Style>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="UserControl.MouseEnter">
            <BeginStoryboard Storyboard="{StaticResource StbFadeinPlayer}" />
        </EventTrigger>
        <EventTrigger RoutedEvent="UserControl.MouseLeave">
            <BeginStoryboard Storyboard="{StaticResource StbFadeoutPlayer}" />
        </EventTrigger>
    </UserControl.Triggers>
    <i:Interaction.Triggers>
        <interactivity:DataEventTrigger EventName="CoverDisplayFadeOut">
            <im:ControlStoryboardAction Storyboard="{StaticResource StbFadeout}" ControlStoryboardOption="Play" />
        </interactivity:DataEventTrigger>
        <interactivity:DataEventTrigger EventName="CoverDisplayFadeIn">
            <im:ControlStoryboardAction Storyboard="{StaticResource StbFadein}" ControlStoryboardOption="Play" />
        </interactivity:DataEventTrigger>
    </i:Interaction.Triggers>
    <Border BorderBrush="#000000" BorderThickness="0" Background="#000000">
        <Border.ContextMenu>
            <controls:MiniPieContextMenu x:Name="MiniPieContextMenu"/>
        </Border.ContextMenu>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="{Binding ApplicationSize, Converter={StaticResource ApplicationSizeConverter}}" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            
            <Border Grid.Row="0" Background="#000000">
                <Border BorderBrush="{x:Null}" BorderThickness="0" Padding="0" Name="CoverDisplay" MinWidth="{Binding ApplicationSize, Converter={StaticResource ApplicationSizeConverter}}">
                    <Border.Background>
                        <ImageBrush ImageSource="{Binding CoverImage}" />
                    </Border.Background>
                    <Border>
                        <Border.Background><ImageBrush ImageSource="/Images/cover.png"></ImageBrush></Border.Background>
                        <Grid Background="Transparent" MouseDown="AlbumArt_OnMouseDown">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                               <RowDefinition Height="*" /> 
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <StackPanel Cursor="Arrow" Grid.Row="1" Grid.Column="1" Orientation="Horizontal"
                                        Name="PlayerButtons" Background="Transparent" Opacity="0" UseLayoutRounding="True">
                                <controls:ImageButton RenderOptions.BitmapScalingMode="HighQuality"  Width="25" Height="25" x:Name="PlayPrevious"
                                                  ImageSourceNormal="/Images/Player/prev-normal.png"
                                                  ImageSource="/Images/Player/prev-normal.png"
                                                  ImageSourcePressed="/Images/Player/prev-pressed.png"
                                                  ImageSourceMouseOver="/Images/Player/prev-mouseover.png"
                                                  ToolTip="plays the previous track" />
                                <circularProgressButton1:PropgressButton cal:Message.Attach="[Event Click] = [Action PlayPause]"
                                                                         Width="33" Height="33" 
                                                                         Maximum="{Binding MaxProgress}" 
                                                                         Value="{Binding Progress}" Background="Transparent"/>
                                <controls:ImageButton RenderOptions.BitmapScalingMode="HighQuality" Width="25" Height="25" x:Name="PlayNext"
                                                  ImageSourceNormal="/Images/Player/next-normal.png"
                                                  ImageSource="/Images/Player/next-normal.png"
                                                  ImageSourcePressed="/Images/Player/next-pressed.png"
                                                  ImageSourceMouseOver="/Images/Player/next-mouseover.png"
                                                  ToolTip="plays the next track" />
                            </StackPanel>
                        </Grid>
                    </Border>
                </Border>
            </Border>
            
            <StackPanel Name="TitlePanel" Grid.Row="1"  Visibility="{Binding HasTrackInformation, Converter={StaticResource VisibilityConverter}}" ClipToBounds="True">
                <Canvas Margin="5" Height="20">
                    <TextBlock Name="CurrentTrack" FontSize="12"
                           ToolTip="{Binding CurrentTrack}" TextTrimming="None"
                               Text="{Binding CurrentTrack, NotifyOnTargetUpdated=True}" TargetUpdated="CurrentTrack_OnTargetUpdated">
                        <TextBlock.RenderTransform>
                            <TranslateTransform x:Name="translate"/>
                        </TextBlock.RenderTransform>
                        <TextBlock.Triggers>
                            <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                                <BeginStoryboard>
                                    <Storyboard Name="Storyboard" Completed="StoryboardOnCompleted">
                                        <DoubleAnimationUsingKeyFrames  Name="StoryAnimation"
                                        Storyboard.TargetName="translate" 
                                        Storyboard.TargetProperty="X"
                                        Duration="0">
                                            <LinearDoubleKeyFrame x:Name="ResetKeyFrameStart" Value="0" KeyTime="0"/>
                                            <LinearDoubleKeyFrame x:Name="MinKeyTime" Value="0" KeyTime="0"/>
                                            <LinearDoubleKeyFrame x:Name="MaxKeyFrame" Value="0" KeyTime="0"/>
                                            <LinearDoubleKeyFrame x:Name="EndDelayKeyFrame" Value="0" KeyTime="0"/>
                                            <LinearDoubleKeyFrame x:Name="ResetKeyFrame" Value="0" KeyTime="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard><commit_msg>Added: styling fixes.<commit_after>﻿<UserControl x:Class="MiniPie.Views.ShellView"
             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" 
             wpf:ResxExtension.DefaultResxName="MiniPie.Properties.Resources"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
             xmlns:im="clr-namespace:Microsoft.Expression.Interactivity.Media;assembly=Microsoft.Expression.Interactions"
             xmlns:interactivity="clr-namespace:MiniPie.Interactivity"
             xmlns:controls="clr-namespace:MiniPie.Controls"
             xmlns:wpf="clr-namespace:Infralution.Localization.Wpf"
             xmlns:cal="http://www.caliburnproject.org"
             xmlns:circularProgressButton="clr-namespace:MiniPie.Converter.CircularProgressButton"
             xmlns:circularProgressButton1="clr-namespace:MiniPie.Controls.CircularProgressButton"
             mc:Ignorable="d" 
             MinHeight="{Binding ApplicationSize, Converter={StaticResource ApplicationSizeConverter}}"
             MinWidth="{Binding ApplicationSize, Converter={StaticResource ApplicationSizeConverter}}"
             MaxWidth="{Binding ApplicationSize, Converter={StaticResource ApplicationSizeConverter}}"
             Padding="0"
             Background="#000000" FontFamily="Segoe UI"
             Foreground="#FFFFFF" BorderBrush="#000000"
             DataContextChanged="ShellView_OnDataContextChanged"
             UseLayoutRounding="True">
    <UserControl.Resources>
        <circularProgressButton:ProgressToAngleConverter x:Key="ProgressConverter"/>
        <Storyboard x:Key="StbFadeout">
            <DoubleAnimation AutoReverse="False"
                             From="1" To="0.0"
                             Storyboard.TargetName="CoverDisplay"
                             Storyboard.TargetProperty="Opacity"
                             Duration="0:0:0:01"/>
        </Storyboard>
        <Storyboard x:Key="StbFadein">
            <DoubleAnimation AutoReverse="False"
                             From="0.0" To="1"
                             Storyboard.TargetName="CoverDisplay"
                             Storyboard.TargetProperty="Opacity"
                             Duration="0:0:0:01"/>
        </Storyboard>
        <Storyboard x:Key="StbFadeoutPlayer">
            <DoubleAnimation AutoReverse="False"
                             To="0.0"
                             Storyboard.TargetName="PlayerButtons"
                             Storyboard.TargetProperty="Opacity"
                             Duration="0:0:.3"/>
        </Storyboard>
        <Storyboard x:Key="StbFadeinPlayer">
            <DoubleAnimation AutoReverse="False"
                             From="0.0" To="1"
                             Storyboard.TargetName="PlayerButtons"
                             Storyboard.TargetProperty="Opacity"
                             Duration="0:0:.3"/>
        </Storyboard>
        <Style TargetType="circularProgressButton1:PropgressButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type circularProgressButton1:PropgressButton}">
                        <Grid Background="Transparent">
                            <!--TODO Someone should fix this awful markup-->
                            <Ellipse Name="BorderEllipse"  Stroke="{TemplateBinding Foreground}" StrokeThickness="2" Margin="0"
                                     Fill="#222326" Opacity="0.95" />
                            <circularProgressButton1:Arc UseLayoutRounding="True" StrokeThickness="2"
                                                         Stroke="{TemplateBinding BorderBrush}" Margin="0">
                                <circularProgressButton1:Arc.StartAngle>
                                    <MultiBinding Converter="{StaticResource ProgressConverter}">
                                        <Binding Path="Minimum" RelativeSource="{RelativeSource TemplatedParent}" />
                                        <Binding Path="." RelativeSource="{RelativeSource TemplatedParent}" />
                                    </MultiBinding>
                                </circularProgressButton1:Arc.StartAngle>
                                <circularProgressButton1:Arc.EndAngle>
                                    <MultiBinding Converter="{StaticResource ProgressConverter}">
                                        <Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
                                        <Binding Path="." RelativeSource="{RelativeSource TemplatedParent}" />
                                    </MultiBinding>
                                </circularProgressButton1:Arc.EndAngle>
                            </circularProgressButton1:Arc>
                            <Rectangle UseLayoutRounding="True" Width="2" Height="15" Stroke="#DFE0E6"
                                       Margin="7,0,0,0" Visibility="{Binding IsPlaying, Converter={StaticResource VisibilityConverter}}"/>
                            <Rectangle UseLayoutRounding="True" Width="2" Height="15" Stroke="#DFE0E6"
                                           Margin="-7,0,0,0" Visibility="{Binding IsPlaying, Converter={StaticResource VisibilityConverter}}"/>

                            <Polygon UseLayoutRounding="True" Points="4,2 15,9 4,15" HorizontalAlignment="Center" VerticalAlignment="Center" 
                                     Stroke="#DFE0E6" Fill="#DFE0E6" 
                                Visibility="{Binding IsPlaying, Converter={StaticResource VisibilityConverter}, 
                                ConverterParameter={StaticResource True}}"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="BorderBrush" Value="#6BDB92"/>
                                <Setter Property="Foreground" Value="#808080"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="BorderBrush" Value="#1FD861"></Setter>
            <!--In reality this is a color for second ellipse-->
            <Setter Property="Foreground" Value="#6B6870"></Setter>
        </Style>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="UserControl.MouseEnter">
            <BeginStoryboard Storyboard="{StaticResource StbFadeinPlayer}" />
        </EventTrigger>
        <EventTrigger RoutedEvent="UserControl.MouseLeave">
            <BeginStoryboard Storyboard="{StaticResource StbFadeoutPlayer}" />
        </EventTrigger>
    </UserControl.Triggers>
    <i:Interaction.Triggers>
        <interactivity:DataEventTrigger EventName="CoverDisplayFadeOut">
            <im:ControlStoryboardAction Storyboard="{StaticResource StbFadeout}" ControlStoryboardOption="Play" />
        </interactivity:DataEventTrigger>
        <interactivity:DataEventTrigger EventName="CoverDisplayFadeIn">
            <im:ControlStoryboardAction Storyboard="{StaticResource StbFadein}" ControlStoryboardOption="Play" />
        </interactivity:DataEventTrigger>
    </i:Interaction.Triggers>
    <Border BorderBrush="#000000" BorderThickness="0" Background="#000000">
        <Border.ContextMenu>
            <controls:MiniPieContextMenu x:Name="MiniPieContextMenu"/>
        </Border.ContextMenu>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="{Binding ApplicationSize, Converter={StaticResource ApplicationSizeConverter}}" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            
            <Border Grid.Row="0" Background="#000000">
                <Border BorderBrush="{x:Null}" BorderThickness="0" Padding="0" Name="CoverDisplay" MinWidth="{Binding ApplicationSize, Converter={StaticResource ApplicationSizeConverter}}">
                    <Border.Background>
                        <ImageBrush ImageSource="{Binding CoverImage}" />
                    </Border.Background>
                    <Border>
                        <Border.Background><ImageBrush ImageSource="/Images/cover.png"></ImageBrush></Border.Background>
                        <Grid Background="Transparent" MouseDown="AlbumArt_OnMouseDown">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                               <RowDefinition Height="*" /> 
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <StackPanel Cursor="Arrow" Grid.Row="1" Grid.Column="1" Orientation="Horizontal"
                                        Name="PlayerButtons" Background="Transparent" Opacity="0" UseLayoutRounding="True">
                                <controls:ImageButton RenderOptions.BitmapScalingMode="HighQuality"  Width="25" Height="25" x:Name="PlayPrevious"
                                                  ImageSourceNormal="/Images/Player/prev-normal.png"
                                                  ImageSource="/Images/Player/prev-normal.png"
                                                  ImageSourcePressed="/Images/Player/prev-pressed.png"
                                                  ImageSourceMouseOver="/Images/Player/prev-mouseover.png"
                                                  ToolTip="plays the previous track" />
                                <circularProgressButton1:PropgressButton cal:Message.Attach="[Event Click] = [Action PlayPause]"
                                                                         Width="33" Height="33" 
                                                                         Maximum="{Binding MaxProgress}" 
                                                                         Value="{Binding Progress}" Background="Transparent"/>
                                <controls:ImageButton RenderOptions.BitmapScalingMode="HighQuality" Width="25" Height="25" x:Name="PlayNext"
                                                  ImageSourceNormal="/Images/Player/next-normal.png"
                                                  ImageSource="/Images/Player/next-normal.png"
                                                  ImageSourcePressed="/Images/Player/next-pressed.png"
                                                  ImageSourceMouseOver="/Images/Player/next-mouseover.png"
                                                  ToolTip="plays the next track" />
                            </StackPanel>
                        </Grid>
                    </Border>
                </Border>
            </Border>

            <StackPanel Background="#282828" Name="TitlePanel" Grid.Row="1"  Visibility="{Binding HasTrackInformation, Converter={StaticResource VisibilityConverter}}" ClipToBounds="True">
                <Canvas Margin="5" Height="8">
                    <TextBlock Name="CurrentTrack" FontSize="12" Canvas.Top="-3"
                           ToolTip="{Binding CurrentTrack}" TextTrimming="None"
                               Text="{Binding CurrentTrack, NotifyOnTargetUpdated=True}" TargetUpdated="CurrentTrack_OnTargetUpdated">
                        <TextBlock.RenderTransform>
                            <TranslateTransform x:Name="translate"/>
                        </TextBlock.RenderTransform>
                        <TextBlock.Triggers>
                            <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                                <BeginStoryboard>
                                    <Storyboard Name="Storyboard" Completed="StoryboardOnCompleted">
                                        <DoubleAnimationUsingKeyFrames  Name="StoryAnimation"
                                        Storyboard.TargetName="translate" 
                                        Storyboard.TargetProperty="X"
                                        Duration="0">
                                            <LinearDoubleKeyFrame x:Name="ResetKeyFrameStart" Value="0" KeyTime="0"/>
                                            <LinearDoubleKeyFrame x:Name="MinKeyTime" Value="0" KeyTime="0"/>
                                            <LinearDoubleKeyFrame x:Name="MaxKeyFrame" Value="0" KeyTime="0"/>
                                            <LinearDoubleKeyFrame x:Name="EndDelayKeyFrame" Value="0" KeyTime="0"/>
                                            <LinearDoubleKeyFrame x:Name="ResetKeyFrame" Value="0" KeyTime="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
{'fraction_non_alphanumeric': 0.10096690219412421, 'fraction_numerical': 0.013685384901450354, 'mean_word_length': 1.5421629797693326, 'pattern_counts': {'":': 0, '<': 263, '<?xml version=': 0, '>': 263, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 26}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 124, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1977485', 'n_tokens_mistral': 6251, 'n_tokens_neox': 5693, 'n_words': 817}