forked from FeynmanXie/FastScreeny
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditorWindow.xaml
More file actions
159 lines (145 loc) · 9 KB
/
EditorWindow.xaml
File metadata and controls
159 lines (145 loc) · 9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<Window x:Class="FastScreeny.EditorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Edit Screenshot" Height="720" Width="1080"
WindowStartupLocation="CenterScreen" Background="#0F1115">
<Window.Resources>
<!-- 美化按钮样式 -->
<Style x:Key="ToolButton" TargetType="Button">
<Setter Property="Background" Value="#2A2F3A"/>
<Setter Property="Foreground" Value="#E5E7EB"/>
<Setter Property="BorderBrush" Value="#404756"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="12,6"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="ButtonBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4" Padding="{TemplateBinding Padding}">
<Border.RenderTransform>
<TranslateTransform x:Name="ButtonTransform"/>
</Border.RenderTransform>
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#374151"/>
<Setter TargetName="ButtonBorder" Property="BorderBrush" Value="#60A5FA"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#1F2937"/>
<Setter TargetName="ButtonBorder" Property="BorderBrush" Value="#3B82F6"/>
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="ButtonTransform"
Storyboard.TargetProperty="X"
To="1" Duration="0:0:0.1"/>
<DoubleAnimation Storyboard.TargetName="ButtonTransform"
Storyboard.TargetProperty="Y"
To="1" Duration="0:0:0.1"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="ButtonTransform"
Storyboard.TargetProperty="X"
To="0" Duration="0:0:0.1"/>
<DoubleAnimation Storyboard.TargetName="ButtonTransform"
Storyboard.TargetProperty="Y"
To="0" Duration="0:0:0.1"/>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 主要操作按钮样式 -->
<Style x:Key="PrimaryButton" TargetType="Button" BasedOn="{StaticResource ToolButton}">
<Setter Property="Background" Value="#5B8DEF"/>
<Setter Property="BorderBrush" Value="#4A7BDB"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#4A7BDB"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- 危险操作按钮样式 -->
<Style x:Key="DangerButton" TargetType="Button" BasedOn="{StaticResource ToolButton}">
<Setter Property="Background" Value="#DC2626"/>
<Setter Property="BorderBrush" Value="#B91C1C"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#B91C1C"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 绘制工具栏 -->
<Border Grid.Row="0" Background="#151821" Padding="16,12">
<StackPanel>
<TextBlock Text="Drawing Tools" Foreground="#9AA4B2" FontSize="14" Margin="0,0,0,8"/>
<StackPanel Orientation="Horizontal">
<Button x:Name="DrawingModeBtn" Content="🎨 Drawing Mode" Style="{StaticResource PrimaryButton}" Margin="0,0,16,0" Click="DrawingModeBtn_Click"/>
<TextBlock Text="Brush Preset" Foreground="#9AA4B2" VerticalAlignment="Center" Margin="0,0,8,0"/>
<ComboBox x:Name="BrushPresetBox" Width="180" Margin="0,0,16,0"/>
<Button x:Name="ToolCircleBtn" Content="⭕ Circle" Style="{StaticResource ToolButton}" Margin="0,0,8,0" Click="ToolCircleBtn_Click"/>
<Button x:Name="ToolRectBtn" Content="⬛ Rectangle" Style="{StaticResource ToolButton}" Margin="0,0,8,0" Click="ToolRectBtn_Click"/>
<Button x:Name="ToolArrowBtn" Content="➡️ Arrow" Style="{StaticResource ToolButton}" Margin="0,0,16,0" Click="ToolArrowBtn_Click"/>
<Button x:Name="ClearBtn" Content="🗑️ Clear Annotations" Style="{StaticResource DangerButton}" Margin="0,0,0,0" Click="ClearBtn_Click"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 编辑与边框设置栏 -->
<Border Grid.Row="1" Background="#1A1F29" Padding="16,12">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- 边框设置 -->
<StackPanel Grid.Column="2" Orientation="Horizontal">
<CheckBox x:Name="EnableBorderCheck" Content="🖼️ Enable Border" Foreground="#E5E7EB" VerticalAlignment="Center" Margin="0,0,16,0"/>
<TextBlock Text="Thickness" Foreground="#9AA4B2" VerticalAlignment="Center" Margin="0,0,6,0"/>
<TextBox x:Name="BorderThicknessBox" Width="60" Margin="0,0,12,0"/>
<TextBlock Text="Preset" Foreground="#9AA4B2" VerticalAlignment="Center" Margin="0,0,6,0"/>
<ComboBox x:Name="BorderPresetBox" Width="160" Margin="0,0,8,0"/>
<TextBox x:Name="BorderStartColorBox" Width="100" Margin="0,0,6,0"/>
<TextBox x:Name="BorderEndColorBox" Width="100"/>
</StackPanel>
</Grid>
</Border>
<!-- 编辑区域 -->
<ScrollViewer Grid.Row="2" Background="#0F1115">
<Grid x:Name="EditRoot" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image x:Name="PreviewImage" Stretch="None" Visibility="Collapsed"/>
<Image x:Name="BaseImage" Stretch="None"/>
<Canvas x:Name="OverlayCanvas" Background="Transparent" MouseLeftButtonDown="OverlayCanvas_MouseLeftButtonDown" MouseMove="OverlayCanvas_MouseMove" MouseLeftButtonUp="OverlayCanvas_MouseLeftButtonUp"/>
</Grid>
</ScrollViewer>
<!-- 底部操作 -->
<Border Grid.Row="3" Background="#151821" Padding="16,12">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="SaveBtn" Content="💾 Save" Style="{StaticResource PrimaryButton}" Width="120" Margin="0,0,12,0" Click="SaveBtn_Click"/>
<Button x:Name="CloseBtn" Content="❌ Close" Style="{StaticResource ToolButton}" Width="120" Click="CloseBtn_Click"/>
</StackPanel>
</Border>
</Grid>
</Window>