175 lines
8.3 KiB
Plaintext
175 lines
8.3 KiB
Plaintext
|
|
<n:NeoWindow
|
|||
|
|
Height="700"
|
|||
|
|
Title="DaVinci Resolve drfx 字体替换"
|
|||
|
|
Width="1000"
|
|||
|
|
mc:Ignorable="d"
|
|||
|
|
x:Class="DrfxFontFixer.MainWindow"
|
|||
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|||
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|||
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|||
|
|
xmlns:n="https://github.com/ShrlAlgo/NeoUI"
|
|||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|||
|
|
<Grid Margin="5">
|
|||
|
|
<Grid.RowDefinitions>
|
|||
|
|
<RowDefinition Height="*" />
|
|||
|
|
<RowDefinition Height="Auto" />
|
|||
|
|
<RowDefinition Height="Auto" />
|
|||
|
|
<RowDefinition Height="200" />
|
|||
|
|
<RowDefinition Height="Auto" />
|
|||
|
|
</Grid.RowDefinitions>
|
|||
|
|
<Grid.ColumnDefinitions>
|
|||
|
|
<ColumnDefinition Width="*" />
|
|||
|
|
<ColumnDefinition Width="1.5*" />
|
|||
|
|
</Grid.ColumnDefinitions>
|
|||
|
|
<GroupBox Grid.Row="0" Header="添加需要处理的 drfx 文件">
|
|||
|
|
<ListBox BorderThickness="1" x:Name="FileListBox" />
|
|||
|
|
</GroupBox>
|
|||
|
|
<n:FlexibleRowPanel Grid.Column="0" Grid.Row="1">
|
|||
|
|
<Button
|
|||
|
|
Click="AddFilesButton_Click"
|
|||
|
|
Content="添加drfx文件"
|
|||
|
|
x:Name="AddFilesButton" />
|
|||
|
|
<Button
|
|||
|
|
Click="ClearListButton_Click"
|
|||
|
|
Content="清空处理列表"
|
|||
|
|
x:Name="ClearListButton" />
|
|||
|
|
</n:FlexibleRowPanel>
|
|||
|
|
<n:FlexibleRowPanel Grid.ColumnSpan="2" Grid.Row="2">
|
|||
|
|
<TextBox n:FlexibleRowPanel.Span="2" x:Name="OutputPath" />
|
|||
|
|
<Button
|
|||
|
|
Click="BrowserOutputPathButton_Click"
|
|||
|
|
Content="选择输出路径"
|
|||
|
|
x:Name="BrowserOutputPathButton" />
|
|||
|
|
<Button
|
|||
|
|
Click="OpenOutputButton_Click"
|
|||
|
|
Content="打开输出目录"
|
|||
|
|
IsEnabled="False"
|
|||
|
|
x:Name="OpenOutputButton" />
|
|||
|
|
</n:FlexibleRowPanel>
|
|||
|
|
<GroupBox
|
|||
|
|
FontWeight="Bold"
|
|||
|
|
Grid.ColumnSpan="2"
|
|||
|
|
Grid.Row="3"
|
|||
|
|
Header="处理日志">
|
|||
|
|
<ScrollViewer VerticalScrollBarVisibility="Auto" x:Name="LogScrollViewer">
|
|||
|
|
<TextBlock
|
|||
|
|
FontFamily="Consolas"
|
|||
|
|
Margin="5"
|
|||
|
|
TextWrapping="Wrap"
|
|||
|
|
x:Name="LogTextBlock" />
|
|||
|
|
</ScrollViewer>
|
|||
|
|
</GroupBox>
|
|||
|
|
<GroupBox
|
|||
|
|
Grid.Column="1"
|
|||
|
|
Grid.Row="0"
|
|||
|
|
Header="扫描文件并定义字体/样式替换规则">
|
|||
|
|
<DataGrid
|
|||
|
|
AutoGenerateColumns="False"
|
|||
|
|
CanUserAddRows="False"
|
|||
|
|
x:Name="MappingDataGrid">
|
|||
|
|
<DataGrid.RowStyle>
|
|||
|
|
<Style TargetType="DataGridRow">
|
|||
|
|
<Setter Property="ToolTipService.ShowDuration" Value="30000" />
|
|||
|
|
<Setter Property="ToolTip" Value="{Binding UsageInfo}" />
|
|||
|
|
</Style>
|
|||
|
|
</DataGrid.RowStyle>
|
|||
|
|
<DataGrid.Columns>
|
|||
|
|
<DataGridTextColumn
|
|||
|
|
Binding="{Binding OriginalFont}"
|
|||
|
|
Header="原始字体"
|
|||
|
|
IsReadOnly="True"
|
|||
|
|
Width="*" />
|
|||
|
|
<DataGridTextColumn
|
|||
|
|
Binding="{Binding OriginalStyle}"
|
|||
|
|
Header="原始样式"
|
|||
|
|
IsReadOnly="True"
|
|||
|
|
Width="*" />
|
|||
|
|
<DataGridTemplateColumn Header="新字体" Width="*">
|
|||
|
|
<DataGridTemplateColumn.CellTemplate>
|
|||
|
|
<DataTemplate>
|
|||
|
|
<!-- 注意:我们仍然保留LostFocus,因为它能最好地处理“手动输入”文本的场景 -->
|
|||
|
|
<ComboBox
|
|||
|
|
IsEditable="True"
|
|||
|
|
ItemsSource="{Binding DataContext.SystemFonts, RelativeSource={RelativeSource AncestorType=Window}}"
|
|||
|
|
LostFocus="NewFontComboBox_LostFocus"
|
|||
|
|
Text="{Binding NewFont, UpdateSourceTrigger=PropertyChanged}" />
|
|||
|
|
</DataTemplate>
|
|||
|
|
</DataGridTemplateColumn.CellTemplate>
|
|||
|
|
</DataGridTemplateColumn>
|
|||
|
|
<DataGridTemplateColumn Header="新样式" Width="*">
|
|||
|
|
<DataGridTemplateColumn.CellTemplate>
|
|||
|
|
<DataTemplate>
|
|||
|
|
<ContentControl>
|
|||
|
|
<ContentControl.Style>
|
|||
|
|
<Style TargetType="ContentControl">
|
|||
|
|
<Setter Property="ContentTemplate">
|
|||
|
|
<Setter.Value>
|
|||
|
|
<DataTemplate>
|
|||
|
|
<TextBox Text="{Binding DataContext.NewStyle, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGridCell}}" />
|
|||
|
|
</DataTemplate>
|
|||
|
|
</Setter.Value>
|
|||
|
|
</Setter>
|
|||
|
|
<Style.Triggers>
|
|||
|
|
<DataTrigger Binding="{Binding IsNewFontInSystem}" Value="True">
|
|||
|
|
<Setter Property="ContentTemplate">
|
|||
|
|
<Setter.Value>
|
|||
|
|
<DataTemplate>
|
|||
|
|
<ComboBox
|
|||
|
|
IsEditable="True"
|
|||
|
|
ItemsSource="{Binding Path=DataContext.AvailableNewStyles, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGridCell}}"
|
|||
|
|
Text="{Binding DataContext.NewStyle, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGridCell}}" />
|
|||
|
|
</DataTemplate>
|
|||
|
|
</Setter.Value>
|
|||
|
|
</Setter>
|
|||
|
|
</DataTrigger>
|
|||
|
|
</Style.Triggers>
|
|||
|
|
</Style>
|
|||
|
|
</ContentControl.Style>
|
|||
|
|
</ContentControl>
|
|||
|
|
</DataTemplate>
|
|||
|
|
</DataGridTemplateColumn.CellTemplate>
|
|||
|
|
</DataGridTemplateColumn>
|
|||
|
|
</DataGrid.Columns>
|
|||
|
|
</DataGrid>
|
|||
|
|
</GroupBox>
|
|||
|
|
<StackPanel
|
|||
|
|
Grid.Column="1"
|
|||
|
|
Grid.Row="1"
|
|||
|
|
HorizontalAlignment="Right"
|
|||
|
|
Orientation="Horizontal"
|
|||
|
|
VerticalAlignment="Bottom">
|
|||
|
|
<Button
|
|||
|
|
Click="ScanFilesButton_Click"
|
|||
|
|
Content="扫描文件并更新映射表"
|
|||
|
|
x:Name="ScanFilesButton" />
|
|||
|
|
<Button
|
|||
|
|
Click="LoadMapButton_Click"
|
|||
|
|
Content="加载映射表"
|
|||
|
|
x:Name="LoadMapButton" />
|
|||
|
|
<Button
|
|||
|
|
Click="SaveMapButton_Click"
|
|||
|
|
Content="保存映射表"
|
|||
|
|
x:Name="SaveMapButton" />
|
|||
|
|
<Button
|
|||
|
|
Click="ClearMapButton_Click"
|
|||
|
|
Content="清空映射表"
|
|||
|
|
x:Name="ClearMapButton" />
|
|||
|
|
</StackPanel>
|
|||
|
|
<Grid Grid.ColumnSpan="2" Grid.Row="5">
|
|||
|
|
<Grid.ColumnDefinitions>
|
|||
|
|
<ColumnDefinition Width="*" />
|
|||
|
|
<ColumnDefinition Width="Auto" />
|
|||
|
|
</Grid.ColumnDefinitions>
|
|||
|
|
|
|||
|
|
<ProgressBar
|
|||
|
|
Grid.Column="0"
|
|||
|
|
Height="35"
|
|||
|
|
x:Name="MainProgressBar" />
|
|||
|
|
<Button
|
|||
|
|
Click="StartButton_Click"
|
|||
|
|
Content="开始处理"
|
|||
|
|
Grid.Column="1"
|
|||
|
|
x:Name="StartButton" />
|
|||
|
|
</Grid>
|
|||
|
|
</Grid>
|
|||
|
|
</n:NeoWindow>
|