<UserControl
    x:Class="PicView.WPF.Views.UserControls.Menus.ImageSettings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:buttons="clr-namespace:PicView.WPF.Views.UserControls.Buttons"
    Canvas.ZIndex="3">
    <UserControl.Resources>
        <SolidColorBrush x:Key="BottomGalleryIcon" Color="{StaticResource IconColor}" />
        <SolidColorBrush x:Key="ResizeIcon" Color="{StaticResource IconColor}" />
        <SolidColorBrush x:Key="CropIcon" Color="{StaticResource IconColor}" />
        <SolidColorBrush x:Key="SlideshowIcon" Color="{StaticResource IconColor}" />
        <SolidColorBrush x:Key="OptimizeIcon" Color="{StaticResource IconColor}" />
    </UserControl.Resources>
    <StackPanel>

        <Border
            Height="177"
            Background="{StaticResource BackgroundColorBrushAlt}"
            BorderBrush="{StaticResource BorderBrush}"
            BorderThickness="1"
            CornerRadius="8">

            <Border
                VerticalAlignment="Top"
                Background="{StaticResource AltInterfaceBrush}"
                CornerRadius="8,8,0,0">
                <Canvas Width="282" Height="45">

                    <Border
                        Canvas.Left="-1"
                        Canvas.Top="-1"
                        Width="285"
                        Height="46"
                        Background="{StaticResource BackgroundColorBrushAlt}"
                        BorderBrush="{StaticResource BorderBrush}"
                        BorderThickness="1"
                        CornerRadius="8,8,0,0" />

                    <Border
                        Width="47"
                        Height="45"
                        CornerRadius="8,0,0,0">
                        <Border.Background>
                            <SolidColorBrush x:Name="RotateLeftButtonBrush" Color="Transparent" />
                        </Border.Background>
                        <Button x:Name="RotateLeftButton">
                            <Path
                                Width="15"
                                Height="15"
                                Data="M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z"
                                RenderTransformOrigin="0.5,0.5"
                                Stretch="Fill">
                                <Path.Fill>
                                    <SolidColorBrush x:Name="RotateLeftIconBrush" Color="{StaticResource IconColor}" />
                                </Path.Fill>
                                <Path.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="-1" />
                                        <SkewTransform />
                                        <RotateTransform />
                                        <TranslateTransform />
                                    </TransformGroup>
                                </Path.RenderTransform>
                            </Path>
                        </Button>
                    </Border>

                    <Rectangle
                        Canvas.Left="47"
                        Width="1"
                        Height="45"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Center"
                        Panel.ZIndex="1"
                        Stroke="{StaticResource BorderBrush}"
                        StrokeThickness="1" />

                    <Button
                        x:Name="RotateRightButton"
                        Canvas.Left="47"
                        Width="47"
                        Height="45"
                        BorderBrush="{x:Null}"
                        Foreground="{x:Null}">
                        <Button.Background>
                            <SolidColorBrush x:Name="RotateRightButtonBrush" Color="Transparent" />
                        </Button.Background>
                        <Path
                            Width="15"
                            Height="15"
                            Data="M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z"
                            RenderTransformOrigin="0.5,0.5"
                            Stretch="Fill">
                            <Path.Fill>
                                <SolidColorBrush x:Name="RotateRightIconBrush" Color="{StaticResource IconColor}" />
                            </Path.Fill>
                        </Path>
                    </Button>

                    <Rectangle
                        Canvas.Left="93"
                        Width="1"
                        Height="45"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Center"
                        Panel.ZIndex="1"
                        Stroke="{StaticResource BorderBrush}"
                        StrokeThickness="1" />

                    <CheckBox
                        x:Name="FlipButton"
                        Canvas.Left="94"
                        Width="47"
                        Height="45"
                        BorderBrush="{x:Null}"
                        Foreground="{x:Null}">
                        <CheckBox.Background>
                            <SolidColorBrush x:Name="FlipButtonBrush" Color="Transparent" />
                        </CheckBox.Background>
                        <CheckBox.Content>
                            <Path
                                x:Name="FlipPath"
                                Width="13"
                                Height="13"
                                Margin="14,14.8,0,0"
                                Data="M192,96v64h248c4.4,0,8,3.6,8,8v240c0,4.4-3.6,8-8,8H136c-4.4,0-8-3.6-8-8v-48c0-4.4,3.6-8,8-8h248V224H192v64L64,192  L192,96z"
                                Stretch="Fill">
                                <Path.Fill>
                                    <SolidColorBrush x:Name="FlipIconBrush" Color="{StaticResource IconColor}" />
                                </Path.Fill>
                            </Path>
                        </CheckBox.Content>
                    </CheckBox>

                    <Rectangle
                        Canvas.Left="140"
                        Width="1"
                        Height="45"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Center"
                        Panel.ZIndex="1"
                        Stroke="{StaticResource BorderBrush}"
                        StrokeThickness="1" />

                    <buttons:GoToPicButton
                        x:Name="GoToPic"
                        Canvas.Left="140"
                        Width="97"
                        Height="45" />

                    <Border Canvas.Left="237" CornerRadius="0,8,0,0">
                        <buttons:MenuCloseButton Height="45" />
                    </Border>

                    <Border
                        x:Name="ResizeButtonBorder"
                        Canvas.Left="5"
                        Canvas.Top="51"
                        Width="133"
                        Height="37"
                        Style="{StaticResource ButtonBorder}">
                        <StackPanel Orientation="Horizontal">
                            <StackPanel.Background>
                                <SolidColorBrush x:Name="ResizeBorderBrush" Color="Transparent" />
                            </StackPanel.Background>
                            <Canvas Width="40" Height="37">
                                <Image
                                    Canvas.Left="6"
                                    Canvas.Top="5"
                                    Height="20">
                                    <Image.Source>
                                        <DrawingImage>
                                            <DrawingImage.Drawing>
                                                <DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
                                                    <GeometryDrawing Brush="{StaticResource ResizeIcon}" Geometry="F1 M512,512z M0,0z M464,448L48,448C21.49,448,0,426.51,0,400L0,112C0,85.49,21.49,64,48,64L464,64C490.51,64,512,85.49,512,112L512,400C512,426.51,490.51,448,464,448z M112,120C81.072,120 56,145.072 56,176 56,206.928 81.072,232 112,232 142.928,232 168,206.928 168,176 168,145.072 142.928,120 112,120z M64,384L448,384 448,272 360.485,184.485C355.799,179.799,348.201,179.799,343.514,184.485L208,320 152.485,264.485C147.799,259.799,140.201,259.799,135.514,264.485L64,336 64,384z" />
                                                </DrawingGroup>
                                            </DrawingImage.Drawing>
                                        </DrawingImage>
                                    </Image.Source>
                                </Image>
                                <Image
                                    Canvas.Left="24"
                                    Canvas.Top="9.5"
                                    Height="12"
                                    Opacity=".8">
                                    <Image.Source>
                                        <DrawingImage>
                                            <DrawingImage.Drawing>
                                                <DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
                                                    <GeometryDrawing Brush="{StaticResource ResizeIcon}" Geometry="F1 M512,512z M0,0z M464,448L48,448C21.49,448,0,426.51,0,400L0,112C0,85.49,21.49,64,48,64L464,64C490.51,64,512,85.49,512,112L512,400C512,426.51,490.51,448,464,448z M112,120C81.072,120 56,145.072 56,176 56,206.928 81.072,232 112,232 142.928,232 168,206.928 168,176 168,145.072 142.928,120 112,120z M64,384L448,384 448,272 360.485,184.485C355.799,179.799,348.201,179.799,343.514,184.485L208,320 152.485,264.485C147.799,259.799,140.201,259.799,135.514,264.485L64,336 64,384z" />
                                                </DrawingGroup>
                                            </DrawingImage.Drawing>
                                        </DrawingImage>
                                    </Image.Source>
                                </Image>
                            </Canvas>
                            <Button x:Name="ResizeButton" FocusVisualStyle="{x:Null}">
                                <Button.Content>
                                    <TextBlock
                                        x:Name="ResizeButtonTextBlock"
                                        Width="85"
                                        Margin="2,0,4,0"
                                        FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Medium"
                                        Foreground="{StaticResource ResizeIcon}"
                                        TextTrimming="CharacterEllipsis"
                                        TextWrapping="NoWrap" />
                                </Button.Content>
                            </Button>
                        </StackPanel>
                    </Border>

                    <Border
                        x:Name="CropButtonBorder"
                        Canvas.Left="144"
                        Canvas.Top="51"
                        Width="133"
                        Height="37"
                        Style="{StaticResource ButtonBorder}">
                        <StackPanel Orientation="Horizontal">
                            <StackPanel.Background>
                                <SolidColorBrush x:Name="CropBorderBrush" Color="Transparent" />
                            </StackPanel.Background>
                            <Path
                                Width="17"
                                Height="17"
                                Margin="7,0,3,0"
                                Data="M488 352h-40V109.25l59.31-59.31c6.25-6.25 6.25-16.38 0-22.63L484.69 4.69c-6.25-6.25-16.38-6.25-22.63 0L402.75 64H192v96h114.75L160 306.75V24c0-13.26-10.75-24-24-24H88C74.75 0 64 10.74 64 24v40H24C10.75 64 0 74.74 0 88v48c0 13.25 10.75 24 24 24h40v264c0 13.25 10.75 24 24 24h232v-96H205.25L352 205.25V488c0 13.25 10.75 24 24 24h48c13.25 0 24-10.75 24-24v-40h40c13.25 0 24-10.75 24-24v-48c0-13.26-10.75-24-24-24z"
                                Fill="{StaticResource CropIcon}"
                                Stretch="Fill" />
                            <Button
                                x:Name="CropButton"
                                BorderBrush="{x:Null}"
                                Foreground="{x:Null}">
                                <Button.Background>
                                    <SolidColorBrush Color="Transparent" />
                                </Button.Background>
                                <Button.Content>
                                    <TextBlock
                                        x:Name="CropButtonTextBlock"
                                        Width="85"
                                        Margin="5,1,3,0"
                                        FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Medium"
                                        Foreground="{StaticResource CropIcon}"
                                        TextTrimming="CharacterEllipsis"
                                        TextWrapping="NoWrap" />
                                </Button.Content>
                            </Button>
                        </StackPanel>
                    </Border>

                    <Border
                        x:Name="SlideShowBorder"
                        Canvas.Left="5"
                        Canvas.Top="92"
                        Width="133"
                        Height="37"
                        Style="{StaticResource ButtonBorder}">
                        <StackPanel Orientation="Horizontal">
                            <StackPanel.Background>
                                <SolidColorBrush x:Name="SlideShowBorderBrush" Color="Transparent" />
                            </StackPanel.Background>
                            <Path
                                Width="17"
                                Height="17"
                                Margin="11,0,4,0"
                                Data="M20 16v16l10-8-10-8zm18-10h-28c-2.21 0-4 1.79-4 4v28c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4v-28c0-2.21-1.79-4-4-4zm0 32h-28v-28h28v28z"
                                Fill="{StaticResource SlideshowIcon}"
                                Stretch="Fill" />
                            <Button x:Name="SlideShowButton" FocusVisualStyle="{x:Null}">
                                <Button.Content>
                                    <TextBlock
                                        x:Name="SlideShowButtonTextBlock"
                                        Width="93"
                                        Margin="8,1,0,00"
                                        FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Medium"
                                        Foreground="{StaticResource SlideshowIcon}"
                                        TextTrimming="CharacterEllipsis"
                                        TextWrapping="NoWrap" />
                                </Button.Content>
                            </Button>
                        </StackPanel>
                    </Border>

                    <Border
                        x:Name="OptimizeBorder"
                        Canvas.Left="144"
                        Canvas.Top="92"
                        Width="133"
                        Height="37"
                        Style="{StaticResource ButtonBorder}">
                        <StackPanel Orientation="Horizontal">
                            <StackPanel.Background>
                                <SolidColorBrush x:Name="BgBorderBrush" Color="Transparent" />
                            </StackPanel.Background>
                            <Image
                                Width="17"
                                Height="17"
                                Margin="7,0,1,0">
                                <Image.Source>
                                    <DrawingImage>
                                        <DrawingImage.Drawing>
                                            <DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
                                                <GeometryDrawing Geometry="F1 M512,512z M0,0z M448,256C448,150 362,64 256,64 150,64 64,150 64,256 64,362 150,448 256,448 362,448 448,362 448,256z">
                                                    <GeometryDrawing.Pen>
                                                        <Pen
                                                            Brush="{StaticResource OptimizeIcon}"
                                                            EndLineCap="Flat"
                                                            LineJoin="Miter"
                                                            MiterLimit="1"
                                                            StartLineCap="Flat"
                                                            Thickness="32" />
                                                    </GeometryDrawing.Pen>
                                                </GeometryDrawing>
                                                <GeometryDrawing Geometry="F1 M512,512z M0,0z M360,94.59L360,296 M443.13,212.87L296,360 M417.41,360L216,360 M299.13,443.13L155.13,299.13 M152,416L152,216 M68.87,299.13L212.87,155.13 M94.59,152L288,152 M212.87,68.87L360,216">
                                                    <GeometryDrawing.Pen>
                                                        <Pen
                                                            Brush="{StaticResource OptimizeIcon}"
                                                            EndLineCap="Round"
                                                            LineJoin="Round"
                                                            MiterLimit="1"
                                                            StartLineCap="Round"
                                                            Thickness="32" />
                                                    </GeometryDrawing.Pen>
                                                </GeometryDrawing>
                                            </DrawingGroup>
                                        </DrawingImage.Drawing>
                                    </DrawingImage>
                                </Image.Source>
                            </Image>
                            <Button x:Name="OptimizeButton" FocusVisualStyle="{x:Null}">
                                <Button.Content>
                                    <TextBlock
                                        x:Name="OptimizeButtonTextBlock"
                                        Width="93"
                                        Margin="7,1,3,0"
                                        FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Medium"
                                        Foreground="{StaticResource OptimizeIcon}"
                                        TextTrimming="CharacterEllipsis"
                                        TextWrapping="NoWrap" />
                                </Button.Content>
                            </Button>
                        </StackPanel>
                    </Border>

                    <Border
                        x:Name="BottomGalleryBorder"
                        Canvas.Left="5"
                        Canvas.Top="133"
                        Width="271"
                        Height="35"
                        Style="{StaticResource ButtonBorder}">
                        <Button
                            x:Name="BottomGalleryButton"
                            FocusVisualStyle="{x:Null}"
                            FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Medium"
                            FontSize="14">
                            <Button.Background>
                                <SolidColorBrush x:Name="BottomGalleryBrush" Color="Transparent" />
                            </Button.Background>
                            <StackPanel Orientation="Horizontal">
                                <Image Width="17" Height="17">
                                    <Image.Source>
                                        <DrawingImage>
                                            <DrawingImage.Drawing>
                                                <DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
                                                    <GeometryDrawing Brush="{StaticResource BottomGalleryIcon}" Geometry="F1 M512,512z M0,0z M80,132L80,460A20,20,0,0,0,100,480L492,480A20,20,0,0,0,512,460L512,132A20,20,0,0,0,492,112L100,112A20,20,0,0,0,80,132z M373.14,173.33A46,46,0,1,1,326.86,219.33A46.19,46.19,0,0,1,373.14,173.33z M111.73,449.33L111.73,353.85 234.49,243.65 328.27,337 215.27,449.33z M480,449.33L259,449.33 403.58,305.33 480,370.59z" />
                                                    <GeometryDrawing Brush="{StaticResource BottomGalleryIcon}" Geometry="F1 M512,512z M0,0z M20,32A20,20,0,0,0,0,52L0,396A20,20,0,0,0,20,416L48,416 48,100A20,20,0,0,1,68,80L448,80 448,52A20,20,0,0,0,428,32z" />
                                                </DrawingGroup>
                                            </DrawingImage.Drawing>
                                        </DrawingImage>
                                    </Image.Source>
                                </Image>
                                <TextBlock
                                    x:Name="ShowBottomGalleryText"
                                    MaxWidth="175"
                                    Margin="10,0,10,0"
                                    Foreground="{StaticResource BottomGalleryIcon}"
                                    TextWrapping="Wrap" />
                            </StackPanel>
                        </Button>
                    </Border>
                </Canvas>
            </Border>
        </Border>

        <Rectangle
            Width="24"
            Height="2"
            Margin="38,-2,0,0"
            HorizontalAlignment="Left"
            Fill="{StaticResource BackgroundColorBrushAlt}" />
        <Polygon
            Margin="35,-6,0,0"
            Panel.ZIndex="-1"
            Fill="{StaticResource BackgroundColorBrushAlt}"
            Points="0,0 15,30, 30,0"
            Stroke="{StaticResource BorderBrush}"
            StrokeThickness="1" />
    </StackPanel>
</UserControl>