Skip to content

Commit 99c2732

Browse files
committed
Display filemode 'magic numbers' again, but this time in tooltip
1 parent 95437df commit 99c2732

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎src/Models/DiffResult.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,7 @@ public string FileModeChange
152152
return $"{oldDisplay} → {newDisplay}";
153153
}
154154
}
155+
156+
public string FileModeChangeTooltip => App.Text("Diff.FileModeChanged") + $" ({OldMode} → {NewMode})";
155157
}
156158
}

‎src/ViewModels/DiffContext.cs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ public string FileModeChange
1919
private set => SetProperty(ref _fileModeChange, value);
2020
}
2121

22+
public string FileModeChangeTooltip
23+
{
24+
get => _fileModeChangeTooltip;
25+
private set => SetProperty(ref _fileModeChangeTooltip, value);
26+
}
27+
2228
public bool IsTextDiff
2329
{
2430
get => _isTextDiff;
@@ -54,6 +60,7 @@ public DiffContext(string repo, Models.DiffOption option, DiffContext previous =
5460
_isIgnoreWhitespaceVisible = previous._isIgnoreWhitespaceVisible;
5561
_content = previous._content;
5662
_fileModeChange = previous._fileModeChange;
63+
_fileModeChangeTooltip = previous._fileModeChangeTooltip;
5764
_unifiedLines = previous._unifiedLines;
5865
_info = previous._info;
5966
}
@@ -244,6 +251,7 @@ private void LoadContent()
244251
Dispatcher.UIThread.Post(() =>
245252
{
246253
FileModeChange = latest.FileModeChange;
254+
FileModeChangeTooltip = latest.FileModeChangeTooltip;
247255

248256
if (rs is Models.TextDiff cur)
249257
{
@@ -335,6 +343,7 @@ public bool IsSame(Info other)
335343
private readonly string _repo;
336344
private readonly Models.DiffOption _option = null;
337345
private string _fileModeChange = string.Empty;
346+
private string _fileModeChangeTooltip = string.Empty;
338347
private int _unifiedLines = 4;
339348
private bool _isTextDiff = false;
340349
private bool _isIgnoreWhitespaceVisible = true;

‎src/Views/DiffView.axaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
VerticalAlignment="Center"
2626
Background="{DynamicResource Brush.Badge}"
2727
IsVisible="{Binding FileModeChange, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
28-
ToolTip.Tip="{DynamicResource Text.Diff.FileModeChanged}">
28+
ToolTip.Tip="{Binding FileModeChangeTooltip}">
2929
<TextBlock FontSize="10" HorizontalAlignment="Center" Margin="4,0" Text="{Binding FileModeChange}" Foreground="{DynamicResource Brush.BadgeFG}"/>
3030
</Border>
3131

0 commit comments

Comments
 (0)