-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
203 lines (182 loc) · 14.2 KB
/
MainWindow.xaml
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<mah:MetroWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
x:Class="CopyPlusPlus.MainWindow"
mc:Ignorable="d"
TitleCharacterCasing="Normal"
WindowTransitionsEnabled="False"
Title="Copy++ v5.0 本软件完全免费" Height="304" Width="451.067"
ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen"
Closed="MainWindow_Closed" Closing="MainWindow_Closing"
ContentRendered="MainWindow_OnContentRendered"
mah:ValidationHelper.ShowValidationErrorOnMouseOver="True" mah:ValidationHelper.CloseOnMouseLeftButtonDown="True"
NonActiveWindowTitleBrush="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
WindowTitleBrush="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" ShowActivated="False">
<mah:MetroWindow.TitleTemplate>
<DataTemplate>
<TextBlock Text="{TemplateBinding Content}"
TextTrimming="CharacterEllipsis"
VerticalAlignment="Center"
Margin="8 -1 8 0"
FontFamily="Microsoft YaHei UI"
FontWeight="Bold"
FontSize="16" />
</DataTemplate>
</mah:MetroWindow.TitleTemplate>
<mah:MetroWindow.IconTemplate>
<DataTemplate>
<Grid Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Margin="4"
Background="Transparent"
RenderOptions.EdgeMode="Aliased"
RenderOptions.BitmapScalingMode="HighQuality">
<Image Source="copy.ico" />
</Grid>
</DataTemplate>
</mah:MetroWindow.IconTemplate>
<mah:MetroWindow.RightWindowCommands>
<mah:WindowCommands ToolTip="点击跳转至使用文档">
<Button Content="?" FontWeight="Bold" FontSize="15" Click="OpenHandbook" />
</mah:WindowCommands>
</mah:MetroWindow.RightWindowCommands>
<Grid>
<Grid Margin="0,3,0,0" VerticalAlignment="Top" Height="40">
<!--<TextBlock x:Name="TextAbstract1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="22,5,0,0" FontSize="13" Width="403"><Run Text="1. 划词触发" /></TextBlock>-->
<!--<TextBlock x:Name="TextAbstract2" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="22,30,0,0" FontSize="13" Width="403"><Run Text="2. 快捷键触发" /></TextBlock>-->
<mah:ToggleSwitch x:Name="SwitchSelectText" MinWidth="0" ContentDirection="LeftToRight" Content="划词 " FontWeight="Bold" ContentPadding="0,0,-10,0" FontFamily="Microsoft YaHei UI" Margin="216,0,0,0" IsOn="False" />
<mah:ToggleSwitch x:Name="SwitchShortcut" MinWidth="0" ContentDirection="LeftToRight" Content="Control+C+C " FontWeight="Bold" ContentPadding="0,0,-10,0" FontFamily="Microsoft YaHei UI" IsOn="True" Margin="30,0,0,0" />
<Button Content="手动处理" HorizontalAlignment="Left" Margin="343,0,0,0" VerticalAlignment="Center" FontFamily="Microsoft YaHei UI" Click="ManualBtn_Click" Height="26" Width="66" Style="{DynamicResource MahApps.Styles.Button.Flat}" Padding="10,3,10,3" FontSize="11" />
<!--<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="16,46,0,0" FontSize="13" Width="187" Text="祝君创作顺利,走向人生巅峰!" />-->
</Grid>
<Grid Margin="5,47,5,0" Background="#FFEBEBEB" VerticalAlignment="Top" Height="100">
<mah:ToggleSwitch x:Name="SwitchMain" MinWidth="0" ContentDirection="LeftToRight" Content="合并换行"
FontWeight="Bold" ContentPadding="0,0,-10,0" FontFamily="Microsoft YaHei UI"
VerticalAlignment="Top" Margin="6,0,0,0" ToolTip="复制后,自动处理,直接粘贴即可
右键点击,选择是否自动保留原换行" IsOn="True" MouseRightButtonUp="RemainOriginal" />
<mah:ToggleSwitch x:Name="SwitchSpace" MinWidth="0" ContentDirection="LeftToRight" Content="去除空格"
FontWeight="Bold" ContentPadding="0,0,-10,0" FontFamily="Microsoft YaHei UI"
VerticalAlignment="Top" Margin="6,33,0,0" ToolTip="复制英文时小心" />
<mah:ToggleSwitch x:Name="SwitchWidth" MinWidth="0" ContentDirection="LeftToRight" Content="全角转半"
FontWeight="Bold" ContentPadding="0,0,-10,0" FontFamily="Microsoft YaHei UI"
VerticalAlignment="Top" Margin="6,65,0,0" ToolTip="全角转半角" />
<mah:ToggleSwitch x:Name="SwitchTranslate" MinWidth="0" ContentDirection="LeftToRight" Content="翻译开关"
FontWeight="Bold" ContentPadding="0,0,-10,0" FontFamily="Microsoft YaHei UI"
VerticalAlignment="Top" Margin="117,0,0,0" Toggled="Trans_OnToggled"
MouseRightButtonUp="TranslateText_Clicked" ToolTip="右键点击自定义Key" />
<mah:ToggleSwitch x:Name="SwitchManyPopups" MinWidth="0" ContentDirection="LeftToRight" Content="多个弹窗"
FontWeight="Bold" ContentPadding="0,0,-10,0" FontFamily="Microsoft YaHei UI"
VerticalAlignment="Top" Margin="117,33,0,0" ToolTip="开启后,每次翻译都会新弹出一个窗口" IsEnabled="False"
Toggled="SwitchManyPopups_OnToggled" />
<mah:ToggleSwitch x:Name="SwitchAutoStart" MinWidth="0" ContentDirection="LeftToRight" Content="开机启动"
FontWeight="Bold" ContentPadding="0,0,-10,0" FontFamily="Microsoft YaHei UI"
VerticalAlignment="Top" Margin="117,65,0,0" Toggled="SwitchAutoStart_OnToggled" />
<mah:ToggleSwitch x:Name="SwitchPopup" MinWidth="0" ContentDirection="LeftToRight" Content="翻译弹窗"
FontWeight="Bold" ContentPadding="0,0,-10,0" FontFamily="Microsoft YaHei UI"
VerticalAlignment="Top" Margin="229,0,0,0" IsEnabled="False" />
<mah:ToggleSwitch x:Name="SwitchCopyOriginal" MinWidth="0" ContentDirection="LeftToRight" Content="复制原文"
FontWeight="Bold" ContentPadding="0,0,-10,0" FontFamily="Microsoft YaHei UI"
VerticalAlignment="Top" Margin="229,33,0,0" ToolTip="开启后,不再自动复制翻译结果"
IsEnabled="False" Toggled="SwitchManyPopups_OnToggled" />
<!--<mah:ToggleSwitch x:Name="SwitchDictionary" MinWidth="0" ContentDirection="LeftToRight" Content="单词词典" FontWeight="Bold" ContentPadding="0,0,-10,0" FontFamily="Microsoft YaHei UI" VerticalAlignment="Top" Margin="229,65,0,0" IsEnabled="False" Toggled="SwitchManyPopups_OnToggled" />-->
<Button x:Name="AddReplace" FontFamily="Microsoft YaHei UI" Content="自定义替换字符" HorizontalAlignment="Left"
Margin="235,68,0,0" VerticalAlignment="Top" Width="92" Click="DiyReplace" Style="{DynamicResource MahApps.Styles.Button.Flat}" FontSize="11" Padding="5,5,5,5" />
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="338,9,0,0" FontWeight="Bold"
FontSize="11" FontFamily="Microsoft YaHei UI">
从
</TextBlock>
<ComboBox x:Name="TransFromComboBox" HorizontalAlignment="Right" Margin="0,3,5.8,0" VerticalAlignment="Top"
FontFamily="Microsoft YaHei UI" FontSize="11" Width="78"
SelectionChanged="TransFromComboBox_SelectionChanged">
<ComboBoxItem IsSelected="True" Content="检测语言" />
<ComboBoxItem Content="中文" />
<ComboBoxItem Content="英语" />
<ComboBoxItem Content="日语" />
<ComboBoxItem Content="法语" />
<ComboBoxItem Content="德语" />
<ComboBoxItem Content="俄语" />
<ComboBoxItem Content="韩语" />
<ComboBoxItem Content="繁体中文" />
<!--<ComboBoxItem Content="文言文" />-->
</ComboBox>
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="338,42,0,0" FontWeight="Bold"
FontSize="11" FontFamily="Microsoft YaHei UI">
到
</TextBlock>
<ComboBox x:Name="TransToComboBox" HorizontalAlignment="Right" Margin="0,36,5.8,0" VerticalAlignment="Top"
FontFamily="Microsoft YaHei UI" FontSize="11" Width="78"
SelectionChanged="TransToComboBox_SelectionChanged">
<ComboBoxItem IsSelected="True" Content="中文" />
<ComboBoxItem Content="英语" />
<ComboBoxItem Content="日语" />
<ComboBoxItem Content="法语" />
<ComboBoxItem Content="德语" />
<ComboBoxItem Content="俄语" />
<ComboBoxItem Content="韩语" />
<ComboBoxItem Content="繁体中文" />
<!--<ComboBoxItem Content="文言文" />-->
</ComboBox>
<!--<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" FontWeight="Bold" FontSize="14" Margin="246,68,0,0">翻译引擎</TextBlock>-->
<ComboBox x:Name="TransEngineComboBox" HorizontalAlignment="Right" VerticalAlignment="Top"
FontFamily="Microsoft YaHei UI" Margin="0,68,5.8,0" Width="91"
SelectionChanged="TransEngineComboBox_SelectionChanged">
<ComboBoxItem IsSelected="True">谷歌翻译</ComboBoxItem>
<ComboBoxItem>百度翻译</ComboBoxItem>
<ComboBoxItem ToolTip="目前仅支持英译中。DeepL虽好,但服务器不稳定,翻译速度有时会极慢,属正常现象。" Selected="DeepL_OnSelected"
Unselected="DeepL_OnUnselected">
DeepL
</ComboBoxItem>
</ComboBox>
<!--<Line X1="0" Y1="0" X2="0" Y2="100" Stroke="DimGray" StrokeThickness="2" Margin="112,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
<Line X1="0" Y1="0" X2="0" Y2="100" Stroke="DimGray" StrokeThickness="2" Margin="224,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
<Line X1="0" Y1="0" X2="0" Y2="100" Stroke="DimGray" StrokeThickness="2" Margin="334,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />-->
</Grid>
<!--<Line X1="0" Y1="0" X2="450" Y2="0" Stroke="#FF3A4FEE" StrokeThickness="2" Margin="0,126,0.4,0" VerticalAlignment="Top" />-->
<Grid VerticalAlignment="Top" Margin="0,154,0,0">
<StackPanel Margin="22,-3,0,0" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top">
<StackPanel.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Margin" Value="0,15,0,0" />
</Style>
</StackPanel.Resources>
<TextBlock x:Name="TextBlockGithub" HorizontalAlignment="Left" TextWrapping="Wrap"
TextAlignment="Center" FontSize="14" VerticalAlignment="Top">
<Run Text="项目已开源,欢迎Star" />
</TextBlock>
<TextBlock x:Name="TextBlockContact" HorizontalAlignment="Left" TextWrapping="Wrap"
TextAlignment="Center" FontSize="14" VerticalAlignment="Top">
<Run Text="遇到问题,可在公众号给我留言" />
</TextBlock>
<!--<TextBlock x:Name="TextBlockGzh" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" TextAlignment="Center" FontSize="14"><Run Text="新版本会通过该公众号发布,欢迎关注" /></TextBlock>-->
<TextBlock x:Name="TextBlockPay" HorizontalAlignment="Left" TextWrapping="Wrap"
TextAlignment="Center" FontSize="14" VerticalAlignment="Top">
<Run Text="如果您觉得好用,点击" />
<Run Text="这里" ToolTip="感谢您的支持!" MouseUp="ShowPay" FontWeight="Bold" Cursor="Hand" />
<Run Text="请我吃肉" />
</TextBlock>
</StackPanel>
<emoji:TextBlock x:Name="Meat" FontSize="18" Text="🍖" Margin="256,75,0,0" HorizontalAlignment="Left"
VerticalAlignment="Top" MouseDown="MeatDown" MouseUp="MeatUp" MouseLeave="MeatLeave"
Cursor="Hand" />
<Button Margin="166,8,0,0" Click="Github_Click" Cursor="Hand" VerticalAlignment="Top"
ToolTip="点击跳转到Github" HorizontalAlignment="Left" Height="22" Width="18">
<Button.Template>
<ControlTemplate>
<!--<iconPacks:PackIconFeatherIcons Kind="Github" Background="Transparent" />-->
<Image Source="/images/GitHub.png" />
</ControlTemplate>
</Button.Template>
</Button>
<Image Source="/images/wechatgzh.png" VerticalAlignment="Center" HorizontalAlignment="Left"
ToolTip="听说这里有新版本,还有许多好玩的" Margin="311,0,0,0" Height="110" Width="110" />
<!--<TextBlock x:Name="TextBlockGzh" HorizontalAlignment="Left" Margin="231,0,0,0" TextWrapping="Wrap" FontSize="10" TextAlignment="Center" VerticalAlignment="Center" LineHeight="14"><Run Text="关 注 公 众 号" /><LineBreak /><Run Language="zh-cn" Text="获 取 船 新 版 本" /></TextBlock>-->
</Grid>
<!--<Line X1="0" Y1="0" X2="450" Y2="0" Stroke="#FF3A4FEE" StrokeThickness="2" Margin="0,206,0,0" VerticalAlignment="Top" />-->
</Grid>
<!--<Window.CommandBindings>
<CommandBinding Command="{x:Static copyPlusPlus:MainWindow.Copy}" Executed="MyCommandExecuted" />
</Window.CommandBindings>-->
</mah:MetroWindow>