Skip to content

Commit e67c87c

Browse files
committed
ux: improve Interactive Rebase window UX
Signed-off-by: leo <[email protected]>
1 parent a869442 commit e67c87c

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

src/Views/InteractiveRebase.axaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@
133133
</StackPanel>
134134
</Button>
135135

136-
<!-- Graph -->
137-
<v:InteractiveRebasePath Grid.Column="2"
138-
Fill="{DynamicResource Brush.FG1}"
139-
Action="{Binding Action, Mode=OneWay}"
140-
CanReword="{Binding CanReword, Mode=OneWay}"/>
136+
<!-- Indicator -->
137+
<v:InteractiveRebaseIndicator Grid.Column="2"
138+
Fill="{DynamicResource Brush.FG1}"
139+
Action="{Binding Action, Mode=OneWay}"
140+
CanReword="{Binding CanReword, Mode=OneWay}"/>
141141

142142
<!-- Subject -->
143143
<Grid Grid.Column="3" ColumnDefinitions="Auto,*" ClipToBounds="True">
@@ -168,21 +168,27 @@
168168
Width="16" Height="16"
169169
Margin="8,0,0,0"
170170
VerticalAlignment="Center"
171-
User="{Binding Commit.Author}"/>
171+
User="{Binding Commit.Author}"
172+
Opacity="{Binding CanReword, Converter={x:Static c:BoolConverters.IsMergedToOpacity}}"/>
172173

173174
<!-- Author Name -->
174175
<Border Grid.Column="5" ClipToBounds="True">
175-
<TextBlock Margin="6,0,12,0" Text="{Binding Commit.Author.Name}"/>
176+
<TextBlock Margin="6,0,12,0"
177+
Text="{Binding Commit.Author.Name}"
178+
Opacity="{Binding CanReword, Converter={x:Static c:BoolConverters.IsMergedToOpacity}}"/>
176179
</Border>
177180

178181
<!-- Commit SHA -->
179182
<Border Grid.Column="6" ClipToBounds="True">
180-
<TextBlock Text="{Binding Commit.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"/>
183+
<TextBlock Text="{Binding Commit.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"
184+
Opacity="{Binding CanReword, Converter={x:Static c:BoolConverters.IsMergedToOpacity}}"/>
181185
</Border>
182186

183187
<!-- Commit Time -->
184188
<Border Grid.Column="7">
185-
<TextBlock Margin="16,0,8,0" Text="{Binding Commit.CommitterTimeStr}"/>
189+
<TextBlock Margin="16,0,8,0"
190+
Text="{Binding Commit.CommitterTimeStr}"
191+
Opacity="{Binding CanReword, Converter={x:Static c:BoolConverters.IsMergedToOpacity}}"/>
186192
</Border>
187193

188194
<!-- Drop Indicator -->

src/Views/InteractiveRebase.axaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ protected override void OnKeyDown(KeyEventArgs e)
8585
}
8686
}
8787

88-
public class InteractiveRebasePath : Control
88+
public class InteractiveRebaseIndicator : Control
8989
{
9090
public static readonly StyledProperty<IBrush> FillProperty =
91-
AvaloniaProperty.Register<InteractiveRebasePath, IBrush>(nameof(Fill), Brushes.Transparent);
91+
AvaloniaProperty.Register<InteractiveRebaseIndicator, IBrush>(nameof(Fill), Brushes.Transparent);
9292

9393
public IBrush Fill
9494
{
@@ -97,7 +97,7 @@ public IBrush Fill
9797
}
9898

9999
public static readonly StyledProperty<Models.InteractiveRebaseAction> ActionProperty =
100-
AvaloniaProperty.Register<InteractiveRebasePath, Models.InteractiveRebaseAction>(nameof(Action));
100+
AvaloniaProperty.Register<InteractiveRebaseIndicator, Models.InteractiveRebaseAction>(nameof(Action));
101101

102102
public Models.InteractiveRebaseAction Action
103103
{
@@ -106,7 +106,7 @@ public Models.InteractiveRebaseAction Action
106106
}
107107

108108
public static readonly StyledProperty<bool> CanRewordProperty =
109-
AvaloniaProperty.Register<InteractiveRebasePath, bool>(nameof(CanReword));
109+
AvaloniaProperty.Register<InteractiveRebaseIndicator, bool>(nameof(CanReword));
110110

111111
public bool CanReword
112112
{

0 commit comments

Comments
 (0)