<commit_before>﻿<Window x:Class="RudeFox.Views.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:RudeFox.Views"
        xmlns:frontEnd="clr-namespace:RudeFox.FrontEnd"
        mc:Ignorable="d"
        xmlns:controls="clr-namespace:RudeFox.Controls"
        xmlns:converters="clr-namespace:RudeFox.Converters"
        xmlns:vm="clr-namespace:RudeFox.ViewModels" WindowState="Maximized" WindowStartupLocation="CenterScreen"
        xmlns:gong="urn:gong-wpf-dragdrop" Icon="/Images/icon_24.png"
        Title="{Binding Title}" Height="600" MinWidth="800" MinHeight="500">
    <Window.DataContext>
        <vm:MainWindowVM />
    </Window.DataContext>

    <Window.Resources>
        <SolidColorBrush x:Key="background1" Color="#343434" />
        <SolidColorBrush x:Key="background2" Color="White" />
        <SolidColorBrush x:Key="foreground1" Color="Gainsboro" />
        <SolidColorBrush x:Key="foreground2" Color="#343434" />
        <converters:TimespanToStringConverter x:Key="timeConverter"/>
        <DataTemplate x:Key="operation" DataType="vm:OperationVM">
            <Border >
                <Grid Margin="0, 5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="60" />
                    </Grid.ColumnDefinitions>

                    <Image Source="{Binding Image}" HorizontalAlignment="Center" VerticalAlignment="Center" Height="48"/>

                    <Grid Grid.Column="1">
                        
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <TextBlock Text="{Binding Path}" FontSize="16" TextTrimming="CharacterEllipsis"/>
                        <TextBlock FontSize="16" Text="{Binding Progress, StringFormat='{}{0:0.#} %', FallbackValue=0.0}" Grid.Column="1" HorizontalAlignment="Right"/>

                        <ProgressBar Value="{Binding Progress}" Grid.Row="1" Margin="0, 5" Height="18" Grid.ColumnSpan="2"/>
                      
                        <TextBlock Text="{Binding TimeRemaining, Converter={StaticResource timeConverter}, StringFormat='Time Remaining: {0}'}" Foreground="#666" Grid.Row="2"/>
                        <TextBlock Text="{Binding Size}" VerticalAlignment="Center" Foreground="Gray" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right"/>
                    </Grid>

                    <controls:FlatButton Content="X" HorizontalAlignment="Center" VerticalAlignment="Center" CornerRadius="3" MinWidth="30" MinHeight="30"
                                         Grid.Column="2" Focusable="False" Command="{Binding CancelCommand}"  TextBlock.TextAlignment="Center"/>
                </Grid>
            </Border>
        </DataTemplate>

        <Style TargetType="{x:Type ListBox}" x:Key="listBox">
            <Setter Property="BorderBrush" Value="{StaticResource background1}" />
            <Setter Property="BorderThickness" Value="5, 5, 0, 5" />
            <Setter Property="Padding" Value="3" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border BorderThickness="{TemplateBinding BorderThickness}" Background="{StaticResource background2}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="5, 0, 0, 5">
                            <ScrollViewer Focusable="False" Padding="{TemplateBinding Padding}" HorizontalScrollBarVisibility="Disabled">
                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </ScrollViewer>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <!-- If the list was empty, show the user a hint ;) -->
                <DataTrigger Binding="{Binding Path=Items.Count, RelativeSource={RelativeSource Self}}"  Value="0">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Border BorderThickness="{TemplateBinding BorderThickness}" Background="{StaticResource background2}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="5, 0, 0, 5">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="*"/>
                                            <RowDefinition Height="256"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="2*" />
                                        </Grid.RowDefinitions>
                                        <Image Height="128" Width="128" Grid.Row="1" Source="/Images/icon_128.png"/>
                                        <StackPanel Orientation="Horizontal" Grid.Row="2"  HorizontalAlignment="Center" Margin="0,0,0,20">
                                            <TextBlock Text="Nothing to delete" FontSize="28" Margin="0,0,10,0" FontWeight="Light" Foreground="{StaticResource foreground2}" />
                                        </StackPanel>
                                        <TextBlock HorizontalAlignment="Center" Grid.Row="3" Foreground="{StaticResource foreground2}" FontSize="18">Drop some files and folders here to be deleted.</TextBlock>
                                    </Grid>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>

    </Window.Resources>

    <DockPanel Background="#343434">
        <StackPanel DockPanel.Dock="Left" Width="250" Margin="5, 10, 0, 10">
            <controls:SidebarButton ImageSource="/Images/delete_file.png" Text="DELETE FILES" Command="{Binding DeleteFilesCommand}"/>
            <controls:SidebarButton ImageSource="/Images/delete_folder.png" Text="DELETE FOLDER" Command="{Binding DeleteFoldersCommand}"/>
            <controls:SidebarButton ImageSource="/Images/cancel_all.png" Text="CANCEL ALL" Command="{Binding CancelAllCommand}"/>
        </StackPanel>

        <ListBox gong:DragDrop.IsDropTarget="True" gong:DragDrop.DropHandler="{Binding}"
                 ItemsSource="{Binding Source={x:Static frontEnd:App.Operations}}"
                 HorizontalContentAlignment="Stretch" ItemTemplate="{StaticResource operation}"
                 Style="{StaticResource listBox}" Background="{StaticResource background2}">

        </ListBox>

    </DockPanel>

</Window><commit_msg>Add a seperator to MainWindow sidebar<commit_after>﻿<Window x:Class="RudeFox.Views.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:RudeFox.Views"
        xmlns:frontEnd="clr-namespace:RudeFox.FrontEnd"
        mc:Ignorable="d"
        xmlns:controls="clr-namespace:RudeFox.Controls"
        xmlns:converters="clr-namespace:RudeFox.Converters"
        xmlns:vm="clr-namespace:RudeFox.ViewModels" WindowState="Maximized" WindowStartupLocation="CenterScreen"
        xmlns:gong="urn:gong-wpf-dragdrop" Icon="/Images/icon_24.png"
        Title="{Binding Title}" Height="600" MinWidth="800" MinHeight="500">
    <Window.DataContext>
        <vm:MainWindowVM />
    </Window.DataContext>

    <Window.Resources>
        <SolidColorBrush x:Key="background1" Color="#343434" />
        <SolidColorBrush x:Key="background2" Color="White" />
        <SolidColorBrush x:Key="foreground1" Color="Gainsboro" />
        <SolidColorBrush x:Key="foreground2" Color="#343434" />
        <converters:TimespanToStringConverter x:Key="timeConverter"/>
        <DataTemplate x:Key="operation" DataType="vm:OperationVM">
            <Border >
                <Grid Margin="0, 5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="60" />
                    </Grid.ColumnDefinitions>

                    <Image Source="{Binding Image}" HorizontalAlignment="Center" VerticalAlignment="Center" Height="48"/>

                    <Grid Grid.Column="1">
                        
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <TextBlock Text="{Binding Path}" FontSize="16" TextTrimming="CharacterEllipsis"/>
                        <TextBlock FontSize="16" Text="{Binding Progress, StringFormat='{}{0:0.#} %', FallbackValue=0.0}" Grid.Column="1" HorizontalAlignment="Right"/>

                        <ProgressBar Value="{Binding Progress}" Grid.Row="1" Margin="0, 5" Height="18" Grid.ColumnSpan="2"/>
                      
                        <TextBlock Text="{Binding TimeRemaining, Converter={StaticResource timeConverter}, StringFormat='Time Remaining: {0}'}" Foreground="#666" Grid.Row="2"/>
                        <TextBlock Text="{Binding Size}" VerticalAlignment="Center" Foreground="Gray" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right"/>
                    </Grid>

                    <controls:FlatButton Content="X" HorizontalAlignment="Center" VerticalAlignment="Center" CornerRadius="3" MinWidth="30" MinHeight="30"
                                         Grid.Column="2" Focusable="False" Command="{Binding CancelCommand}"  TextBlock.TextAlignment="Center"/>
                </Grid>
            </Border>
        </DataTemplate>

        <Style TargetType="{x:Type ListBox}" x:Key="listBox">
            <Setter Property="BorderBrush" Value="{StaticResource background1}" />
            <Setter Property="BorderThickness" Value="5, 5, 0, 5" />
            <Setter Property="Padding" Value="3" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border BorderThickness="{TemplateBinding BorderThickness}" Background="{StaticResource background2}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="5, 0, 0, 5">
                            <ScrollViewer Focusable="False" Padding="{TemplateBinding Padding}" HorizontalScrollBarVisibility="Disabled">
                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </ScrollViewer>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <!-- If the list was empty, show the user a hint ;) -->
                <DataTrigger Binding="{Binding Path=Items.Count, RelativeSource={RelativeSource Self}}"  Value="0">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Border BorderThickness="{TemplateBinding BorderThickness}" Background="{StaticResource background2}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="5, 0, 0, 5">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="*"/>
                                            <RowDefinition Height="256"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="2*" />
                                        </Grid.RowDefinitions>
                                        <Image Height="128" Width="128" Grid.Row="1" Source="/Images/icon_128.png"/>
                                        <StackPanel Orientation="Horizontal" Grid.Row="2"  HorizontalAlignment="Center" Margin="0,0,0,20">
                                            <TextBlock Text="Nothing to delete" FontSize="28" Margin="0,0,10,0" FontWeight="Light" Foreground="{StaticResource foreground2}" />
                                        </StackPanel>
                                        <TextBlock HorizontalAlignment="Center" Grid.Row="3" Foreground="{StaticResource foreground2}" FontSize="18">Drop some files and folders here to be deleted.</TextBlock>
                                    </Grid>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>

    </Window.Resources>

    <DockPanel Background="#343434">
        <StackPanel DockPanel.Dock="Left" Width="250" Margin="5, 10, 0, 10">
            <controls:SidebarButton ImageSource="/Images/delete_file.png" Text="DELETE FILES" Command="{Binding DeleteFilesCommand}"/>
            <controls:SidebarButton ImageSource="/Images/delete_folder.png" Text="DELETE FOLDER" Command="{Binding DeleteFoldersCommand}"/>
            <Separator Background="#666" Margin="10, 3, 10, 5"/>
            <controls:SidebarButton ImageSource="/Images/cancel_all.png" Text="CANCEL ALL" Command="{Binding CancelAllCommand}"/>
        </StackPanel>

        <ListBox gong:DragDrop.IsDropTarget="True" gong:DragDrop.DropHandler="{Binding}"
                 ItemsSource="{Binding Source={x:Static frontEnd:App.Operations}}"
                 HorizontalContentAlignment="Stretch" ItemTemplate="{StaticResource operation}"
                 Style="{StaticResource listBox}" Background="{StaticResource background2}">

        </ListBox>

    </DockPanel>

</Window>
{'fraction_non_alphanumeric': 0.12403356902134408, 'fraction_numerical': 0.01975814445252098, 'mean_word_length': 1.8474129821260583, 'pattern_counts': {'":': 0, '<': 192, '<?xml version=': 0, '>': 192, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 22}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 44, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6255532', 'n_tokens_mistral': 3981, 'n_tokens_neox': 3475, 'n_words': 620}