fix: resolve button should be visible when current active view index is NOT 1 (the changes page)

This commit is contained in:
leo 2024-04-01 19:59:15 +08:00
parent ef02a57ab2
commit 814af539cd
2 changed files with 4 additions and 1 deletions

View file

@ -12,5 +12,8 @@ namespace SourceGit.Converters
public static readonly FuncValueConverter<int, bool> IsOne = public static readonly FuncValueConverter<int, bool> IsOne =
new FuncValueConverter<int, bool>(v => v == 1); new FuncValueConverter<int, bool>(v => v == 1);
public static readonly FuncValueConverter<int, bool> IsNotOne =
new FuncValueConverter<int, bool>(v => v != 1);
} }
} }

View file

@ -468,7 +468,7 @@
<TextBlock Grid.Column="0" Margin="8,0" FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.Conflict.Tip}"/> <TextBlock Grid.Column="0" Margin="8,0" FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.Conflict.Tip}"/>
<Button Grid.Column="1" Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.Repository.Resolve}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding GotoResolve}"> <Button Grid.Column="1" Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.Repository.Resolve}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding GotoResolve}">
<Button.IsVisible> <Button.IsVisible>
<Binding Path="SelectedViewIndex" Converter="{x:Static c:IntConverters.IsOne}"/> <Binding Path="SelectedViewIndex" Converter="{x:Static c:IntConverters.IsNotOne}"/>
</Button.IsVisible> </Button.IsVisible>
</Button> </Button>
<Button Grid.Column="2" Classes="flat primary" FontWeight="Regular" Content="{DynamicResource Text.Repository.Continue}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding ContinueMerge}" IsVisible="{Binding !HasUnsolvedConflict}"/> <Button Grid.Column="2" Classes="flat primary" FontWeight="Regular" Content="{DynamicResource Text.Repository.Continue}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding ContinueMerge}" IsVisible="{Binding !HasUnsolvedConflict}"/>