|
1 |
| -<Window Title="Minecraft Mods Translator" |
2 |
| - Height="600" |
3 |
| - MinHeight="600" |
4 |
| - MinWidth="960" |
5 |
| - Width="960" |
6 |
| - x:Class="Translator.MainWindow" |
7 |
| - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
8 |
| - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
9 |
| - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
10 |
| - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
11 |
| - xmlns:pu="clr-namespace:Panuon.UI.Silver;assembly=Panuon.UI.Silver" xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit" |
12 |
| - mc:Ignorable="d"> |
| 1 | +<mah:MetroWindow Title="Minecraft Mods Translator" |
| 2 | + Height="600" |
| 3 | + MinHeight="600" |
| 4 | + MinWidth="960" |
| 5 | + Width="960" |
| 6 | + x:Class="Translator.MainWindow" |
| 7 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 8 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 9 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 10 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 11 | + xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit" |
| 12 | + xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" |
| 13 | + xmlns:hltb="clr-namespace:HighlightTextBlock;assembly=HighlightTextBlock" |
| 14 | + xmlns:translator="clr-namespace:Translator" |
| 15 | + xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" |
| 16 | + mc:Ignorable="d"> |
13 | 17 | <Window.Resources>
|
14 | 18 | <RoutedUICommand x:Key="onCtrlSPress"/>
|
15 | 19 | <Style TargetType="{x:Type Button}" x:Key="LeftButtonStyle">
|
16 | 20 | <Setter Property="Height" Value="60" />
|
17 |
| - <Setter Property="Background" Value="#BDBDBD" /> |
| 21 | + <Setter Property="Background" Value="WhiteSmoke" /> |
18 | 22 | <Setter Property="FontSize" Value="20" />
|
19 | 23 | <Setter Property="BorderThickness" Value="0" />
|
20 | 24 | <Setter Property="Foreground" Value="White"></Setter>
|
|
50 | 54 | Command="{StaticResource onCtrlSPress}"
|
51 | 55 | Executed="CtrlSOnExecuted"/>
|
52 | 56 | </Window.CommandBindings>
|
| 57 | + |
| 58 | + <mah:MetroWindow.RightWindowCommands> |
| 59 | + <mah:WindowCommands> |
| 60 | + <Button Click="OpenGithubSite" ToolTip="打开Github页面"> |
| 61 | + <iconPacks:Unicons Width="22" |
| 62 | + Height="22" |
| 63 | + Kind="Github" /> |
| 64 | + </Button> |
| 65 | + </mah:WindowCommands> |
| 66 | + </mah:MetroWindow.RightWindowCommands> |
| 67 | + |
53 | 68 | <Grid Loaded="Grid_Loaded">
|
54 | 69 | <Grid.ColumnDefinitions>
|
55 | 70 | <ColumnDefinition Width="*" />
|
|
58 | 73 | </Grid.ColumnDefinitions>
|
59 | 74 |
|
60 | 75 | <TextBlock
|
61 |
| - Text="版本:0.1.4" |
| 76 | + Text="版本:0.2" |
62 | 77 | Grid.Column="2"
|
63 | 78 | HorizontalAlignment="Right"
|
64 | 79 | VerticalAlignment="Bottom"
|
|
70 | 85 | Margin="10">
|
71 | 86 | <StackPanel
|
72 | 87 | VerticalAlignment="Top"
|
73 |
| - Background="#BDBDBD" |
| 88 | + Background="WhiteSmoke" |
74 | 89 | >
|
75 |
| - <Button Content="打开" Style="{StaticResource LeftButtonStyle}" Click="OpenFileOnClick"/> |
76 |
| - <Button Content="保存" Style="{StaticResource LeftButtonStyle}" Click="SaveFileOnClick"/> |
| 90 | + <Button Content="打开" Foreground="Black" Style="{StaticResource LeftButtonStyle}" Click="OpenFileOnClick"/> |
| 91 | + <Button Content="保存" Foreground="Black" Style="{StaticResource LeftButtonStyle}" Click="SaveFileOnClick"/> |
77 | 92 | </StackPanel>
|
78 | 93 | <Separator Opacity="0" Height="20"/>
|
79 | 94 | <StackPanel
|
80 | 95 | HorizontalAlignment="Center">
|
81 |
| - <CheckBox x:Name="ReviewCheckBox">审阅模式</CheckBox> |
| 96 | + <mah:ToggleSwitch x:Name="ReviewCheckBox">审阅模式</mah:ToggleSwitch> |
82 | 97 | <Separator Opacity="0" Height="10"/>
|
83 |
| - <CheckBox x:Name="MarkCheckBox" Checked="MarkCheckBox_OnChecked" Unchecked="MarkCheckBox_OnUnchecked">标记中英文重复</CheckBox> |
| 98 | + <mah:ToggleSwitch x:Name="MarkCheckBox" Toggled="MarkCheckBox_OnToggled">标记中英文重复</mah:ToggleSwitch> |
| 99 | + <Separator Opacity="0" Height="10"/> |
| 100 | + <mah:ToggleSwitch x:Name="TransCheckBox" Toggled="TransCheckBox_OnToggled">机翻</mah:ToggleSwitch> |
84 | 101 | <Separator Opacity="0" Height="10"/>
|
85 |
| - <CheckBox x:Name="TransCheckBox" Checked="TransCheckBox_OnChecked" Unchecked="TransCheckBox_OnUnchecked">机翻</CheckBox> |
86 | 102 | </StackPanel>
|
87 | 103 | </StackPanel>
|
88 | 104 | <Border
|
|
136 | 152 | IsReadOnly="True"
|
137 | 153 | BorderBrush="Gray"
|
138 | 154 | BorderThickness="1"
|
139 |
| - ShowLineNumbers="True"/> |
| 155 | + ShowLineNumbers="True" |
| 156 | + ScrollViewer.HorizontalScrollBarVisibility="Hidden"/> |
140 | 157 | </Grid>
|
141 | 158 | <Grid Grid.Row="2">
|
142 | 159 | <Grid.RowDefinitions>
|
|
151 | 168 | BorderBrush="Gray"
|
152 | 169 | BorderThickness="1"
|
153 | 170 | ShowLineNumbers="True"
|
| 171 | + ScrollViewer.HorizontalScrollBarVisibility="Hidden" |
154 | 172 | TextChanged="AvalonEditor_OnTextChanged"/>
|
155 | 173 | </Grid>
|
156 | 174 | <Grid Grid.Row="3" Visibility="Hidden" x:Name="TransHidden1">
|
157 | 175 | <Grid.RowDefinitions>
|
158 | 176 | <RowDefinition Height="*"></RowDefinition>
|
159 | 177 | <RowDefinition Height="2*"></RowDefinition>
|
160 | 178 | </Grid.RowDefinitions>
|
161 |
| - <Label Grid.Row="0" Content="系统推荐翻译(点击选择)" Background="White" FontSize="11"></Label> |
| 179 | + <Label Grid.Row="0" Content="系统翻译(点击选择)" Background="White" FontSize="11"></Label> |
162 | 180 | <ItemsControl x:Name="TranslateSelector" Grid.Row="1">
|
163 | 181 | <ItemsControl.ItemsPanel>
|
164 | 182 | <ItemsPanelTemplate>
|
|
178 | 196 | Foreground="Black"
|
179 | 197 | BorderThickness="0"
|
180 | 198 | FontFamily="misans"
|
181 |
| - pu:ButtonHelper.HoverBackground="#6CBCEA" |
182 |
| - pu:ButtonHelper.HoverForeground="White" |
183 | 199 | Click="TransSelectClick"/>
|
184 | 200 | </DataTemplate>
|
185 | 201 | </ItemsControl.ItemTemplate>
|
|
210 | 226 | <RowDefinition Height="*"></RowDefinition>
|
211 | 227 | </Grid.RowDefinitions>
|
212 | 228 | <Button Grid.Row="0" BorderThickness="1" Content="提交" Click="SubmitOnClick" Margin="0,5"
|
213 |
| - Background="#6CBCEA" |
214 |
| - Foreground="White" |
215 |
| - pu:ButtonHelper.CornerRadius="3" |
216 |
| - pu:ShadowHelper.Direction="240"/> |
| 229 | + Background="WhiteSmoke" |
| 230 | + Foreground="Black"/> |
217 | 231 | <Button Grid.Row="1" BorderThickness="1" Content="跳过" Click="SkipOnClick" Margin="0,5"
|
218 |
| - Background="#6CBCEA" |
219 |
| - Foreground="White" |
220 |
| - pu:ButtonHelper.CornerRadius="3" |
221 |
| - pu:ShadowHelper.Direction="240"/> |
| 232 | + Background="WhiteSmoke" |
| 233 | + Foreground="Black"/> |
222 | 234 | <Button Grid.Row="2" BorderThickness="1" Content="上一个" Click="LastOnClick" Margin="0,5"
|
223 |
| - Background="#5CACDA" |
224 |
| - Foreground="White" |
225 |
| - pu:ButtonHelper.CornerRadius="3" |
226 |
| - pu:ShadowHelper.Direction="240"/> |
| 235 | + Background="WhiteSmoke" |
| 236 | + Foreground="Black"/> |
227 | 237 | </Grid>
|
228 | 238 |
|
229 | 239 | </Grid>
|
230 | 240 |
|
231 | 241 |
|
232 | 242 |
|
233 | 243 |
|
234 |
| - <Grid Grid.Row="0" Grid.Column="0" Background="#8FBC8F" x:Name="WordListLayout" Margin="10,10"> |
| 244 | + <Grid Grid.Row="0" Grid.Column="0" Background="White" x:Name="WordListLayout" Margin="10,10"> |
235 | 245 | <Grid.RowDefinitions>
|
236 |
| - <RowDefinition Height="2*"></RowDefinition> |
| 246 | + <RowDefinition Height="0.8*"></RowDefinition> |
| 247 | + <RowDefinition Height="1.2*"></RowDefinition> |
237 | 248 | <RowDefinition Height="11*"></RowDefinition>
|
238 | 249 | </Grid.RowDefinitions>
|
239 |
| - <Label Grid.Row="0" Background="#8FBC8F" Content="模组词库列表" FontFamily="misans" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" x:Name="ViewCount"/> |
240 |
| - <ListBox Grid.Row="1" Background="#AFDCAF" x:Name="TransWordList" SelectionChanged="TransWordList_OnSelectionChanged"> |
| 250 | + <Label Grid.Row="0" Background="White" Content="模组词库列表" FontFamily="misans" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Black" x:Name="ViewCount"/> |
| 251 | + <TextBox Grid.Row="1" Height="40" Margin="0,0,40,10" VerticalContentAlignment="Center" x:Name="SearchBox" TextChanged="SearchBox_OnTextChanged"/> |
| 252 | + <Button Grid.Row="1" HorizontalAlignment="Right" Height="40" Width="40" Margin="0,0,0,10">🔍</Button> |
| 253 | + <Border Grid.Row="2" BorderBrush="Gainsboro" BorderThickness="1"> |
| 254 | + <ListBox Background="White" x:Name="TransWordList" SelectionChanged="TransWordList_OnSelectionChanged" ScrollViewer.HorizontalScrollBarVisibility="Hidden"> |
| 255 | + <ListBox.ItemTemplate> |
| 256 | + <DataTemplate> |
| 257 | + <Border BorderBrush="Beige" BorderThickness="1"> |
| 258 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Background="White"> |
| 259 | + <TextBlock |
| 260 | + VerticalAlignment="Center" |
| 261 | + Foreground="{Binding Color}" |
| 262 | + Text="{Binding Judge}"/> |
| 263 | + <StackPanel> |
| 264 | + <TextBlock |
| 265 | + Text="{Binding EnText}" |
| 266 | + Margin="5,0" |
| 267 | + Height="20" |
| 268 | + Foreground="{Binding Background}"/> |
| 269 | + <TextBlock |
| 270 | + Text="{Binding ZhText}" |
| 271 | + Margin="5,0" |
| 272 | + Height="20" |
| 273 | + Foreground="{Binding Background}"/> |
| 274 | + </StackPanel> |
| 275 | + </StackPanel> |
| 276 | + </Border> |
| 277 | + </DataTemplate> |
| 278 | + </ListBox.ItemTemplate> |
| 279 | + </ListBox> |
| 280 | + </Border> |
| 281 | + <ListBox Grid.Row="2" Background="White" x:Name="SearchWordList" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Visibility="Hidden" SelectionChanged="SearchWordList_OnSelectionChanged"> |
241 | 282 | <ListBox.ItemTemplate>
|
242 | 283 | <DataTemplate>
|
243 |
| - <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch"> |
244 |
| - <TextBlock |
245 |
| - VerticalAlignment="Center" |
246 |
| - Foreground="{Binding Color}" |
247 |
| - Text="{Binding Judge}"/> |
248 |
| - <StackPanel> |
249 |
| - <TextBlock |
250 |
| - Text="{Binding EnText}" |
251 |
| - Margin="5,0" |
252 |
| - Height="20" |
253 |
| - Foreground="{Binding Background}"/> |
254 |
| - <TextBlock |
255 |
| - Text="{Binding ZhText}" |
256 |
| - Margin="5,0" |
257 |
| - Height="20" |
258 |
| - Foreground="{Binding Background}"/> |
| 284 | + <Border BorderBrush="Beige" BorderThickness="1"> |
| 285 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Background="WhiteSmoke"> |
| 286 | + <TextBlock |
| 287 | + VerticalAlignment="Center" |
| 288 | + Foreground="{Binding Color}" |
| 289 | + Text="{Binding Judge}"/> |
| 290 | + <StackPanel> |
| 291 | + <TextBlock |
| 292 | + Text="{Binding EnText}" |
| 293 | + hltb:HighlightTextBlock.HightlightText="{Binding ElementName=SearchBox,Path=Text}" |
| 294 | + hltb:HighlightTextBlock.HighlightBrush="Bisque" |
| 295 | + hltb:HighlightTextBlock.HighlightTextBrush="Black" |
| 296 | + hltb:HighlightTextBlock.Bold="True" |
| 297 | + Margin="5,0" |
| 298 | + Height="20" |
| 299 | + Foreground="{Binding Background}"/> |
| 300 | + <TextBlock |
| 301 | + Text="{Binding ZhText}" |
| 302 | + hltb:HighlightTextBlock.HightlightText="{Binding ElementName=SearchBox,Path=Text}" |
| 303 | + hltb:HighlightTextBlock.HighlightBrush="Bisque" |
| 304 | + hltb:HighlightTextBlock.HighlightTextBrush="Black" |
| 305 | + hltb:HighlightTextBlock.Bold="True" |
| 306 | + Margin="5,0" |
| 307 | + Height="20" |
| 308 | + Foreground="{Binding Background}"/> |
| 309 | + </StackPanel> |
259 | 310 | </StackPanel>
|
260 |
| - </StackPanel> |
| 311 | + </Border> |
261 | 312 | </DataTemplate>
|
262 | 313 | </ListBox.ItemTemplate>
|
263 | 314 | </ListBox>
|
264 | 315 | </Grid>
|
| 316 | + |
| 317 | + <Grid Grid.ColumnSpan="3" Background="White" x:Name="FirstPage"> |
| 318 | + <Button Height="40" Width="80" Click="OpenFileOnClick">打开文件</Button> |
| 319 | + </Grid> |
265 | 320 | </Grid>
|
266 |
| -</Window> |
| 321 | +</mah:MetroWindow> |
0 commit comments