-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSettingsWindow.axaml
More file actions
511 lines (469 loc) · 41.3 KB
/
Copy pathSettingsWindow.axaml
File metadata and controls
511 lines (469 loc) · 41.3 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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
<Window xmlns="https://github.com/avaloniaui"
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" d:DesignWidth="800" d:DesignHeight="500"
x:Class="ShowWrite.SettingsWindow"
Title="设置"
Width="800" Height="500"
WindowStartupLocation="CenterOwner"
Background="{DynamicResource ThemeBackground}"
CanResize="False"
MinWidth="600" MinHeight="400"
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaTitleBarHeightHint="-1">
<Window.Styles>
<!-- Hide navigation text when pane is collapsed -->
<Style Selector="ListBoxItem > StackPanel > TextBlock">
<Setter Property="IsVisible" Value="{Binding IsPaneOpen, ElementName=SettingsSplitView}"/>
</Style>
<Style Selector="ListBoxItem.nav-item">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="12,10"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="CornerRadius" Value="8"/>
<Setter Property="Margin" Value="4,2"/>
</Style>
<Style Selector="ListBoxItem.nav-item:pointerover">
<Setter Property="Background" Value="{DynamicResource ThemeHoverBackground}"/>
</Style>
<Style Selector="ListBoxItem.nav-item:selected">
<Setter Property="Background" Value="{DynamicResource ThemePrimary}"/>
</Style>
<Style Selector="ListBoxItem.nav-item:selected TextBlock">
<Setter Property="Foreground" Value="{DynamicResource ThemeTextOnPrimary}"/>
</Style>
<Style Selector="NumericUpDown.setting-input">
<Setter Property="Background" Value="{DynamicResource ThemeSurfaceVariant}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeTextPrimary}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Padding" Value="8,4"/>
<Setter Property="Width" Value="120"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
</Style>
<Style Selector="TextBlock.setting-label">
<Setter Property="Foreground" Value="{DynamicResource ThemeTextSecondary}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style Selector="TextBlock.setting-title">
<Setter Property="Foreground" Value="{DynamicResource ThemeTextPrimary}"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Margin" Value="0,0,0,16"/>
</Style>
<Style Selector="Button.save-btn">
<Setter Property="Background" Value="{DynamicResource ThemePrimary}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeTextPrimary}"/>
<Setter Property="Padding" Value="24,10"/>
<Setter Property="CornerRadius" Value="6"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FontSize" Value="14"/>
</Style>
<Style Selector="Button.save-btn:pointerover">
<Setter Property="Background" Value="{DynamicResource ThemePrimaryHover}"/>
</Style>
<Style Selector="Button.reset-btn">
<Setter Property="Background" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeTextPrimary}"/>
<Setter Property="Padding" Value="16,10"/>
<Setter Property="CornerRadius" Value="6"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Margin" Value="8,0,0,0"/>
</Style>
<Style Selector="Button.reset-btn:pointerover">
<Setter Property="Background" Value="{DynamicResource ThemePressedBackground}"/>
</Style>
<Style Selector="Button.toggle-btn">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Padding" Value="8"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Width" Value="40"/>
<Setter Property="Height" Value="40"/>
</Style>
<Style Selector="Button.toggle-btn:pointerover">
<Setter Property="Background" Value="{DynamicResource ThemeHoverBackground}"/>
</Style>
</Window.Styles>
<Grid RowDefinitions="36,*">
<Border Grid.Row="0" Background="{DynamicResource ThemeBackground}" PointerPressed="TitleBar_PointerPressed"/>
<SplitView Grid.Row="1"
x:Name="SettingsSplitView"
IsPaneOpen="True"
OpenPaneLength="220"
CompactPaneLength="56"
DisplayMode="CompactInline"
PaneBackground="{DynamicResource ThemeSurface}">
<SplitView.Pane>
<Grid RowDefinitions="Auto,*">
<Button x:Name="TogglePaneBtn" Classes="toggle-btn" Click="TogglePane_Click"
Grid.Row="0" Margin="8,8,8,4" HorizontalAlignment="Right">
<Viewbox Width="20" Height="20">
<Path Fill="{DynamicResource ThemeTextPrimary}"
Data="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/>
</Viewbox>
</Button>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<ListBox x:Name="NavListBox"
Background="Transparent"
BorderThickness="0"
SelectionMode="Single"
SelectedIndex="0"
SelectionChanged="NavListBox_SelectionChanged">
<ListBoxItem Classes="nav-item" Tag="general">
<StackPanel Orientation="Horizontal" Spacing="12">
<Viewbox Width="20" Height="20">
<Path Fill="{DynamicResource ThemeTextPrimary}" Data="M19.14,12.1c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,3.11c-0.04-0.24-0.24-0.41-0.48-0.41h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.51C8.66,5.75,8.12,6.07,7.62,6.45L5.24,5.49c-0.22-0.08-0.47,0-0.59,0.22L2.74,9.03C2.62,9.24,2.67,9.5,2.86,9.65l2.02,1.58C4.84,11.53,4.8,11.84,4.8,12.16c0,0.32,0.02,0.64,0.07,0.94l-2.03,1.58c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.1z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"/>
</Viewbox>
<TextBlock Text="常规" FontSize="14" Foreground="{DynamicResource ThemeTextSecondary}" VerticalAlignment="Center"/>
</StackPanel>
</ListBoxItem>
<ListBoxItem Classes="nav-item" Tag="appearance">
<StackPanel Orientation="Horizontal" Spacing="12">
<Viewbox Width="20" Height="20">
<Path Fill="{DynamicResource ThemeTextPrimary}" Data="M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12zm3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/>
</Viewbox>
<TextBlock Text="外观" FontSize="14" Foreground="{DynamicResource ThemeTextSecondary}" VerticalAlignment="Center"/>
</StackPanel>
</ListBoxItem>
<ListBoxItem Classes="nav-item" Tag="pen">
<StackPanel Orientation="Horizontal" Spacing="12">
<Viewbox Width="20" Height="20">
<Path Fill="{DynamicResource ThemeTextPrimary}" Data="M4.2 20.975q-.525.125-.913-.262t-.262-.913l.875-4.25l4.55 4.55zm5.875-2.1l-4.95-4.95L15.45 3.6q.575-.575 1.425-.575T18.3 3.6l2.1 2.1q.575.575.575 1.425T20.4 8.55z"/>
</Viewbox>
<TextBlock Text="笔锋" FontSize="14" Foreground="{DynamicResource ThemeTextSecondary}" VerticalAlignment="Center"/>
</StackPanel>
</ListBoxItem>
<ListBoxItem Classes="nav-item" Tag="ocr">
<StackPanel Orientation="Horizontal" Spacing="12">
<Viewbox Width="20" Height="20">
<Path Fill="{DynamicResource ThemeTextPrimary}" Data="M3 5h18v2H3V5zm0 4h18v2H3V9zm6 4h12v2H9v-2zm0 4h12v2H9v-2zM3 13h4v8H3v-8z"/>
</Viewbox>
<TextBlock Text="OCR" FontSize="14" Foreground="{DynamicResource ThemeTextSecondary}" VerticalAlignment="Center"/>
</StackPanel>
</ListBoxItem>
<ListBoxItem Classes="nav-item" Tag="about">
<StackPanel Orientation="Horizontal" Spacing="12">
<Viewbox Width="20" Height="20">
<Path Fill="{DynamicResource ThemeTextPrimary}" Data="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
</Viewbox>
<TextBlock Text="关于" FontSize="14" Foreground="{DynamicResource ThemeTextSecondary}" VerticalAlignment="Center"/>
</StackPanel>
</ListBoxItem>
</ListBox>
</ScrollViewer>
</Grid>
</SplitView.Pane>
<SplitView.Content>
<Border Background="{DynamicResource ThemeBackground}" Padding="24">
<Grid x:Name="ContentArea" RowDefinitions="*,Auto">
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel>
<StackPanel x:Name="GeneralPage" IsVisible="True" Spacing="16">
<TextBlock Text="常规设置" Classes="setting-title"/>
<Border Background="{DynamicResource ThemeSurface}" CornerRadius="8" Padding="16">
<StackPanel Spacing="16">
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="默认摄像头" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<ComboBox x:Name="DefaultCameraComboBox" Width="220"/>
<Button Classes="reset-btn" Click="RefreshCameraList_Click" Padding="12,4">
<TextBlock Text="刷新" FontSize="12" Foreground="{DynamicResource ThemeTextPrimary}" VerticalAlignment="Center"/>
</Button>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="显示板中板按钮" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<CheckBox x:Name="ShowPipButtonInput" IsChecked="False"/>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="摄像头保活" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<CheckBox x:Name="CameraKeepAliveInput" IsChecked="False"/>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="PDF导入分辨率" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<NumericUpDown x:Name="PdfImportDpiInput" Classes="setting-input"
Minimum="72" Maximum="600" Increment="50" Value="300" FormatString="0"/>
<TextBlock Text="DPI" Classes="setting-label"/>
<TextBlock Text="(数值越高,导入质量越好,但导入时间也会更长)" Foreground="{DynamicResource ThemeTextTertiary}" VerticalAlignment="Center" FontSize="11"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
</StackPanel>
<StackPanel x:Name="AppearancePage" IsVisible="False" Spacing="16">
<TextBlock Text="外观设置" Classes="setting-title"/>
<Border Background="{DynamicResource ThemeSurface}" CornerRadius="8" Padding="16">
<StackPanel Spacing="16">
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="主题" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<ComboBox x:Name="ThemeComboBox" Width="150">
<ComboBoxItem Content="深色" Tag="Dark"/>
<ComboBoxItem Content="浅色" Tag="Light"/>
<ComboBoxItem Content="白色-简约" Tag="LightMinimal"/>
<ComboBoxItem Content="我眼不瞎" Tag="NoBackground"/>
</ComboBox>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="显示照片栏滚动条" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<CheckBox x:Name="ShowPhotoScrollbarInput" IsChecked="True"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<TextBlock Text="启动图" Classes="setting-title" Margin="0,16,0,0"/>
<Border Background="{DynamicResource ThemeSurface}" CornerRadius="8" Padding="16">
<StackPanel Spacing="12">
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="启动图版本API" Classes="setting-label" Width="140"/>
<TextBox x:Name="BootImageApiInput" Grid.Column="1" PlaceholderText="https://..."/>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="当前启动图版本" Classes="setting-label" Width="140"/>
<TextBlock x:Name="BootLocalVersionText" Grid.Column="1" Text="(未安装)" Foreground="{DynamicResource ThemeTextSecondary}" FontSize="13" VerticalAlignment="Center"/>
</Grid>
<StackPanel Orientation="Horizontal" Spacing="8" Margin="0,4,0,0">
<Button x:Name="RefreshBootVersionBtn" Classes="reset-btn" Click="RefreshBootVersion_Click" Padding="12,4">
<TextBlock Text="刷新版本" FontSize="12" Foreground="{DynamicResource ThemeTextPrimary}" VerticalAlignment="Center"/>
</Button>
<Button x:Name="UpdateBootImageBtn" Classes="reset-btn" Click="UpdateBootImage_Click" Padding="12,4">
<TextBlock Text="更新启动图" FontSize="12" Foreground="{DynamicResource ThemeTextPrimary}" VerticalAlignment="Center"/>
</Button>
<TextBlock x:Name="BootStatusText" Text="" FontSize="11" Foreground="{DynamicResource ThemeTextTertiary}" VerticalAlignment="Center"/>
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
<StackPanel x:Name="PenPage" IsVisible="False" Spacing="16">
<TextBlock Text="笔锋设置" Classes="setting-title"/>
<Border Background="{DynamicResource ThemeSurface}" CornerRadius="8" Padding="16">
<StackPanel Spacing="16">
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="路径细分份数" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<NumericUpDown x:Name="DenominatorInput" Classes="setting-input"
Minimum="10" Maximum="100" Increment="5" Value="30"/>
<TextBlock Text="(20~40, 越大越平滑)" Foreground="{DynamicResource ThemeTextTertiary}" VerticalAlignment="Center" FontSize="11"/>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="最细笔触比例" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<NumericUpDown x:Name="RatioMinInput" Classes="setting-input"
Minimum="0.1" Maximum="1.0" Increment="0.05" Value="0.3"/>
<TextBlock Text="(0.3, 避免笔画过细)" Foreground="{DynamicResource ThemeTextTertiary}" VerticalAlignment="Center" FontSize="11"/>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="最粗笔触比例" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<NumericUpDown x:Name="RatioMaxInput" Classes="setting-input"
Minimum="1.0" Maximum="3.0" Increment="0.1" Value="1.5"/>
<TextBlock Text="(1.5, 避免笔画过粗)" Foreground="{DynamicResource ThemeTextTertiary}" VerticalAlignment="Center" FontSize="11"/>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="快速阈值" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<NumericUpDown x:Name="SpeedThresholdFastInput" Classes="setting-input"
Minimum="5" Maximum="50" Increment="1" Value="15"/>
<TextBlock Text="(>15 快速移动变细)" Foreground="{DynamicResource ThemeTextTertiary}" VerticalAlignment="Center" FontSize="11"/>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="慢速阈值" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<NumericUpDown x:Name="SpeedThresholdSlowInput" Classes="setting-input"
Minimum="1" Maximum="20" Increment="1" Value="5"/>
<TextBlock Text="(<5 慢速移动变粗)" Foreground="{DynamicResource ThemeTextTertiary}" VerticalAlignment="Center" FontSize="11"/>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="比例变化系数" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<NumericUpDown x:Name="RatioChangeCoefficientInput" Classes="setting-input"
Minimum="0.5" Maximum="1.0" Increment="0.05" Value="0.95"/>
<TextBlock Text="(0.8~1.0, 越小变化越剧烈)" Foreground="{DynamicResource ThemeTextTertiary}" VerticalAlignment="Center" FontSize="11"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<TextBlock Text="手掌擦设置" Classes="setting-title" Margin="0,16,0,0"/>
<Border Background="{DynamicResource ThemeSurface}" CornerRadius="8" Padding="16">
<StackPanel Spacing="16">
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="启用手掌擦" Classes="setting-label" Width="140"/>
<CheckBox x:Name="EnablePalmEraserInput" IsChecked="True"/>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="触发阈值" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<NumericUpDown x:Name="PalmEraserThresholdInput" Classes="setting-input"
Minimum="1000" Maximum="20000" Increment="500" Value="5000"/>
<TextBlock Text="(触摸面积阈值, 越小越敏感)" Foreground="{DynamicResource ThemeTextTertiary}" VerticalAlignment="Center" FontSize="11"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
</StackPanel>
<StackPanel x:Name="OcrPage" IsVisible="False" Spacing="16">
<TextBlock Text="OCR 模型管理" Classes="setting-title"/>
<Border Background="{DynamicResource ThemeSurface}" CornerRadius="8" Padding="16">
<StackPanel Spacing="12">
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="引擎" Classes="setting-label" Width="140"/>
<TextBlock Grid.Column="1" Text="PaddleOCR PP-OCRv5 中文 (RapidOcrNet)" Foreground="{DynamicResource ThemeTextSecondary}" FontSize="13" VerticalAlignment="Center"/>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="启用OCR识别目录" Classes="setting-label" Width="140"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
<CheckBox x:Name="EnableOcrDirectoryInput" IsChecked="True"/>
<TextBlock Text="(禁用后照片栏只显示照片选项卡)" Foreground="{DynamicResource ThemeTextTertiary}" VerticalAlignment="Center" FontSize="11"/>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="模型存放目录" Classes="setting-label" Width="140"/>
<TextBlock x:Name="OcrModelsDirText" Grid.Column="1" Text="" Foreground="{DynamicResource ThemeTextTertiary}" FontSize="11" VerticalAlignment="Center" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"/>
</Grid>
</StackPanel>
</Border>
<Border Background="{DynamicResource ThemeSurface}" CornerRadius="8" Padding="16">
<StackPanel Spacing="10">
<TextBlock Text="模型库" Foreground="{DynamicResource ThemeTextSecondary}" FontSize="14" FontWeight="Bold" Margin="0,0,0,4"/>
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
<RadioButton x:Name="ModelSetMobile" Grid.Column="0" GroupName="OcrModelSet" VerticalAlignment="Center" Click="ModelSetRadio_Click"/>
<StackPanel Grid.Column="1" Spacing="2">
<TextBlock Text="PP-OCRv4 手机版" FontSize="13" Foreground="{DynamicResource ThemeTextPrimary}"/>
<TextBlock Text="快速 · 约 10MB" FontSize="11" Foreground="{DynamicResource ThemeTextTertiary}"/>
</StackPanel>
<TextBlock x:Name="ModelSetMobileStatus" Grid.Column="2" Text="" FontSize="11" VerticalAlignment="Center" Margin="0,0,12,0"/>
<Button x:Name="ModelSetMobileDownload" Grid.Column="3" Classes="reset-btn" Click="ModelSetDownload_Click" Tag="v4-mobile" Padding="12,4">
<TextBlock Text="下载" FontSize="12" Foreground="{DynamicResource ThemeTextPrimary}" VerticalAlignment="Center"/>
</Button>
</Grid>
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
<RadioButton x:Name="ModelSetServer" Grid.Column="0" GroupName="OcrModelSet" VerticalAlignment="Center" Click="ModelSetRadio_Click"/>
<StackPanel Grid.Column="1" Spacing="2">
<TextBlock Text="PP-OCRv4 服务器版" FontSize="13" Foreground="{DynamicResource ThemeTextPrimary}"/>
<TextBlock Text="约 80MB · 服务器版 det 在本库后处理不兼容(0 框),不推荐" FontSize="11" Foreground="{DynamicResource ThemeTextTertiary}"/>
</StackPanel>
<TextBlock x:Name="ModelSetServerStatus" Grid.Column="2" Text="" FontSize="11" VerticalAlignment="Center" Margin="0,0,12,0"/>
<Button x:Name="ModelSetServerDownload" Grid.Column="3" Classes="reset-btn" Click="ModelSetDownload_Click" Tag="v4-server" Padding="12,4">
<TextBlock Text="下载" FontSize="12" Foreground="{DynamicResource ThemeTextPrimary}" VerticalAlignment="Center"/>
</Button>
</Grid>
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
<RadioButton x:Name="ModelSetHybrid" Grid.Column="0" GroupName="OcrModelSet" VerticalAlignment="Center" Click="ModelSetRadio_Click"/>
<StackPanel Grid.Column="1" Spacing="2">
<TextBlock Text="PP-OCRv4 混合版(推荐)" FontSize="13" Foreground="{DynamicResource ThemeTextPrimary}"/>
<TextBlock Text="约 90MB · mobile 检测 + server 识别,兼顾速度与精度" FontSize="11" Foreground="{DynamicResource ThemeTextTertiary}"/>
</StackPanel>
<TextBlock x:Name="ModelSetHybridStatus" Grid.Column="2" Text="" FontSize="11" VerticalAlignment="Center" Margin="0,0,12,0"/>
<Button x:Name="ModelSetHybridDownload" Grid.Column="3" Classes="reset-btn" Click="ModelSetDownload_Click" Tag="v4-hybrid" Padding="12,4">
<TextBlock Text="下载" FontSize="12" Foreground="{DynamicResource ThemeTextPrimary}" VerticalAlignment="Center"/>
</Button>
</Grid>
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
<RadioButton x:Name="ModelSetCustom" Grid.Column="0" GroupName="OcrModelSet" VerticalAlignment="Center" Click="ModelSetRadio_Click"/>
<StackPanel Grid.Column="1" Spacing="2">
<TextBlock Text="自定义模型路径" FontSize="13" Foreground="{DynamicResource ThemeTextPrimary}"/>
<TextBlock Text="指定本地 det/rec/dict onnx 文件" FontSize="11" Foreground="{DynamicResource ThemeTextTertiary}"/>
</StackPanel>
</Grid>
<StackPanel x:Name="CustomModelPanel" IsVisible="False" Spacing="6" Margin="24,4,0,0">
<Grid ColumnDefinitions="60,*,Auto">
<TextBlock Grid.Column="0" Text="det" FontSize="12" VerticalAlignment="Center" Foreground="{DynamicResource ThemeTextSecondary}"/>
<TextBox x:Name="CustomDetInput" Grid.Column="1" IsReadOnly="True" Watermark="检测模型 .onnx"/>
<Button Grid.Column="2" Classes="reset-btn" Click="BrowseCustom_Click" Tag="det" Padding="12,4" Margin="6,0,0,0"><TextBlock Text="..." VerticalAlignment="Center"/></Button>
</Grid>
<Grid ColumnDefinitions="60,*,Auto">
<TextBlock Grid.Column="0" Text="rec" FontSize="12" VerticalAlignment="Center" Foreground="{DynamicResource ThemeTextSecondary}"/>
<TextBox x:Name="CustomRecInput" Grid.Column="1" IsReadOnly="True" Watermark="识别模型 .onnx"/>
<Button Grid.Column="2" Classes="reset-btn" Click="BrowseCustom_Click" Tag="rec" Padding="12,4" Margin="6,0,0,0"><TextBlock Text="..." VerticalAlignment="Center"/></Button>
</Grid>
<Grid ColumnDefinitions="60,*,Auto">
<TextBlock Grid.Column="0" Text="dict" FontSize="12" VerticalAlignment="Center" Foreground="{DynamicResource ThemeTextSecondary}"/>
<TextBox x:Name="CustomDictInput" Grid.Column="1" IsReadOnly="True" Watermark="字典 .txt(可留空用自带)"/>
<Button Grid.Column="2" Classes="reset-btn" Click="BrowseCustom_Click" Tag="dict" Padding="12,4" Margin="6,0,0,0"><TextBlock Text="..." VerticalAlignment="Center"/></Button>
</Grid>
<TextBlock Text="cls(方向分类)默认用自带,如需自定义请编辑配置文件" FontSize="10" Foreground="{DynamicResource ThemeTextTertiary}" TextWrapping="Wrap"/>
</StackPanel>
<ProgressBar x:Name="OcrDownloadProgress" IsVisible="False" Height="6" Minimum="0" Maximum="100" Margin="0,8,0,0"/>
<TextBlock x:Name="OcrDownloadStatus" IsVisible="False" FontSize="12" Foreground="{DynamicResource ThemeTextTertiary}"/>
</StackPanel>
</Border>
<Border Background="{DynamicResource ThemeSurface}" CornerRadius="8" Padding="16">
<StackPanel Spacing="8">
<TextBlock Text="当前模型文件" Foreground="{DynamicResource ThemeTextSecondary}" FontSize="14" FontWeight="Bold" Margin="0,0,0,4"/>
<StackPanel x:Name="OcrModelListPanel" Spacing="4"/>
<Button x:Name="OcrRedownloadBtn" Classes="reset-btn" Click="OcrRedownload_Click" Margin="0,8,0,0" HorizontalAlignment="Left">
<TextBlock Text="重新下载当前模型集" Foreground="{DynamicResource ThemeTextPrimary}" VerticalAlignment="Center"/>
</Button>
</StackPanel>
</Border>
</StackPanel>
<StackPanel x:Name="AboutPage" IsVisible="False" Spacing="16">
<TextBlock Text="关于" Classes="setting-title"/>
<TextBlock Text="ShowWrite v2.4.0.0" Foreground="{DynamicResource ThemeTextSecondary}" FontSize="14"/>
<TextBlock Text="一款简单易用的书写展示工具" Foreground="{DynamicResource ThemeTextTertiary}"/>
<Border Background="{DynamicResource ThemeSurface}" CornerRadius="8" Padding="16" Margin="0,16,0,0">
<StackPanel Spacing="12">
<TextBlock Text="系统信息" Foreground="{DynamicResource ThemeTextSecondary}" FontSize="14" FontWeight="Bold"/>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="主板序列号:" Classes="setting-label" Width="100"/>
<TextBlock x:Name="MotherboardSerialText" Grid.Column="1" Text="正在获取..." Foreground="{DynamicResource ThemeTextSecondary}" FontSize="13" TextWrapping="Wrap"/>
</Grid>
<Grid ColumnDefinitions="Auto,*">
<TextBlock Grid.Column="0" Text="UUID:" Classes="setting-label" Width="100"/>
<TextBlock x:Name="UuidText" Grid.Column="1" Text="正在获取..." Foreground="{DynamicResource ThemeTextSecondary}" FontSize="13" TextWrapping="Wrap"/>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</StackPanel>
</ScrollViewer>
<Border Grid.Row="1"
Background="{DynamicResource ThemeSurface}"
BorderBrush="{DynamicResource ThemeSurfaceVariant}"
BorderThickness="0,1,0,0"
Padding="24,16"
Margin="-24,-8,-24,-24">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="8">
<Button Classes="reset-btn" Click="ResetPenSettings_Click">
<StackPanel Orientation="Horizontal" Spacing="8">
<Viewbox Width="16" Height="16">
<Path Fill="{DynamicResource ThemeTextPrimary}" Data="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/>
</Viewbox>
<TextBlock Text="恢复默认"/>
</StackPanel>
</Button>
<Button Classes="save-btn" Click="SavePenSettings_Click">
<StackPanel Orientation="Horizontal" Spacing="8">
<Viewbox Width="16" Height="16">
<Path Fill="{DynamicResource ThemeTextPrimary}" Data="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</Viewbox>
<TextBlock Text="保存设置"/>
</StackPanel>
</Button>
</StackPanel>
</Border>
</Grid>
</Border>
</SplitView.Content>
</SplitView>
</Grid>
</Window>