<customControls:AnimatedMenu
    IsOpen="{CompiledBinding MainWindow.IsToolsMenuVisible.Value}"
    mc:Ignorable="d"
    x:Class="PicView.Avalonia.Views.UC.Menus.ToolsMenu"
    x:DataType="viewModels:MainViewModel"
    xmlns="https://github.com/avaloniaui"
    xmlns:customControls="clr-namespace:PicView.Avalonia.CustomControls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewModels="clr-namespace:PicView.Avalonia.ViewModels"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Design.DataContext>
        <viewModels:MainViewModel />
    </Design.DataContext>

    <UserControl.Resources>
        <SolidColorBrush Color="{DynamicResource MainTextColor}" x:Key="BatchBrush" />
        <SolidColorBrush Color="{DynamicResource MainTextColor}" x:Key="EffectsBrush" />
        <SolidColorBrush Color="{DynamicResource MainTextColor}" x:Key="ImageInfoBrush" />
        <SolidColorBrush Color="{DynamicResource MainTextColor}" x:Key="OptimizeBrush" />
        <SolidColorBrush Color="{DynamicResource MainTextColor}" x:Key="ChangeBgBrush" />
        <SolidColorBrush Color="{DynamicResource MainTextColor}" x:Key="KeybindingBrush" />
        <SolidColorBrush Color="{DynamicResource MainTextColor}" x:Key="InterfaceBrush" />
    </UserControl.Resources>

    <StackPanel>

        <Border
            Background="{DynamicResource MenuBackgroundColor}"
            BorderBrush="{DynamicResource OuterBorderColor}"
            BorderThickness="1"
            CornerRadius="8"
            Effect="{DynamicResource MenuShadowButtonBorder}"
            x:Name="MainBorder">
            <Canvas Height="208" Width="359">

                <Border
                    Background="{DynamicResource SecondaryBackgroundColor}"
                    BorderBrush="{DynamicResource OuterBorderColor}"
                    BorderThickness="0,0,0,1"
                    CornerRadius="8,8,0,0"
                    Height="47"
                    Width="359"
                    x:Name="TopBorder" />

                <customControls:TextIconButton
                    Background="Transparent"
                    BorderBrush="{DynamicResource MainBorderColor}"
                    BorderThickness="0,0,1,0"
                    Canvas.Left="-1"
                    Canvas.Top="-1"
                    Classes="noBorderHover"
                    Command="{CompiledBinding Window.ShowBatchResizeWindow}"
                    CornerRadius="8,0,0,0"
                    FontSize="14"
                    Foreground="{StaticResource BatchBrush}"
                    Height="46"
                    Icon="{StaticResource BatchResizeImage}"
                    IconHeight="22"
                    IconMargin="17,0,0,0"
                    IconWidth="22"
                    Text="{CompiledBinding Translation.BatchResize.Value,
                                           Mode=OneWay}"
                    TextMargin="10,0,7,0"
                    TextMaxWidth="130"
                    ToolTip.Tip="{CompiledBinding Translation.BatchResize.Value,
                                                  Mode=OneWay}"
                    Width="180"
                    x:Name="BatchResizeButton" />

                <customControls:TextIconButton
                    Background="Transparent"
                    BorderBrush="{DynamicResource MainBorderColor}"
                    BorderThickness="0,0,1,0"
                    Canvas.Left="179"
                    Canvas.Top="-1"
                    Classes="noBorderHover"
                    Command="{CompiledBinding Window.ShowEffectsWindow}"
                    FontSize="14"
                    Foreground="{StaticResource EffectsBrush}"
                    Height="46"
                    Icon="{StaticResource FlaskImage}"
                    IconHeight="20"
                    IconMargin="11,0,0,0"
                    IconWidth="20"
                    Text="{CompiledBinding Translation.Effects.Value,
                                           Mode=OneWay}"
                    TextMargin="10,0,6,0"
                    ToolTip.Tip="{CompiledBinding Translation.EffectsTooltip.Value,
                                                  Mode=OneWay}"
                    Width="136"
                    x:Name="EffectsButton" />

                <customControls:IconButton
                    Background="Transparent"
                    Canvas.Left="315"
                    Canvas.Top="-1"
                    Classes="hover"
                    ClickMode="Release"
                    Command="{CompiledBinding MainWindow.CloseMenuCommand}"
                    CornerRadius="0,8,0,0"
                    Data="{StaticResource CloseGeometry}"
                    Foreground="{DynamicResource MainTextColor}"
                    Height="46"
                    IconHeight="10"
                    IconWidth="10"
                    ToolTip.Tip="{CompiledBinding Translation.Close.Value,
                                                  Mode=OneWay}"
                    Width="45" />

                <customControls:TextIconButton
                    Background="{DynamicResource MenuButtonColor}"
                    Canvas.Left="7"
                    Canvas.Top="53"
                    Classes="ButtonBorder altHover"
                    Command="{CompiledBinding Window.ShowImageInfoWindow}"
                    Data="{StaticResource ImageInfoGeometry}"
                    Foreground="{StaticResource ImageInfoBrush}"
                    Height="46"
                    IconHeight="17"
                    IconMargin="9,0,2,0"
                    IconWidth="17"
                    Text="{CompiledBinding Translation.ImageInfo.Value,
                                           Mode=OneWay}"
                    TextMargin="10,0,6,0"
                    TextMaxWidth="132"
                    Width="169"
                    x:Name="ImageInfoButton" />

                <customControls:TextIconButton
                    Background="{DynamicResource MenuButtonColor}"
                    Canvas.Left="182"
                    Canvas.Top="53"
                    Classes="ButtonBorder altHover"
                    Command="{CompiledBinding Tools.OptimizeImageCommand}"
                    Foreground="{StaticResource OptimizeBrush}"
                    Height="46"
                    Icon="{StaticResource PortalImage}"
                    IconHeight="20"
                    IconMargin="9,0,10,0"
                    IconWidth="20"
                    IsEnabled="{CompiledBinding PicViewer.ShouldOptimizeImageBeEnabled.Value,
                                                Mode=OneWay}"
                    Text="{CompiledBinding Translation.OptimizeImage.Value,
                                           Mode=OneWay}"
                    ToolTip.Tip="{CompiledBinding Translation.OptimizeImage.Value,
                                                  Mode=OneWay}"
                    Width="169"
                    x:Name="OptimizeImageButton" />

                <customControls:TextIconButton
                    Background="{DynamicResource MenuButtonColor}"
                    Canvas.Left="7"
                    Canvas.Top="104"
                    Classes="ButtonBorder altHover"
                    Data="{StaticResource BrushGeometry}"
                    Foreground="{DynamicResource DisabledTextColor}"
                    Height="46"
                    IconHeight="17"
                    IconMargin="9,0,12,0"
                    IconWidth="17"
                    IsEnabled="False"
                    Text="{CompiledBinding Translation.ColorPickerTool.Value,
                                           Mode=OneWay}"
                    ToolTip.Tip="{CompiledBinding Translation.ColorPickerToolTooltip.Value,
                                                  Mode=OneWay}"
                    Width="169" />

                <customControls:TextIconButton
                    Background="{DynamicResource MenuButtonColor}"
                    Canvas.Left="182"
                    Canvas.Top="104"
                    Classes="ButtonBorder altHover"
                    Command="{CompiledBinding Tools.ChangeBackgroundCommand}"
                    Foreground="{StaticResource ChangeBgBrush}"
                    Height="46"
                    Icon="{StaticResource PaletteImage}"
                    IconHeight="17"
                    IconMargin="10,0,10,0"
                    IconWidth="17"
                    Text="{CompiledBinding Translation.ChangeBackground.Value,
                                           Mode=OneWay}"
                    Width="169"
                    x:Name="ChangeBgButton" />

                <customControls:TextIconButton
                    Background="{DynamicResource MenuButtonColor}"
                    Canvas.Left="7"
                    Canvas.Top="155"
                    Classes="ButtonBorder altHover"
                    Command="{CompiledBinding Window.ShowKeybindingsWindow}"
                    Foreground="{StaticResource KeybindingBrush}"
                    Height="46"
                    Icon="{StaticResource ShortcutsImage}"
                    IconHeight="18"
                    IconMargin="9,0,12,0"
                    IconWidth="18"
                    Text="{CompiledBinding Translation.ApplicationShortcuts.Value,
                                           Mode=OneWay}"
                    ToolTip.Tip="{CompiledBinding Translation.ApplicationShortcuts.Value,
                                                  Mode=OneWay}"
                    Width="169"
                    x:Name="KeybindingsButton" />

                <customControls:TextIconButton
                    Background="{DynamicResource MenuButtonColor}"
                    Canvas.Left="182"
                    Canvas.Top="155"
                    Classes="ButtonBorder altHover"
                    Command="{CompiledBinding Tools.ToggleUICommand}"
                    Foreground="{StaticResource InterfaceBrush}"
                    Height="46"
                    Icon="{StaticResource EyeOffImage}"
                    IconHeight="20"
                    IconMargin="11,0,12,0"
                    IconWidth="20"
                    Text="{CompiledBinding Translation.IsShowingUI.Value,
                                           Mode=OneWay}"
                    Width="169"
                    x:Name="InterfaceButton" />

            </Canvas>
        </Border>
        <Polygon
            Fill="{DynamicResource MenuBackgroundColor}"
            Margin="290,-1,0,0"
            Points="0,0 15,30, 30,0"
            Stroke="{DynamicResource MainBorderColor}"
            StrokeThickness="1"
            x:Name="DownArrow" />
    </StackPanel>
</customControls:AnimatedMenu>