<UserControl x:Class="Ink_Canvas.Controls.QuickDrawFloatingButtonControl"
             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"
             mc:Ignorable="d"
             Width="65" Height="45">
    
    <Border Background="{DynamicResource QuickDrawFloatingButtonBackground}" 
            CornerRadius="8" 
            BorderThickness="1" 
            BorderBrush="{DynamicResource QuickDrawFloatingButtonBorderBrush}">
        <Border.Effect>
            <DropShadowEffect Color="Black" Direction="315" ShadowDepth="3" Opacity="0.3" BlurRadius="5"/>
        </Border.Effect>
        
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="22"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            
            <!-- 拖动区域 -->
            <Border Grid.Column="0" 
                    MouseLeftButtonDown="DragArea_MouseLeftButtonDown"
                    MouseMove="DragArea_MouseMove"
                    MouseLeftButtonUp="DragArea_MouseLeftButtonUp"
                    Cursor="SizeAll"
                    Background="Transparent">
                <Grid VerticalAlignment="Center" Height="14" IsHitTestVisible="False">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="4"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="4"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    
                    <!-- 三个白色横线 -->
                    <Border Grid.Row="0" Background="{DynamicResource QuickDrawFloatingButtonIconForeground}" Height="2" Width="10" 
                            HorizontalAlignment="Center" 
                            CornerRadius="1" Opacity="0.8" IsHitTestVisible="False"/>
                    <Border Grid.Row="2" Background="{DynamicResource QuickDrawFloatingButtonIconForeground}" Height="2" Width="10" 
                            HorizontalAlignment="Center" 
                            CornerRadius="1" Opacity="0.8" IsHitTestVisible="False"/>
                    <Border Grid.Row="4" Background="{DynamicResource QuickDrawFloatingButtonIconForeground}" Height="2" Width="10" 
                            HorizontalAlignment="Center" 
                            CornerRadius="1" Opacity="0.8" IsHitTestVisible="False"/>
                </Grid>
            </Border>
            
            <!-- 半透明分割线 -->
            <Rectangle Grid.Column="1" Width="1" Fill="#20FFFFFF" Margin="0,8,0,8"/>
            
            <!-- 按钮区域 -->
            <Border Grid.Column="2" 
                    MouseLeftButtonDown="FloatingButton_Click" 
                    Cursor="Hand"
                    Background="Transparent">
                <Grid IsHitTestVisible="False">
                    <Path Data="M5 7C5 8.06087 5.42143 9.07828 6.17157 9.82843C6.92172 10.5786 7.93913 11 9 11C10.0609 11 11.0783 10.5786 11.8284 9.82843C12.5786 9.07828 13 8.06087 13 7C13 5.93913 12.5786 4.92172 11.8284 4.17157C11.0783 3.42143 10.0609 3 9 3C7.93913 3 6.92172 3.42143 6.17157 4.17157C5.42143 4.92172 5 5.93913 5 7Z M3 21V19C3 17.9391 3.42143 16.9217 4.17157 16.1716C4.92172 15.4214 5.93913 15 7 15H11C12.0609 15 13.0783 15.4214 13.8284 16.1716C14.5786 16.9217 15 17.9391 15 19V21 M16 3.13C16.8604 3.35031 17.623 3.85071 18.1676 4.55232C18.7122 5.25392 19.0078 6.11683 19.0078 7.005C19.0078 7.89318 18.7122 8.75608 18.1676 9.45769C17.623 10.1593 16.8604 10.6597 16 10.88 M21 21V19C20.9949 18.1172 20.6979 17.2608 20.1553 16.5644C19.6126 15.868 18.8548 15.3707 18 15.15" 
                          Stroke="{DynamicResource QuickDrawFloatingButtonIconForeground}" 
                          StrokeThickness="2" 
                          StrokeLineJoin="Round" 
                          Fill="Transparent" 
                          Width="20" Height="20" 
                          Stretch="Uniform" 
                          HorizontalAlignment="Center" 
                          VerticalAlignment="Center"
                          IsHitTestVisible="False"/>
                </Grid>
            </Border>
        </Grid>
    </Border>
</UserControl>

