<UserControl
    x:Class="PicView.WPF.Views.UserControls.Menus.ToolsAndEffectsMenu"
    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"
    Foreground="{StaticResource MainColorBrush}">

    <UserControl.Resources>
        <SolidColorBrush x:Key="ResizeIconBrush" Color="{StaticResource IconColor}" />
        <SolidColorBrush x:Key="EffectsIconBrush" Color="{StaticResource IconColor}" />
        <SolidColorBrush x:Key="InfoIconBrush" Color="{StaticResource IconColor}" />
        <SolidColorBrush x:Key="ColorIconBrush" Color="{StaticResource IconColor}" />
        <SolidColorBrush x:Key="OptimizeIconBrush" Color="{StaticResource IconColor}" />
        <SolidColorBrush x:Key="ChangeIconBrush" Color="{StaticResource IconColor}" />
    </UserControl.Resources>

    <StackPanel>

        <Border
            Width="358"
            Height="161"
            Background="{StaticResource BackgroundColorBrushAlt}"
            BorderBrush="{StaticResource BorderBrush}"
            BorderThickness="1"
            CornerRadius="8">
            <Canvas
                Width="356"
                Height="45"
                VerticalAlignment="Top">

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

                <Rectangle
                    Canvas.Left="1"
                    Canvas.Top="43"
                    Width="310"
                    Height="1"
                    Panel.ZIndex="1"
                    Stroke="{StaticResource BorderBrush}"
                    StrokeThickness="1" />

                <Border
                    Width="173"
                    Height="43"
                    CornerRadius="8,0,0,0">
                    <Border.Background>
                        <SolidColorBrush x:Name="ResizeButtonBrush" Color="Transparent" />
                    </Border.Background>
                    <Button
                        x:Name="ResizeButton"
                        FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Medium"
                        FontSize="13">

                        <StackPanel Width="173" Orientation="Horizontal">
                            <TextBlock
                                x:Name="ResizeTextBlock"
                                Width="125"
                                Margin="2,2,2,2"
                                VerticalAlignment="Center"
                                Foreground="{StaticResource ResizeIconBrush}"
                                TextAlignment="Center"
                                TextTrimming="CharacterEllipsis"
                                TextWrapping="Wrap" />
                            <Canvas Width="51" Height="51">
                                <Image
                                    Canvas.Left="0"
                                    Canvas.Top="10"
                                    Height="22">
                                    <Image.Source>
                                        <DrawingImage>
                                            <DrawingImage.Drawing>
                                                <DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
                                                    <GeometryDrawing Brush="{StaticResource ResizeIconBrush}" 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="15"
                                    Canvas.Top="14"
                                    Height="16"
                                    Panel.ZIndex="-1">
                                    <Image.Source>
                                        <DrawingImage>
                                            <DrawingImage.Drawing>
                                                <DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
                                                    <GeometryDrawing Brush="{StaticResource ResizeIconBrush}" 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="26"
                                    Canvas.Top="17"
                                    Height="10"
                                    Panel.ZIndex="-2">
                                    <Image.Source>
                                        <DrawingImage>
                                            <DrawingImage.Drawing>
                                                <DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
                                                    <GeometryDrawing Brush="{StaticResource ResizeIconBrush}" 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>
                        </StackPanel>
                    </Button>
                </Border>

                <Rectangle
                    Canvas.Left="172"
                    Width="1"
                    Height="43"
                    Panel.ZIndex="1"
                    Stroke="{StaticResource BorderBrush}"
                    StrokeThickness="1" />

                <Button
                    x:Name="EffectsButton"
                    Canvas.Left="173"
                    Width="139"
                    Height="43"
                    FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Medium"
                    FontSize="13">
                    <Button.Background>
                        <SolidColorBrush x:Name="EffectsButtonBrush" Color="Transparent" />
                    </Button.Background>
                    <StackPanel MaxWidth="135" Orientation="Horizontal">
                        <TextBlock
                            x:Name="EffectsTextBlock"
                            Width="110"
                            MaxWidth="110"
                            Margin="0,2,0,2"
                            Foreground="{StaticResource EffectsIconBrush}"
                            TextAlignment="Center"
                            TextTrimming="CharacterEllipsis"
                            TextWrapping="Wrap" />
                        <Image
                            Width="17"
                            Height="17"
                            Margin="0,0,7,0"
                            Stretch="Fill">
                            <Image.Source>
                                <DrawingImage>
                                    <DrawingImage.Drawing>
                                        <DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
                                            <GeometryDrawing Brush="{StaticResource EffectsIconBrush}" Geometry="F1 M512,512z M0,0z M469.11,382.76L325,153.92 325,74 357,74 357,32 155,32 155,74 187,74 187,153.92 42.89,382.76C29.89,403.4 28.11,426.49 39.89,447.86 51.67,469.23 71.59,480 96,480L416,480C440.41,480 460.32,469.24 472.1,447.86 483.88,426.48 482.14,403.4 469.11,382.76z M224.39,173.39A29.76,29.76,0,0,0,229.01,157.39L229.01,74 283.01,74 283.01,158.59A25.85,25.85,0,0,0,287.01,172.41L356.82,283 155.18,283z" />
                                        </DrawingGroup>
                                    </DrawingImage.Drawing>
                                </DrawingImage>
                            </Image.Source>
                        </Image>
                    </StackPanel>
                </Button>

                <buttons:MenuCloseButton
                    x:Name="CloseButton"
                    Canvas.Left="311"
                    Height="43" />

                <Border
                    x:Name="ImageInfoButtonBorder"
                    Canvas.Left="7"
                    Canvas.Top="50"
                    Width="162"
                    Height="49"
                    Style="{StaticResource ButtonBorder}">
                    <Button
                        x:Name="ImageInfoButton"
                        Canvas.Left="196"
                        Canvas.Top="59"
                        FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Medium">
                        <Button.Background>
                            <SolidColorBrush x:Name="ImageInfoBrush" Color="Transparent" />
                        </Button.Background>
                        <StackPanel Width="150" Orientation="Horizontal">
                            <TextBlock
                                x:Name="ImageInfoTextBlock"
                                Width="126"
                                MaxWidth="126"
                                Margin="0,2,2,2"
                                Foreground="{StaticResource InfoIconBrush}"
                                TextAlignment="Center"
                                TextWrapping="Wrap" />
                            <Path
                                Width="17"
                                Height="17"
                                Data="M48 32C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48H48zm0 32h106c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H38c-3.3 0-6-2.7-6-6V80c0-8.8 7.2-16 16-16zm426 96H38c-3.3 0-6-2.7-6-6v-36c0-3.3 2.7-6 6-6h138l30.2-45.3c1.1-1.7 3-2.7 5-2.7H464c8.8 0 16 7.2 16 16v74c0 3.3-2.7 6-6 6zM256 424c-66.2 0-120-53.8-120-120s53.8-120 120-120 120 53.8 120 120-53.8 120-120 120zm0-208c-48.5 0-88 39.5-88 88s39.5 88 88 88 88-39.5 88-88-39.5-88-88-88zm-48 104c-8.8 0-16-7.2-16-16 0-35.3 28.7-64 64-64 8.8 0 16 7.2 16 16s-7.2 16-16 16c-17.6 0-32 14.4-32 32 0 8.8-7.2 16-16 16z"
                                Fill="{StaticResource InfoIconBrush}"
                                Stretch="Fill" />
                        </StackPanel>
                    </Button>
                </Border>

                <Border
                    x:Name="ColorPickerButtonBorder"
                    Canvas.Left="175"
                    Canvas.Top="50"
                    Width="174"
                    Height="49"
                    Style="{StaticResource ButtonBorder}">
                    <Button x:Name="ColorPickerButton" FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Medium">
                        <Button.Background>
                            <SolidColorBrush x:Name="ColorPickerBrush" Color="Transparent" />
                        </Button.Background>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock
                                x:Name="ColorPickerTextBlock"
                                Width="136"
                                MaxWidth="136"
                                Margin="0,2,2,2"
                                Foreground="{StaticResource ColorIconBrush}"
                                TextAlignment="Center"
                                TextWrapping="Wrap" />
                            <Path
                                Width="20"
                                Height="20"
                                Data="M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"
                                Fill="{StaticResource ColorIconBrush}"
                                Stretch="Fill" />
                        </StackPanel>
                    </Button>
                </Border>

                <Border
                    x:Name="OptimizeImageButtonBorder"
                    Canvas.Left="7"
                    Canvas.Top="104"
                    Width="162"
                    Height="49"
                    Style="{StaticResource ButtonBorder}">
                    <Button
                        x:Name="OptimizeImageButton"
                        Canvas.Left="196"
                        Canvas.Top="59"
                        FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Medium">
                        <Button.Background>
                            <SolidColorBrush x:Name="OptimizeImageBrush" Color="Transparent" />
                        </Button.Background>
                        <StackPanel Width="150" Orientation="Horizontal">
                            <TextBlock
                                x:Name="OptimizeImageTextBlock"
                                Width="126"
                                MaxWidth="126"
                                Margin="0,2,2,2"
                                Foreground="{StaticResource OptimizeIconBrush}"
                                TextAlignment="Center"
                                TextWrapping="Wrap" />
                            <Image Width="17" Height="17">
                                <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 OptimizeIconBrush}"
                                                            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 OptimizeIconBrush}"
                                                            EndLineCap="Round"
                                                            LineJoin="Round"
                                                            MiterLimit="1"
                                                            StartLineCap="Round"
                                                            Thickness="32" />
                                                    </GeometryDrawing.Pen>
                                                </GeometryDrawing>
                                            </DrawingGroup>
                                        </DrawingImage.Drawing>
                                    </DrawingImage>
                                </Image.Source>
                            </Image>
                        </StackPanel>
                    </Button>
                </Border>

                <Border
                    x:Name="BgBorder"
                    Canvas.Left="175"
                    Canvas.Top="104"
                    Width="174"
                    Height="49"
                    Style="{StaticResource ButtonBorder}">
                    <Button x:Name="BgButton" FontFamily="/PicView;component/Themes/Resources/fonts/#Roboto Medium">
                        <Button.Background>
                            <SolidColorBrush x:Name="BgBrush" Color="Transparent" />
                        </Button.Background>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock
                                x:Name="BgTextBlock"
                                Width="136"
                                MaxWidth="136"
                                Margin="4,2,2,2"
                                VerticalAlignment="Center"
                                Foreground="{StaticResource ChangeIconBrush}"
                                TextAlignment="Center"
                                TextWrapping="Wrap" />
                            <Image Width="20" Height="20">
                                <Image.Source>
                                    <DrawingImage>
                                        <DrawingImage.Drawing>
                                            <DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
                                                <GeometryDrawing>
                                                    <GeometryDrawing.Pen>
                                                        <Pen
                                                            Brush="{StaticResource ChangeIconBrush}"
                                                            EndLineCap="Flat"
                                                            LineJoin="Round"
                                                            StartLineCap="Flat"
                                                            Thickness="32" />
                                                    </GeometryDrawing.Pen>
                                                    <GeometryDrawing.Geometry>
                                                        <RectangleGeometry
                                                            RadiusX="32"
                                                            RadiusY="32"
                                                            Rect="48,80,416,272" />
                                                    </GeometryDrawing.Geometry>
                                                </GeometryDrawing>
                                                <GeometryDrawing>
                                                    <GeometryDrawing.Pen>
                                                        <Pen
                                                            Brush="{StaticResource ChangeIconBrush}"
                                                            EndLineCap="Round"
                                                            LineJoin="Round"
                                                            StartLineCap="Round"
                                                            Thickness="32" />
                                                    </GeometryDrawing.Pen>
                                                    <GeometryDrawing.Geometry>
                                                        <LineGeometry StartPoint="256,416" EndPoint="256,352" />
                                                    </GeometryDrawing.Geometry>
                                                </GeometryDrawing>
                                                <GeometryDrawing>
                                                    <GeometryDrawing.Pen>
                                                        <Pen
                                                            Brush="{StaticResource ChangeIconBrush}"
                                                            EndLineCap="Round"
                                                            LineJoin="Round"
                                                            StartLineCap="Round"
                                                            Thickness="32" />
                                                    </GeometryDrawing.Pen>
                                                    <GeometryDrawing.Geometry>
                                                        <LineGeometry StartPoint="256,80" EndPoint="256,48" />
                                                    </GeometryDrawing.Geometry>
                                                </GeometryDrawing>
                                                <GeometryDrawing>
                                                    <GeometryDrawing.Pen>
                                                        <Pen
                                                            Brush="{StaticResource ChangeIconBrush}"
                                                            EndLineCap="Round"
                                                            LineJoin="Round"
                                                            StartLineCap="Round"
                                                            Thickness="32" />
                                                    </GeometryDrawing.Pen>
                                                    <GeometryDrawing.Geometry>
                                                        <LineGeometry StartPoint="400,464" EndPoint="368,352" />
                                                    </GeometryDrawing.Geometry>
                                                </GeometryDrawing>
                                                <GeometryDrawing>
                                                    <GeometryDrawing.Pen>
                                                        <Pen
                                                            Brush="{StaticResource ChangeIconBrush}"
                                                            EndLineCap="Round"
                                                            LineJoin="Round"
                                                            StartLineCap="Round"
                                                            Thickness="32" />
                                                    </GeometryDrawing.Pen>
                                                    <GeometryDrawing.Geometry>
                                                        <LineGeometry StartPoint="112,464" EndPoint="144,352" />
                                                    </GeometryDrawing.Geometry>
                                                </GeometryDrawing>
                                            </DrawingGroup>
                                        </DrawingImage.Drawing>
                                    </DrawingImage>
                                </Image.Source>
                            </Image>
                        </StackPanel>
                    </Button>
                </Border>
            </Canvas>
        </Border>

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