From 6809eaf2bd09f6ebaac9d3de2e3545585b09c2e2 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 1 Dec 2025 14:16:06 +0800 Subject: [PATCH 01/98] enhance: different icons for annotated and lightweight tags (#1942) Signed-off-by: leo --- src/Views/TagsView.axaml | 24 +++++++++++++++++++++--- src/Views/TagsView.axaml.cs | 19 ++++++++++++++----- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/Views/TagsView.axaml b/src/Views/TagsView.axaml index 5ec914e65..7d79d04a3 100644 --- a/src/Views/TagsView.axaml +++ b/src/Views/TagsView.axaml @@ -87,7 +87,17 @@ + Data="{StaticResource Icons.Tag}" + IsVisible="{Binding Tag.IsAnnotated}"/> + + - - + + + diff --git a/src/Views/TagsView.axaml.cs b/src/Views/TagsView.axaml.cs index 904dbaa63..d2275d047 100644 --- a/src/Views/TagsView.axaml.cs +++ b/src/Views/TagsView.axaml.cs @@ -63,19 +63,19 @@ private void UpdateContent() } if (node.Tag != null) - CreateContent(new Thickness(0, 0, 0, 0), "Icons.Tag"); + CreateContent(new Thickness(0, 0, 0, 0), "Icons.Tag", node.ToolTip is { IsAnnotated: false }); else if (node.IsExpanded) - CreateContent(new Thickness(0, 2, 0, 0), "Icons.Folder.Open"); + CreateContent(new Thickness(0, 2, 0, 0), "Icons.Folder.Open", false); else - CreateContent(new Thickness(0, 2, 0, 0), "Icons.Folder"); + CreateContent(new Thickness(0, 2, 0, 0), "Icons.Folder", false); } - private void CreateContent(Thickness margin, string iconKey) + private void CreateContent(Thickness margin, string iconKey, bool stroke) { if (this.FindResource(iconKey) is not StreamGeometry geo) return; - Content = new Avalonia.Controls.Shapes.Path() + var path = new Avalonia.Controls.Shapes.Path() { Width = 12, Height = 12, @@ -84,6 +84,15 @@ private void CreateContent(Thickness margin, string iconKey) Margin = margin, Data = geo, }; + + if (stroke) + { + path.Fill = Brushes.Transparent; + path.Stroke = this.FindResource("Brush.FG1") as IBrush; + path.StrokeThickness = 1; + } + + Content = path; } } From 4057521d70af8b3c1e84406f789b9e2d4d7ef5aa Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 1 Dec 2025 15:05:48 +0800 Subject: [PATCH 02/98] enhance: enable word wrapping in `Edit Branch's Description` popup (#1920) Signed-off-by: leo --- src/Views/EditBranchDescription.axaml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Views/EditBranchDescription.axaml b/src/Views/EditBranchDescription.axaml index 17055517c..eb3766226 100644 --- a/src/Views/EditBranchDescription.axaml +++ b/src/Views/EditBranchDescription.axaml @@ -30,6 +30,7 @@ VerticalContentAlignment="Top" AcceptsReturn="True" AcceptsTab="False" Text="{Binding Description, Mode=TwoWay}" + TextWrapping="Wrap" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto" Tag="{Binding Source={x:Static v:StealHotKey.Enter}}"/> From b543633996761f0a7074b9abb3cd351b5b5551de Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 1 Dec 2025 19:46:39 +0800 Subject: [PATCH 03/98] refactor: always use hunk-based patching while staging/unstaging/discarding partial changes in a file (#1752) Signed-off-by: leo --- src/Models/DiffResult.cs | 40 +------------- src/Views/TextDiffView.axaml.cs | 94 ++++++++++++--------------------- 2 files changed, 37 insertions(+), 97 deletions(-) diff --git a/src/Models/DiffResult.cs b/src/Models/DiffResult.cs index 57b7c6d13..c109c289e 100644 --- a/src/Models/DiffResult.cs +++ b/src/Models/DiffResult.cs @@ -47,7 +47,6 @@ public class TextDiffSelection public int StartLine { get; set; } = 0; public int EndLine { get; set; } = 0; public bool HasChanges { get; set; } = false; - public bool HasLeftChanges { get; set; } = false; public int IgnoredAdds { get; set; } = 0; public int IgnoredDeletes { get; set; } = 0; @@ -74,15 +73,9 @@ public TextDiffSelection MakeSelection(int startLine, int endLine, bool isCombin { var line = Lines[i]; if (line.Type == TextDiffLineType.Added) - { - rs.HasLeftChanges = true; rs.IgnoredAdds++; - } else if (line.Type == TextDiffLineType.Deleted) - { - rs.HasLeftChanges = true; rs.IgnoredDeletes++; - } } for (int i = startLine - 1; i < endLine; i++) @@ -90,48 +83,19 @@ public TextDiffSelection MakeSelection(int startLine, int endLine, bool isCombin var line = Lines[i]; if (line.Type == TextDiffLineType.Added) { - if (isCombined) + if (isCombined || !isOldSide) { rs.HasChanges = true; break; } - if (isOldSide) - { - rs.HasLeftChanges = true; - } - else - { - rs.HasChanges = true; - } } else if (line.Type == TextDiffLineType.Deleted) { - if (isCombined) + if (isCombined || isOldSide) { rs.HasChanges = true; break; } - if (isOldSide) - { - rs.HasChanges = true; - } - else - { - rs.HasLeftChanges = true; - } - } - } - - if (!rs.HasLeftChanges) - { - for (int i = endLine; i < Lines.Count; i++) - { - var line = Lines[i]; - if (line.Type == TextDiffLineType.Added || line.Type == TextDiffLineType.Deleted) - { - rs.HasLeftChanges = true; - break; - } } } diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index 9d329ff6b..12110f51f 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -1552,32 +1552,25 @@ private async void OnStageChunk(object _1, RoutedEventArgs _2) using var lockWatcher = repo.LockWatcher(); - if (!selection.HasLeftChanges) + var tmpFile = Path.GetTempFileName(); + if (change.WorkTree == Models.ChangeState.Untracked) { - await new Commands.Add(repo.FullPath, change).ExecAsync(); + diff.GenerateNewPatchFromSelection(change, null, selection, false, tmpFile); + } + else if (chunk.Combined) + { + var treeGuid = await new Commands.QueryStagedFileBlobGuid(repo.FullPath, change.Path).GetResultAsync(); + diff.GeneratePatchFromSelection(change, treeGuid, selection, false, tmpFile); } else { - var tmpFile = Path.GetTempFileName(); - if (change.WorkTree == Models.ChangeState.Untracked) - { - diff.GenerateNewPatchFromSelection(change, null, selection, false, tmpFile); - } - else if (chunk.Combined) - { - var treeGuid = await new Commands.QueryStagedFileBlobGuid(repo.FullPath, change.Path).GetResultAsync(); - diff.GeneratePatchFromSelection(change, treeGuid, selection, false, tmpFile); - } - else - { - var treeGuid = await new Commands.QueryStagedFileBlobGuid(repo.FullPath, change.Path).GetResultAsync(); - diff.GeneratePatchFromSelectionSingleSide(change, treeGuid, selection, false, chunk.IsOldSide, tmpFile); - } - - await new Commands.Apply(repo.FullPath, tmpFile, true, "nowarn", "--cache --index").ExecAsync(); - File.Delete(tmpFile); + var treeGuid = await new Commands.QueryStagedFileBlobGuid(repo.FullPath, change.Path).GetResultAsync(); + diff.GeneratePatchFromSelectionSingleSide(change, treeGuid, selection, false, chunk.IsOldSide, tmpFile); } + await new Commands.Apply(repo.FullPath, tmpFile, true, "nowarn", "--cache --index").ExecAsync(); + File.Delete(tmpFile); + repo.MarkWorkingCopyDirtyManually(); } @@ -1600,27 +1593,17 @@ private async void OnUnstageChunk(object _1, RoutedEventArgs _2) using var lockWatcher = repo.LockWatcher(); - if (!selection.HasLeftChanges) - { - if (change.DataForAmend != null) - await new Commands.UnstageChangesForAmend(repo.FullPath, [change]).ExecAsync(); - else - await new Commands.Restore(repo.FullPath, change).ExecAsync(); - } + var treeGuid = await new Commands.QueryStagedFileBlobGuid(repo.FullPath, change.Path).GetResultAsync(); + var tmpFile = Path.GetTempFileName(); + if (change.Index == Models.ChangeState.Added) + diff.GenerateNewPatchFromSelection(change, treeGuid, selection, true, tmpFile); + else if (chunk.Combined) + diff.GeneratePatchFromSelection(change, treeGuid, selection, true, tmpFile); else - { - var treeGuid = await new Commands.QueryStagedFileBlobGuid(repo.FullPath, change.Path).GetResultAsync(); - var tmpFile = Path.GetTempFileName(); - if (change.Index == Models.ChangeState.Added) - diff.GenerateNewPatchFromSelection(change, treeGuid, selection, true, tmpFile); - else if (chunk.Combined) - diff.GeneratePatchFromSelection(change, treeGuid, selection, true, tmpFile); - else - diff.GeneratePatchFromSelectionSingleSide(change, treeGuid, selection, true, chunk.IsOldSide, tmpFile); + diff.GeneratePatchFromSelectionSingleSide(change, treeGuid, selection, true, chunk.IsOldSide, tmpFile); - await new Commands.Apply(repo.FullPath, tmpFile, true, "nowarn", "--cache --index --reverse").ExecAsync(); - File.Delete(tmpFile); - } + await new Commands.Apply(repo.FullPath, tmpFile, true, "nowarn", "--cache --index --reverse").ExecAsync(); + File.Delete(tmpFile); repo.MarkWorkingCopyDirtyManually(); } @@ -1645,32 +1628,25 @@ private async void OnDiscardChunk(object _1, RoutedEventArgs _2) using var lockWatcher = repo.LockWatcher(); - if (!selection.HasLeftChanges) + var tmpFile = Path.GetTempFileName(); + if (change.Index == Models.ChangeState.Added) + { + diff.GenerateNewPatchFromSelection(change, null, selection, true, tmpFile); + } + else if (chunk.Combined) { - await Commands.Discard.ChangesAsync(repo.FullPath, [change], null); + var treeGuid = await new Commands.QueryStagedFileBlobGuid(repo.FullPath, change.Path).GetResultAsync(); + diff.GeneratePatchFromSelection(change, treeGuid, selection, true, tmpFile); } else { - var tmpFile = Path.GetTempFileName(); - if (change.Index == Models.ChangeState.Added) - { - diff.GenerateNewPatchFromSelection(change, null, selection, true, tmpFile); - } - else if (chunk.Combined) - { - var treeGuid = await new Commands.QueryStagedFileBlobGuid(repo.FullPath, change.Path).GetResultAsync(); - diff.GeneratePatchFromSelection(change, treeGuid, selection, true, tmpFile); - } - else - { - var treeGuid = await new Commands.QueryStagedFileBlobGuid(repo.FullPath, change.Path).GetResultAsync(); - diff.GeneratePatchFromSelectionSingleSide(change, treeGuid, selection, true, chunk.IsOldSide, tmpFile); - } - - await new Commands.Apply(repo.FullPath, tmpFile, true, "nowarn", "--reverse").ExecAsync(); - File.Delete(tmpFile); + var treeGuid = await new Commands.QueryStagedFileBlobGuid(repo.FullPath, change.Path).GetResultAsync(); + diff.GeneratePatchFromSelectionSingleSide(change, treeGuid, selection, true, chunk.IsOldSide, tmpFile); } + await new Commands.Apply(repo.FullPath, tmpFile, true, "nowarn", "--reverse").ExecAsync(); + File.Delete(tmpFile); + repo.MarkWorkingCopyDirtyManually(); } } From c1a01b2fc706674f299399af6e0e38b6ae1c95ae Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 1 Dec 2025 19:56:59 +0800 Subject: [PATCH 04/98] code_style: refactor datas used by text diff result Signed-off-by: leo --- src/Commands/Diff.cs | 4 ++-- src/Models/DiffResult.cs | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Commands/Diff.cs b/src/Commands/Diff.cs index a16954a00..02fae1c3c 100644 --- a/src/Commands/Diff.cs +++ b/src/Commands/Diff.cs @@ -252,10 +252,10 @@ private void ProcessInlineHighlights() foreach (var chunk in chunks) { if (chunk.DeletedCount > 0) - left.Highlights.Add(new Models.TextInlineRange(chunk.DeletedStart, chunk.DeletedCount)); + left.Highlights.Add(new Models.TextRange(chunk.DeletedStart, chunk.DeletedCount)); if (chunk.AddedCount > 0) - right.Highlights.Add(new Models.TextInlineRange(chunk.AddedStart, chunk.AddedCount)); + right.Highlights.Add(new Models.TextRange(chunk.AddedStart, chunk.AddedCount)); } } } diff --git a/src/Models/DiffResult.cs b/src/Models/DiffResult.cs index c109c289e..dd0639c12 100644 --- a/src/Models/DiffResult.cs +++ b/src/Models/DiffResult.cs @@ -14,7 +14,7 @@ public enum TextDiffLineType Deleted, } - public class TextInlineRange(int p, int n) + public class TextRange(int p, int n) { public int Start { get; set; } = p; public int End { get; set; } = p + n - 1; @@ -26,7 +26,7 @@ public class TextDiffLine public string Content { get; set; } = ""; public int OldLineNumber { get; set; } = 0; public int NewLineNumber { get; set; } = 0; - public List Highlights { get; set; } = new List(); + public List Highlights { get; set; } = new List(); public bool NoNewLineEndOfFile { get; set; } = false; public string OldLine => OldLineNumber == 0 ? string.Empty : OldLineNumber.ToString(); @@ -49,11 +49,6 @@ public class TextDiffSelection public bool HasChanges { get; set; } = false; public int IgnoredAdds { get; set; } = 0; public int IgnoredDeletes { get; set; } = 0; - - public bool IsInRange(int idx) - { - return idx >= StartLine - 1 && idx < EndLine; - } } public partial class TextDiff @@ -129,7 +124,11 @@ public void GenerateNewPatchFromSelection(Change change, string fileBlobGuid, Te var line = Lines[i]; if (line.Type != TextDiffLineType.Added) continue; - writer.WriteLine($"{(selection.IsInRange(i) ? "+" : " ")}{line.Content}"); + + if (i >= selection.StartLine - 1 && i < selection.EndLine) + writer.WriteLine($"+{line.Content}"); + else + writer.WriteLine($" {line.Content}"); } } else From 56455f4c010fb0c5fb9ae4cc19162a270d00975f Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 1 Dec 2025 21:05:14 +0800 Subject: [PATCH 05/98] doc: remove `winget` support Signed-off-by: leo --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 316b11726..eb370c3c6 100644 --- a/README.md +++ b/README.md @@ -89,12 +89,6 @@ This software creates a folder `$"{System.Environment.SpecialFolder.ApplicationD For **Windows** users: * **MSYS Git is NOT supported**. Please use official [Git for Windows](https://git-scm.com/download/win) instead. -* You can install the latest stable from `winget` with follow commands: - ```shell - winget install SourceGit - ``` -> [!NOTE] -> `winget` will install this software as a commandline tool. You need run `SourceGit` from console or `Win+R` at the first time. Then you can add it to the taskbar. * You can install the latest stable by `scoop` with follow commands: ```shell scoop bucket add extras From ccfd7f0d3fa969a8d4e0f9e55eea701fdf61adff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20W?= <44604769+goran-w@users.noreply.github.com> Date: Tue, 2 Dec 2025 03:29:07 +0100 Subject: [PATCH 06/98] fix: recently introduced bug affecting `Block Navigation` (#1948) --- src/ViewModels/TextDiffContext.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/TextDiffContext.cs b/src/ViewModels/TextDiffContext.cs index dd85453cf..845afeac6 100644 --- a/src/ViewModels/TextDiffContext.cs +++ b/src/ViewModels/TextDiffContext.cs @@ -194,12 +194,12 @@ public TwoSideTextDiff(Models.TextDiff diff, TwoSideTextDiff previous = null) if (previous != null && previous.File.Equals(File, StringComparison.Ordinal)) { - _blockNavigation = new BlockNavigation(_data.Lines, false); + _blockNavigation = new BlockNavigation(Old, false); _scrollOffset = previous._scrollOffset; } else { - _blockNavigation = new BlockNavigation(_data.Lines, true); + _blockNavigation = new BlockNavigation(Old, true); } } From e2feac3624bc8b8c615f7e2332c15dabe9f177a1 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 3 Dec 2025 18:20:32 +0800 Subject: [PATCH 07/98] refactor: rewrite `TextDiffContext` and fix the issue that text diff view does not navigate to the first change chunk after select a different commit with the same file Signed-off-by: leo --- src/Commands/Diff.cs | 2 +- src/Models/DiffResult.cs | 2 - src/ViewModels/DiffContext.cs | 13 ++-- src/ViewModels/TextDiffContext.cs | 62 ++++++++++-------- src/Views/TextDiffView.axaml | 15 ++--- src/Views/TextDiffView.axaml.cs | 100 +++++++++++++----------------- 6 files changed, 90 insertions(+), 104 deletions(-) diff --git a/src/Commands/Diff.cs b/src/Commands/Diff.cs index 02fae1c3c..3fdc62259 100644 --- a/src/Commands/Diff.cs +++ b/src/Commands/Diff.cs @@ -21,7 +21,7 @@ public partial class Diff : Command public Diff(string repo, Models.DiffOption opt, int unified, bool ignoreWhitespace) { - _result.TextDiff = new Models.TextDiff() { Option = opt }; + _result.TextDiff = new Models.TextDiff(); WorkingDirectory = repo; Context = repo; diff --git a/src/Models/DiffResult.cs b/src/Models/DiffResult.cs index dd0639c12..6c381df35 100644 --- a/src/Models/DiffResult.cs +++ b/src/Models/DiffResult.cs @@ -53,8 +53,6 @@ public class TextDiffSelection public partial class TextDiff { - public string File { get; set; } = string.Empty; - public DiffOption Option { get; set; } = null; public List Lines { get; set; } = new List(); public int MaxLineNumber = 0; diff --git a/src/ViewModels/DiffContext.cs b/src/ViewModels/DiffContext.cs index c7f8ab676..d56a6bc68 100644 --- a/src/ViewModels/DiffContext.cs +++ b/src/ViewModels/DiffContext.cs @@ -38,10 +38,7 @@ public bool ShowEntireFile OnPropertyChanged(); if (Content is TextDiffContext ctx) - { - ctx.Data.File = string.Empty; // Just to ignore both previous `ScrollOffset` and `BlockNavigation` LoadContent(); - } } } } @@ -156,7 +153,8 @@ private void LoadContent() Task.Run(async () => { - var numLines = Preferences.Instance.UseFullTextDiff ? _entireFileLine : _unifiedLines; + var showEntireFile = Preferences.Instance.UseFullTextDiff; + var numLines = showEntireFile ? _entireFileLine : _unifiedLines; var ignoreWhitespace = Preferences.Instance.IgnoreWhitespaceChangesInDiff; var latest = await new Commands.Diff(_repo, _option, numLines, ignoreWhitespace) @@ -200,10 +198,7 @@ private void LoadContent() } if (!isSubmodule) - { - latest.TextDiff.File = _option.Path; rs = latest.TextDiff; - } } else if (latest.IsBinary) { @@ -282,9 +277,9 @@ private void LoadContent() IsTextDiff = true; if (Preferences.Instance.UseSideBySideDiff) - Content = new TwoSideTextDiff(cur, _content as TwoSideTextDiff); + Content = new TwoSideTextDiff(_option, showEntireFile, cur, _content as TwoSideTextDiff); else - Content = new CombinedTextDiff(cur, _content as CombinedTextDiff); + Content = new CombinedTextDiff(_option, showEntireFile, cur, _content as CombinedTextDiff); } else { diff --git a/src/ViewModels/TextDiffContext.cs b/src/ViewModels/TextDiffContext.cs index 845afeac6..160da07f6 100644 --- a/src/ViewModels/TextDiffContext.cs +++ b/src/ViewModels/TextDiffContext.cs @@ -28,10 +28,8 @@ public static bool IsChanged(TextDiffSelectedChunk oldValue, TextDiffSelectedChu public class TextDiffContext : ObservableObject { + public Models.DiffOption Option => _option; public Models.TextDiff Data => _data; - public string File => _data.File; - public bool IsUnstaged => _data.Option.IsUnstaged; - public bool EnableChunkOption => _data.Option.WorkingCopyChange != null; public Vector ScrollOffset { @@ -132,6 +130,30 @@ public virtual TextDiffContext SwitchMode() return null; } + protected bool TryKeepPrevScrollOffset(TextDiffContext prev) + { + var fastTest = prev != null && + prev._showEntireFile == _showEntireFile && + prev._option.IsUnstaged == _option.IsUnstaged && + prev._option.Path.Equals(_option.Path, StringComparison.Ordinal) && + prev._option.OrgPath.Equals(_option.OrgPath, StringComparison.Ordinal) && + prev._option.Revisions.Count == _option.Revisions.Count; + + if (!fastTest) + return false; + + for (int i = 0; i < _option.Revisions.Count; i++) + { + if (!prev._option.Revisions[i].Equals(_option.Revisions[i], StringComparison.Ordinal)) + return false; + } + + _scrollOffset = prev._scrollOffset; + return true; + } + + protected Models.DiffOption _option = null; + protected bool _showEntireFile = false; protected Models.TextDiff _data = null; protected Vector _scrollOffset = Vector.Zero; protected BlockNavigation _blockNavigation = null; @@ -142,24 +164,19 @@ public virtual TextDiffContext SwitchMode() public class CombinedTextDiff : TextDiffContext { - public CombinedTextDiff(Models.TextDiff diff, CombinedTextDiff previous = null) + public CombinedTextDiff(Models.DiffOption option, bool showEntireFile, Models.TextDiff diff, CombinedTextDiff previous = null) { + _option = option; + _showEntireFile = showEntireFile; _data = diff; - if (previous != null && previous.File.Equals(File, StringComparison.Ordinal)) - { - _blockNavigation = new BlockNavigation(_data.Lines, false); - _scrollOffset = previous._scrollOffset; - } - else - { - _blockNavigation = new BlockNavigation(_data.Lines, true); - } + var keep = TryKeepPrevScrollOffset(previous); + _blockNavigation = new BlockNavigation(_data.Lines, !keep); } public override TextDiffContext SwitchMode() { - return new TwoSideTextDiff(_data); + return new TwoSideTextDiff(_option, _showEntireFile, _data); } } @@ -168,8 +185,10 @@ public class TwoSideTextDiff : TextDiffContext public List Old { get; } = []; public List New { get; } = []; - public TwoSideTextDiff(Models.TextDiff diff, TwoSideTextDiff previous = null) + public TwoSideTextDiff(Models.DiffOption option, bool showEntireFile, Models.TextDiff diff, TwoSideTextDiff previous = null) { + _option = option; + _showEntireFile = showEntireFile; _data = diff; foreach (var line in diff.Lines) @@ -192,15 +211,8 @@ public TwoSideTextDiff(Models.TextDiff diff, TwoSideTextDiff previous = null) FillEmptyLines(); - if (previous != null && previous.File.Equals(File, StringComparison.Ordinal)) - { - _blockNavigation = new BlockNavigation(Old, false); - _scrollOffset = previous._scrollOffset; - } - else - { - _blockNavigation = new BlockNavigation(Old, true); - } + var keep = TryKeepPrevScrollOffset(previous); + _blockNavigation = new BlockNavigation(Old, !keep); } public override bool IsSideBySide() @@ -210,7 +222,7 @@ public override bool IsSideBySide() public override TextDiffContext SwitchMode() { - return new CombinedTextDiff(_data); + return new CombinedTextDiff(_option, _showEntireFile, _data); } public void ConvertsToCombinedRange(ref int startLine, ref int endLine, bool isOldSide) diff --git a/src/Views/TextDiffView.axaml b/src/Views/TextDiffView.axaml index 5717a8bed..f301817eb 100644 --- a/src/Views/TextDiffView.axaml +++ b/src/Views/TextDiffView.axaml @@ -14,7 +14,7 @@ @@ -46,7 +45,7 @@ @@ -69,7 +67,7 @@ @@ -100,7 +97,7 @@ - - - - - From d580f7f269f86e53fa5c6f7cc5c521a6f0128355 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 8 Dec 2025 21:43:37 +0800 Subject: [PATCH 24/98] ux: window border style Signed-off-by: leo --- src/Native/Windows.cs | 2 +- src/Resources/Styles.axaml | 37 +++++++++++++++++++++++------------ src/Resources/Themes.axaml | 4 ++-- src/Views/ChromelessWindow.cs | 21 +++++++++++++++++++- 4 files changed, 48 insertions(+), 16 deletions(-) diff --git a/src/Native/Windows.cs b/src/Native/Windows.cs index 61f3c96a9..fa2cf7b1e 100644 --- a/src/Native/Windows.cs +++ b/src/Native/Windows.cs @@ -67,7 +67,7 @@ public void SetupWindow(Window window) { window.ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.NoChrome; window.ExtendClientAreaToDecorationsHint = true; - window.Classes.Add("fix_maximized_padding"); + window.BorderThickness = new Thickness(1); Win32Properties.AddWndProcHookCallback(window, (IntPtr hWnd, uint msg, IntPtr _, IntPtr lParam, ref bool handled) => { diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index a03adf6f6..651bc9505 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -24,25 +24,38 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Views/SubmodulesView.axaml b/src/Views/SubmodulesView.axaml index 963ae1b65..ddc70f3c2 100644 --- a/src/Views/SubmodulesView.axaml +++ b/src/Views/SubmodulesView.axaml @@ -10,7 +10,7 @@ x:Class="SourceGit.Views.SubmodulesView"> - + +