ux: improve Interactive Rebase window UX

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-10-29 19:00:04 +08:00
parent a869442d78
commit e67c87cefc
2 changed files with 19 additions and 13 deletions

View File

@@ -133,11 +133,11 @@
</StackPanel>
</Button>
<!-- Graph -->
<v:InteractiveRebasePath Grid.Column="2"
Fill="{DynamicResource Brush.FG1}"
Action="{Binding Action, Mode=OneWay}"
CanReword="{Binding CanReword, Mode=OneWay}"/>
<!-- Indicator -->
<v:InteractiveRebaseIndicator Grid.Column="2"
Fill="{DynamicResource Brush.FG1}"
Action="{Binding Action, Mode=OneWay}"
CanReword="{Binding CanReword, Mode=OneWay}"/>
<!-- Subject -->
<Grid Grid.Column="3" ColumnDefinitions="Auto,*" ClipToBounds="True">
@@ -168,21 +168,27 @@
Width="16" Height="16"
Margin="8,0,0,0"
VerticalAlignment="Center"
User="{Binding Commit.Author}"/>
User="{Binding Commit.Author}"
Opacity="{Binding CanReword, Converter={x:Static c:BoolConverters.IsMergedToOpacity}}"/>
<!-- Author Name -->
<Border Grid.Column="5" ClipToBounds="True">
<TextBlock Margin="6,0,12,0" Text="{Binding Commit.Author.Name}"/>
<TextBlock Margin="6,0,12,0"
Text="{Binding Commit.Author.Name}"
Opacity="{Binding CanReword, Converter={x:Static c:BoolConverters.IsMergedToOpacity}}"/>
</Border>
<!-- Commit SHA -->
<Border Grid.Column="6" ClipToBounds="True">
<TextBlock Text="{Binding Commit.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"/>
<TextBlock Text="{Binding Commit.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"
Opacity="{Binding CanReword, Converter={x:Static c:BoolConverters.IsMergedToOpacity}}"/>
</Border>
<!-- Commit Time -->
<Border Grid.Column="7">
<TextBlock Margin="16,0,8,0" Text="{Binding Commit.CommitterTimeStr}"/>
<TextBlock Margin="16,0,8,0"
Text="{Binding Commit.CommitterTimeStr}"
Opacity="{Binding CanReword, Converter={x:Static c:BoolConverters.IsMergedToOpacity}}"/>
</Border>
<!-- Drop Indicator -->

View File

@@ -85,10 +85,10 @@ namespace SourceGit.Views
}
}
public class InteractiveRebasePath : Control
public class InteractiveRebaseIndicator : Control
{
public static readonly StyledProperty<IBrush> FillProperty =
AvaloniaProperty.Register<InteractiveRebasePath, IBrush>(nameof(Fill), Brushes.Transparent);
AvaloniaProperty.Register<InteractiveRebaseIndicator, IBrush>(nameof(Fill), Brushes.Transparent);
public IBrush Fill
{
@@ -97,7 +97,7 @@ namespace SourceGit.Views
}
public static readonly StyledProperty<Models.InteractiveRebaseAction> ActionProperty =
AvaloniaProperty.Register<InteractiveRebasePath, Models.InteractiveRebaseAction>(nameof(Action));
AvaloniaProperty.Register<InteractiveRebaseIndicator, Models.InteractiveRebaseAction>(nameof(Action));
public Models.InteractiveRebaseAction Action
{
@@ -106,7 +106,7 @@ namespace SourceGit.Views
}
public static readonly StyledProperty<bool> CanRewordProperty =
AvaloniaProperty.Register<InteractiveRebasePath, bool>(nameof(CanReword));
AvaloniaProperty.Register<InteractiveRebaseIndicator, bool>(nameof(CanReword));
public bool CanReword
{