fix<DiffViewer>: wrong TextDiffView mode indicator icon

This commit is contained in:
leo 2024-02-28 18:42:58 +08:00
parent 9e4d349b51
commit cfe680ffd5
2 changed files with 34 additions and 1 deletions

View file

@ -773,6 +773,39 @@
<Setter Property="Opacity" Value="1"/> <Setter Property="Opacity" Value="1"/>
</Style> </Style>
<Style Selector="ToggleButton.textdiffviewer_mode">
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="Template">
<ControlTemplate>
<Border Background="Transparent">
<Path Grid.Column="0"
x:Name="PART_IndicatorIcon"
Margin="{TemplateBinding Padding}"
Stretch="Fill"
Data="{StaticResource Icons.Orientation}"
Fill="{DynamicResource Brush.FG1}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Opacity=".8"
RenderTransformOrigin="50%,50%"
RenderTransform="rotate(90deg)"/>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="ToggleButton.textdiffviewer_mode:pressed">
<Setter Property="RenderTransform" Value="scale(1)"/>
</Style>
<Style Selector="ToggleButton.textdiffviewer_mode:checked /template/ Path#PART_IndicatorIcon">
<Setter Property="RenderTransform" Value="rotate(0deg)"/>
</Style>
<Style Selector="ToggleButton.textdiffviewer_mode:pointerover /template/ Path#PART_IndicatorIcon">
<Setter Property="Opacity" Value="1"/>
</Style>
<Style Selector="ToggleButton.toggle_untracked"> <Style Selector="ToggleButton.toggle_untracked">
<Setter Property="Margin" Value="0"/> <Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/> <Setter Property="Padding" Value="0"/>

View file

@ -28,7 +28,7 @@
<StackPanel Grid.Column="2" Margin="32,0,0,0" Orientation="Horizontal" IsVisible="{Binding IsTextDiff}" VerticalAlignment="Center"> <StackPanel Grid.Column="2" Margin="32,0,0,0" Orientation="Horizontal" IsVisible="{Binding IsTextDiff}" VerticalAlignment="Center">
<ToggleButton x:Name="toggleDisplayMode" <ToggleButton x:Name="toggleDisplayMode"
Classes="layout_direction" Classes="textdiffviewer_mode"
Width="32" Height="26" Width="32" Height="26"
Padding="9,6" Padding="9,6"
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=UseCombinedTextDiff, Mode=TwoWay}" IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=UseCombinedTextDiff, Mode=TwoWay}"