refactor: ux for in progress action (cherry-pick/rebase/revert/merge)

This commit is contained in:
leo 2024-04-01 21:27:08 +08:00
parent 814af539cd
commit 53bcafa5ed
7 changed files with 243 additions and 123 deletions

View file

@ -463,15 +463,35 @@
BorderBrush="{DynamicResource Brush.Border0}"/>
<!-- Right -->
<Grid Grid.Column="2" RowDefinitions="Auto,*">
<Grid Height="26" Grid.Row="0" ColumnDefinitions="*,Auto,Auto,Auto" Background="{DynamicResource Brush.Conflict}" IsVisible="{Binding IsConflictBarVisible}">
<TextBlock Grid.Column="0" Margin="8,0" FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.Conflict.Tip}"/>
<Grid Grid.Column="2" RowDefinitions="Auto,*">
<Grid Grid.Row="0" Height="26" ColumnDefinitions="*,Auto,Auto,Auto" Background="{DynamicResource Brush.Conflict}" IsVisible="{Binding InProgressContext, Converter={x:Static ObjectConverters.IsNotNull}}">
<ContentControl Grid.Column="0" Margin="8,0" Content="{Binding InProgressContext}">
<ContentControl.DataTemplates>
<DataTemplate DataType="vm:CherryPickInProgress">
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.InProgress.CherryPick}"/>
</DataTemplate>
<DataTemplate DataType="vm:RebaseInProgress">
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.InProgress.Rebase}"/>
</DataTemplate>
<DataTemplate DataType="vm:RevertInProgress">
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.InProgress.Revert}"/>
</DataTemplate>
<DataTemplate DataType="vm:MergeInProgress">
<TextBlock FontWeight="Bold" Foreground="{DynamicResource Brush.FG3}" Text="{DynamicResource Text.InProgress.Merge}"/>
</DataTemplate>
</ContentControl.DataTemplates>
</ContentControl>
<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>
<Binding Path="SelectedViewIndex" Converter="{x:Static c:IntConverters.IsNotOne}"/>
</Button.IsVisible>
</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 !HasUnsolvedConflicts}"/>
<Button Grid.Column="3" Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.Repository.Abort}" Height="20" Padding="8,0" Margin="4,0" Command="{Binding AbortMerge}"/>
</Grid>