179 lines
8.4 KiB
XML
179 lines
8.4 KiB
XML
<ms:MelWindow
|
||
x:Class="ShrlAlgoStudio.DrfxFontFixerView"
|
||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
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"
|
||
xmlns:ms="https://github.com/ShrlAlgo/Melskin"
|
||
Title="DaVinci Resolve drfx 字体替换"
|
||
Width="1000"
|
||
Height="700"
|
||
mc:Ignorable="d">
|
||
<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 x:Name="FileListBox" BorderThickness="1" />
|
||
</GroupBox>
|
||
<ms:FlexibleRowPanel Grid.Row="1" Grid.Column="0">
|
||
<Button
|
||
x:Name="AddFilesButton"
|
||
Click="AddFilesButton_Click"
|
||
Content="添加drfx文件" />
|
||
<Button
|
||
x:Name="ClearListButton"
|
||
Click="ClearListButton_Click"
|
||
Content="清空处理列表" />
|
||
</ms:FlexibleRowPanel>
|
||
<ms:FlexibleRowPanel
|
||
Grid.Row="2"
|
||
Grid.Column="0"
|
||
Grid.ColumnSpan="2">
|
||
<TextBox x:Name="OutputPath" ms:FlexibleRowPanel.Span="2" />
|
||
<Button
|
||
x:Name="BrowserOutputPathButton"
|
||
Click="BrowserOutputPathButton_Click"
|
||
Content="选择输出路径" />
|
||
<Button
|
||
x:Name="OpenOutputButton"
|
||
Click="OpenOutputButton_Click"
|
||
Content="打开输出目录"
|
||
IsEnabled="False" />
|
||
</ms:FlexibleRowPanel>
|
||
<GroupBox
|
||
Grid.Row="3"
|
||
Grid.Column="0"
|
||
Grid.ColumnSpan="2"
|
||
FontWeight="Bold"
|
||
Header="处理日志">
|
||
<ScrollViewer x:Name="LogScrollViewer" VerticalScrollBarVisibility="Auto">
|
||
<TextBlock
|
||
x:Name="LogTextBlock"
|
||
Margin="5"
|
||
FontFamily="Consolas"
|
||
TextWrapping="Wrap" />
|
||
</ScrollViewer>
|
||
</GroupBox>
|
||
<GroupBox
|
||
Grid.Row="0"
|
||
Grid.Column="1"
|
||
Header="扫描文件并定义字体/样式替换规则">
|
||
<DataGrid
|
||
x:Name="MappingDataGrid"
|
||
AutoGenerateColumns="False"
|
||
CanUserAddRows="False">
|
||
<DataGrid.RowStyle>
|
||
<Style TargetType="DataGridRow">
|
||
<Setter Property="ToolTipService.ShowDuration" Value="30000" />
|
||
<Setter Property="ToolTip" Value="{Binding UsageInfo}" />
|
||
</Style>
|
||
</DataGrid.RowStyle>
|
||
<DataGrid.Columns>
|
||
<DataGridTextColumn
|
||
Width="*"
|
||
Binding="{Binding OriginalFont}"
|
||
Header="原始字体"
|
||
IsReadOnly="True" />
|
||
<DataGridTextColumn
|
||
Width="*"
|
||
Binding="{Binding OriginalStyle}"
|
||
Header="原始样式"
|
||
IsReadOnly="True" />
|
||
<DataGridTemplateColumn Width="*" Header="新字体">
|
||
<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 Width="*" Header="新样式">
|
||
<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.Row="1"
|
||
Grid.Column="1"
|
||
HorizontalAlignment="Right"
|
||
VerticalAlignment="Bottom"
|
||
Orientation="Horizontal">
|
||
<Button
|
||
x:Name="ScanFilesButton"
|
||
Click="ScanFilesButton_Click"
|
||
Content="扫描文件并更新映射表" />
|
||
<Button
|
||
x:Name="LoadMapButton"
|
||
Click="LoadMapButton_Click"
|
||
Content="加载映射表" />
|
||
<Button
|
||
x:Name="SaveMapButton"
|
||
Click="SaveMapButton_Click"
|
||
Content="保存映射表" />
|
||
<Button
|
||
x:Name="ClearMapButton"
|
||
Click="ClearMapButton_Click"
|
||
Content="清空映射表" />
|
||
</StackPanel>
|
||
<Grid Grid.Row="5" Grid.ColumnSpan="2">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*" />
|
||
<ColumnDefinition Width="Auto" />
|
||
</Grid.ColumnDefinitions>
|
||
|
||
<ProgressBar
|
||
x:Name="MainProgressBar"
|
||
Grid.Column="0"
|
||
Height="35" />
|
||
<Button
|
||
x:Name="StartButton"
|
||
Grid.Column="1"
|
||
Click="StartButton_Click"
|
||
Content="开始处理" />
|
||
</Grid>
|
||
</Grid>
|
||
</ms:MelWindow> |