mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-27 21:27:19 -08:00
Compare commits
No commits in common. "7df96377b89b3a873e7d77b5c1dfb5a80d714802" and "6908216de554de2b762136bdc47bbc50fef77691" have entirely different histories.
7df96377b8
...
6908216de5
35 changed files with 72 additions and 108 deletions
Binary file not shown.
Before Width: | Height: | Size: 804 KiB After Width: | Height: | Size: 759 KiB |
Binary file not shown.
Before Width: | Height: | Size: 712 KiB After Width: | Height: | Size: 911 KiB |
|
@ -14,7 +14,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = "branch -l --all -v --format=\"%(refname)%00%(objectname)%00%(HEAD)%00%(upstream)%00%(upstream:trackshort)\"";
|
||||
Args = "branch -l --all -v --format=\"%(refname)$%(objectname)$%(HEAD)$%(upstream)$%(upstream:trackshort)\"";
|
||||
}
|
||||
|
||||
public List<Models.Branch> Result()
|
||||
|
@ -37,7 +37,7 @@ namespace SourceGit.Commands
|
|||
|
||||
private Models.Branch ParseLine(string line)
|
||||
{
|
||||
var parts = line.Split('\0');
|
||||
var parts = line.Split('$');
|
||||
if (parts.Length != 5)
|
||||
return null;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
Context = repo;
|
||||
WorkingDirectory = repo;
|
||||
Args = "tag -l --sort=-creatordate --format=\"%(refname)%00%(objectname)%00%(*objectname)\"";
|
||||
Args = "tag -l --sort=-creatordate --format=\"$%(refname)$%(objectname)$%(*objectname)\"";
|
||||
}
|
||||
|
||||
public List<Models.Tag> Result()
|
||||
|
@ -32,14 +32,25 @@ namespace SourceGit.Commands
|
|||
|
||||
private Models.Tag ParseLine(string line)
|
||||
{
|
||||
var subs = line.Split('\0');
|
||||
if (subs.Length != 3)
|
||||
return null;
|
||||
var subs = line.Split('$', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (subs.Length == 2)
|
||||
{
|
||||
return new Models.Tag()
|
||||
{
|
||||
Name = subs[0].Substring(10),
|
||||
SHA = subs[1],
|
||||
};
|
||||
}
|
||||
else if (subs.Length == 3)
|
||||
{
|
||||
return new Models.Tag()
|
||||
{
|
||||
Name = subs[0].Substring(10),
|
||||
SHA = subs[2],
|
||||
};
|
||||
}
|
||||
|
||||
var tag = new Models.Tag();
|
||||
tag.Name = subs[0].Substring(10);
|
||||
tag.SHA = string.IsNullOrEmpty(subs[2]) ? subs[1] : subs[2];
|
||||
return tag;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
foreach (var c in changes)
|
||||
pathsBuilder.Append($"\"{c.Path}\" ");
|
||||
|
||||
|
||||
var paths = pathsBuilder.ToString();
|
||||
Args = $"stash push --staged -m \"{message}\" -- {paths}";
|
||||
}
|
||||
|
@ -51,11 +51,11 @@ namespace SourceGit.Commands
|
|||
new Add(WorkingDirectory, needAdd).Exec();
|
||||
needAdd.Clear();
|
||||
}
|
||||
|
||||
|
||||
var paths = pathsBuilder.ToString();
|
||||
Args = $"stash push -m \"{message}\" -- {paths}";
|
||||
}
|
||||
|
||||
|
||||
return Exec();
|
||||
}
|
||||
|
||||
|
|
|
@ -327,15 +327,14 @@ namespace SourceGit.Models
|
|||
private static readonly List<Color> s_defaultPenColors = [
|
||||
Colors.Orange,
|
||||
Colors.ForestGreen,
|
||||
Colors.Gold,
|
||||
Colors.Magenta,
|
||||
Colors.Red,
|
||||
Colors.Gray,
|
||||
Colors.Turquoise,
|
||||
Colors.Olive,
|
||||
Colors.Magenta,
|
||||
Colors.Red,
|
||||
Colors.Khaki,
|
||||
Colors.Lime,
|
||||
Colors.RoyalBlue,
|
||||
Colors.Teal,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace SourceGit.Models
|
|||
get;
|
||||
set;
|
||||
} = string.Empty;
|
||||
|
||||
|
||||
public DealWithLocalChanges DealWithLocalChangesOnCheckoutBranch
|
||||
{
|
||||
get;
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace SourceGit.Native
|
|||
startInfo.CreateNoWindow = true;
|
||||
startInfo.RedirectStandardOutput = true;
|
||||
startInfo.StandardOutputEncoding = Encoding.UTF8;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var proc = new Process() { StartInfo = startInfo };
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
<StreamGeometry x:Key="Icons.Push">M592 768h-160c-27 0-48-21-48-48V384h-175c-36 0-53-43-28-68L485 11c15-15 40-15 55 0l304 304c25 25 7 68-28 68H640v336c0 27-21 48-48 48zm432-16v224c0 27-21 48-48 48H48c-27 0-48-21-48-48V752c0-27 21-48 48-48h272v16c0 62 50 112 112 112h160c62 0 112-50 112-112v-16h272c27 0 48 21 48 48zm-248 176c0-22-18-40-40-40s-40 18-40 40s18 40 40 40s40-18 40-40zm128 0c0-22-18-40-40-40s-40 18-40 40s18 40 40 40s40-18 40-40z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Rebase">M277 85a149 149 0 00-43 292v230a32 32 0 0064 0V555h267A160 160 0 00725 395v-12a149 149 0 10-64-5v17a96 96 0 01-96 96H299V383A149 149 0 00277 85zM228 720a32 32 0 00-37-52 150 150 0 00-53 68 32 32 0 1060 23 85 85 0 0130-39zm136-52a32 32 0 00-37 52 86 86 0 0130 39 32 32 0 1060-23 149 149 0 00-53-68zM204 833a32 32 0 10-55 32 149 149 0 0063 58 32 32 0 0028-57 85 85 0 01-36-33zm202 32a32 32 0 00-55-32 85 85 0 01-36 33 32 32 0 0028 57 149 149 0 0063-58z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Relation">m224 154a166 166 0 00-166 166v192a166 166 0 00166 166h64v-76h-64a90 90 0 01-90-90v-192a90 90 0 0190-90h320a90 90 0 0190 90v192a90 90 0 01-90 90h-128v77h128a166 166 0 00166-167v-192a166 166 0 00-166-166h-320zm166 390a90 90 0 0190-90h128v-76h-128a166 166 0 00-166 166v192a166 166 0 00166 166h320a166 166 0 00166-166v-192a166 166 0 00-166-166h-64v77h64a90 90 0 0190 90v192a90 90 0 01-90 90h-320a90 90 0 01-90-90v-192z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Remote">M512 128M706 302a289 289 0 00-173 44 27 27 0 1029 46 234 234 0 01125-36c23 0 45 3 66 9 93 28 161 114 161 215C914 704 813 805 687 805H337C211 805 110 704 110 580c0-96 61-178 147-210C282 263 379 183 495 183a245 245 0 01210 119z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Remote">M706 302a289 289 0 00-173 44 27 27 0 1029 46 234 234 0 01125-36c23 0 45 3 66 9 93 28 161 114 161 215C914 704 813 805 687 805H337C211 805 110 704 110 580c0-96 61-178 147-210C282 263 379 183 495 183a245 245 0 01210 119z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Remote.Add">M364 512h67v108h108v67h-108v108h-67v-108h-108v-67h108v-108zm298-64A107 107 0 01768 555C768 614 720 660 660 660h-108v-54h-108v-108h-94v108h-94c4-21 22-47 44-51l-1-12a75 75 0 0171-75a128 128 0 01239-7a106 106 0 0153-14z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Remotes">M115 386l19 33c17 29 44 50 76 60l116 33c34 10 58 41 58 77v80c0 22 12 42 32 52s32 30 32 52v78c0 31 30 54 60 45 32-9 57-35 65-68l6-22c8-34 30-63 61-80l16-9c30-17 48-49 48-83v-17c0-25-10-50-28-68l-8-8c-18-18-42-28-68-28H514c-22 0-44-6-64-17l-69-39c-9-5-15-13-18-22-6-19 2-40 20-49l12-6c13-7 29-8 43-3l46 15c16 5 34-1 44-15 9-14 8-33-2-46l-27-33c-20-24-20-59 1-83l31-37c18-21 20-50 7-73l-5-8c-7-0-14-1-21-1-186 0-343 122-396 290zM928 512c0-74-19-143-53-203L824 330c-31 13-48 48-37 80l34 101c7 21 24 37 45 42l58 15c2-18 4-36 4-55zM0 512a512 512 0 111024 0 512 512 0 11-1024 0z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.RemoveAll">M1024 64v704h-128v128h-128v128h-768v-704h128v-128h128v-128zM64 960h640v-576h-640zM320 128v64h576v512h64v-576zM192 256v64h576v512h64v-576zM432 688L576 832H480L384 736 288 832H192l144-144L192 544h96L384 640l96-96H576z</StreamGeometry>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<x:String x:Key="Text.About" xml:space="preserve">Info</x:String>
|
||||
<x:String x:Key="Text.About.Menu" xml:space="preserve">Über SourceGit</x:String>
|
||||
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Erstellt mit </x:String>
|
||||
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Grafik gerendert durch </x:String>
|
||||
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
|
||||
<x:String x:Key="Text.About.Editor" xml:space="preserve">• Texteditor von </x:String>
|
||||
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Monospace-Schriftarten von </x:String>
|
||||
|
@ -86,11 +85,8 @@
|
|||
<x:String x:Key="Text.Checkout.LocalChanges.DoNothing" xml:space="preserve">Nichts tun</x:String>
|
||||
<x:String x:Key="Text.Checkout.LocalChanges.StashAndReply" xml:space="preserve">Stashen & wieder anwenden</x:String>
|
||||
<x:String x:Key="Text.CherryPick" xml:space="preserve">Cherry Pick</x:String>
|
||||
<x:String x:Key="Text.CherryPick.AppendSourceToMessage" xml:space="preserve">Quelle an Commit-Nachricht anhängen</x:String>
|
||||
<x:String x:Key="Text.CherryPick.Commit" xml:space="preserve">Commit(s):</x:String>
|
||||
<x:String x:Key="Text.CherryPick.CommitChanges" xml:space="preserve">Alle Änderungen committen</x:String>
|
||||
<x:String x:Key="Text.CherryPick.Mainline" xml:space="preserve">Hautplinie:</x:String>
|
||||
<x:String x:Key="Text.CherryPick.Mainline.Tips" xml:space="preserve">Normalerweise ist es nicht möglich einen Merge zu cherry-picken, da unklar ist welche Seite des Merges die Hauptlinie ist. Diese Option ermöglicht es die Änderungen relativ zum ausgewählten Vorgänger zu wiederholen.</x:String>
|
||||
<x:String x:Key="Text.ClearStashes" xml:space="preserve">Stashes löschen</x:String>
|
||||
<x:String x:Key="Text.ClearStashes.Message" xml:space="preserve">Du versuchst alle Stashes zu löschen. Möchtest du wirklich fortfahren?</x:String>
|
||||
<x:String x:Key="Text.Clone" xml:space="preserve">Remote Repository klonen</x:String>
|
||||
|
@ -320,7 +316,6 @@
|
|||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">Wechsle zwischen horizontalem und vertikalem Layout</x:String>
|
||||
<x:String x:Key="Text.Histories.GraphMode" xml:space="preserve">Wechsle zwischen Kurven- und Konturgraphenmodus</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Author" xml:space="preserve">AUTOR</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.AuthorTime" xml:space="preserve">AUTOR ZEITPUNKT</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">GRAPH & COMMIT-NACHRICHT</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.SHA" xml:space="preserve">SHA</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Time" xml:space="preserve">COMMIT ZEITPUNKT</x:String>
|
||||
|
@ -420,7 +415,6 @@
|
|||
<x:String x:Key="Text.Preference.General.Check4UpdatesOnStartup" xml:space="preserve">Beim Starten nach Updates suchen</x:String>
|
||||
<x:String x:Key="Text.Preference.General.Locale" xml:space="preserve">Sprache</x:String>
|
||||
<x:String x:Key="Text.Preference.General.MaxHistoryCommits" xml:space="preserve">Commit-Historie</x:String>
|
||||
<x:String x:Key="Text.Preference.General.ShowAuthorTime" xml:space="preserve">Zeige Autor Zeitpunkt anstatt Commit Zeitpunkt</x:String>
|
||||
<x:String x:Key="Text.Preference.General.SubjectGuideLength" xml:space="preserve">Längenvorgabe für Commit-Nachrichten</x:String>
|
||||
<x:String x:Key="Text.Preference.Git" xml:space="preserve">GIT</x:String>
|
||||
<x:String x:Key="Text.Preference.Git.CRLF" xml:space="preserve">Aktiviere Auto-CRLF</x:String>
|
||||
|
@ -569,8 +563,6 @@
|
|||
<x:String x:Key="Text.Stash.IncludeUntracked" xml:space="preserve">Inklusive nicht-verfolgter Dateien</x:String>
|
||||
<x:String x:Key="Text.Stash.Message" xml:space="preserve">Name:</x:String>
|
||||
<x:String x:Key="Text.Stash.Message.Placeholder" xml:space="preserve">Optional. Name dieses Stashes</x:String>
|
||||
<x:String x:Key="Text.Stash.OnlyStagedChanges" xml:space="preserve">Nur gestagte Änderungen</x:String>
|
||||
<x:String x:Key="Text.Stash.TipForSelectedFiles" xml:space="preserve">Gestagte und unstagte Änderungen der ausgewähleten Datei(en) werden gestasht!!!</x:String>
|
||||
<x:String x:Key="Text.Stash.Title" xml:space="preserve">Lokale Änderungen stashen</x:String>
|
||||
<x:String x:Key="Text.StashCM.Apply" xml:space="preserve">Anwenden</x:String>
|
||||
<x:String x:Key="Text.StashCM.Drop" xml:space="preserve">Entfernen</x:String>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<Color x:Key="Color.Contents">#FFFAFAFA</Color>
|
||||
<Color x:Key="Color.Badge">#FFB0CEE8</Color>
|
||||
<Color x:Key="Color.BadgeFG">#FF1F1F1F</Color>
|
||||
<Color x:Key="Color.DecoratorTag">DarkGreen</Color>
|
||||
<Color x:Key="Color.DecoratorTag">#79855f</Color>
|
||||
<Color x:Key="Color.Conflict">#FF836C2E</Color>
|
||||
<Color x:Key="Color.ConflictForeground">#FFFFFFFF</Color>
|
||||
<Color x:Key="Color.Border0">#FFCFCFCF</Color>
|
||||
|
|
|
@ -38,14 +38,14 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.1.4" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.1.4" />
|
||||
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.4" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.4" />
|
||||
<PackageReference Include="Avalonia.Diagnostics" Version="11.1.4" Condition="'$(Configuration)' == 'Debug'" />
|
||||
<PackageReference Include="Avalonia" Version="11.1.3" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.1.3" />
|
||||
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.3" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.3" />
|
||||
<PackageReference Include="Avalonia.Diagnostics" Version="11.1.3" Condition="'$(Configuration)' == 'Debug'" />
|
||||
<PackageReference Include="Avalonia.AvaloniaEdit" Version="11.1.0" />
|
||||
<PackageReference Include="AvaloniaEdit.TextMate" Version="11.1.0" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
<PackageReference Include="LiveChartsCore.SkiaSharpView.Avalonia" Version="2.0.0-rc3.3" />
|
||||
<PackageReference Include="TextMateSharp" Version="1.0.63" />
|
||||
<PackageReference Include="TextMateSharp.Grammars" Version="1.0.63" />
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace SourceGit.ViewModels
|
|||
Targets[0].SHA,
|
||||
!AutoCommit,
|
||||
AppendSourceToMessage,
|
||||
$"-m {MainlineForMergeCommit + 1}").Exec();
|
||||
$"-m {MainlineForMergeCommit+1}").Exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -96,7 +96,7 @@ namespace SourceGit.ViewModels
|
|||
AppendSourceToMessage,
|
||||
string.Empty).Exec();
|
||||
}
|
||||
|
||||
|
||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||
return succ;
|
||||
});
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace SourceGit.ViewModels
|
|||
set;
|
||||
} = 0;
|
||||
}
|
||||
|
||||
|
||||
public class Discard : Popup
|
||||
{
|
||||
public object Mode
|
||||
|
|
|
@ -156,7 +156,7 @@ namespace SourceGit.ViewModels
|
|||
|
||||
if (_repo.SearchResultSelectedCommit == null || _repo.SearchResultSelectedCommit.SHA != commit.SHA)
|
||||
{
|
||||
_repo.SearchResultSelectedCommit = _repo.SearchedCommits.Find(x => x.SHA == commit.SHA);
|
||||
_repo.SearchResultSelectedCommit = _repo.SearchedCommits.Find(x => x.SHA == commit.SHA);
|
||||
}
|
||||
|
||||
AutoSelectedCommit = commit;
|
||||
|
@ -445,7 +445,7 @@ namespace SourceGit.ViewModels
|
|||
PopupHost.ShowPopup(new CherryPick(_repo, commit, parents));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
e.Handled = true;
|
||||
};
|
||||
menu.Items.Add(cherryPick);
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace SourceGit.ViewModels
|
|||
return Models.MergeMode.Supported[2];
|
||||
if (config.Equals("--no-commit", StringComparison.Ordinal) || config.Equals("--no-ff --no-commit", StringComparison.Ordinal))
|
||||
return Models.MergeMode.Supported[3];
|
||||
|
||||
|
||||
return Models.MergeMode.Supported[0];
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace SourceGit.ViewModels
|
|||
_repo.Settings.Filters.Remove(oldName);
|
||||
_repo.Settings.Filters.Add($"refs/heads/{_name}");
|
||||
}
|
||||
|
||||
|
||||
_repo.MarkBranchesDirtyManually();
|
||||
_repo.SetWatcherEnabled(true);
|
||||
});
|
||||
|
|
|
@ -862,7 +862,7 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
if (_settings.Filters.Count != 0)
|
||||
Dispatcher.UIThread.Invoke(() => _settings.Filters.Clear());
|
||||
|
||||
|
||||
limits += "--exclude=refs/stash --all";
|
||||
}
|
||||
|
||||
|
|
|
@ -1202,7 +1202,7 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
if (_useAmend)
|
||||
return new Commands.QueryStagedChangesWithAmend(_repo.FullPath).Result();
|
||||
|
||||
|
||||
var rs = new List<Models.Change>();
|
||||
foreach (var c in _cached)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace SourceGit.Views
|
|||
|
||||
if (node.Backend is Models.Remote)
|
||||
{
|
||||
CreateContent(new Thickness(0, 0, 0, 0), "Icons.Remote");
|
||||
CreateContent(new Thickness(0, 2, 0, 0), "Icons.Remote");
|
||||
}
|
||||
else if (node.Backend is Models.Branch branch)
|
||||
{
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace SourceGit.Views
|
|||
];
|
||||
|
||||
private static readonly string[] INDICATOR = ["?", "±", "T", "+", "−", "➜", "❏", "U", "★"];
|
||||
private static readonly string[] TIPS = ["Unknown", "Modified", "Type Changed", "Added", "Deleted", "Renamed", "Copied", "Unmerged", "Untracked"];
|
||||
private static readonly string[] TIPS = ["Unknown", "Modified", "Type Changed", "Added", "Deleted", "Renamed", "Copied", "Unmerged", "Untracked" ];
|
||||
|
||||
public static readonly StyledProperty<bool> IsUnstagedChangeProperty =
|
||||
AvaloniaProperty.Register<ChangeStatusIcon, bool>(nameof(IsUnstagedChange));
|
||||
|
@ -142,7 +142,7 @@ namespace SourceGit.Views
|
|||
ToolTip.SetTip(this, c.IsConflit ? "Conflict" : TIPS[(int)c.WorkTree]);
|
||||
else
|
||||
ToolTip.SetTip(this, TIPS[(int)c.Index]);
|
||||
|
||||
|
||||
InvalidateVisual();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,8 +102,7 @@
|
|||
Foreground="{DynamicResource Brush.FG1}"
|
||||
FontFamily="{DynamicResource Fonts.Primary}"
|
||||
FontSize="11"
|
||||
VerticalAlignment="Center"
|
||||
UseGraphColor="False"/>
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
|
||||
<!-- Messages -->
|
||||
|
|
|
@ -37,15 +37,6 @@ namespace SourceGit.Views
|
|||
set => SetValue(FontSizeProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IBrush> BackgroundProperty =
|
||||
AvaloniaProperty.Register<CommitRefsPresenter, IBrush>(nameof(Background), null);
|
||||
|
||||
public IBrush Background
|
||||
{
|
||||
get => GetValue(BackgroundProperty);
|
||||
set => SetValue(BackgroundProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IBrush> ForegroundProperty =
|
||||
AvaloniaProperty.Register<CommitRefsPresenter, IBrush>(nameof(Foreground), Brushes.White);
|
||||
|
||||
|
@ -55,15 +46,6 @@ namespace SourceGit.Views
|
|||
set => SetValue(ForegroundProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<bool> UseGraphColorProperty =
|
||||
AvaloniaProperty.Register<CommitRefsPresenter, bool>(nameof(UseGraphColor), false);
|
||||
|
||||
public bool UseGraphColor
|
||||
{
|
||||
get => GetValue(UseGraphColorProperty);
|
||||
set => SetValue(UseGraphColorProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IBrush> TagBackgroundProperty =
|
||||
AvaloniaProperty.Register<CommitRefsPresenter, IBrush>(nameof(TagBackground), Brushes.White);
|
||||
|
||||
|
@ -77,12 +59,10 @@ namespace SourceGit.Views
|
|||
{
|
||||
AffectsMeasure<CommitRefsPresenter>(
|
||||
FontFamilyProperty,
|
||||
FontSizeProperty,
|
||||
ForegroundProperty,
|
||||
TagBackgroundProperty);
|
||||
FontSizeProperty);
|
||||
|
||||
AffectsRender<CommitRefsPresenter>(
|
||||
BackgroundProperty);
|
||||
TagBackgroundProperty);
|
||||
}
|
||||
|
||||
public override void Render(DrawingContext context)
|
||||
|
@ -90,43 +70,35 @@ namespace SourceGit.Views
|
|||
if (_items.Count == 0)
|
||||
return;
|
||||
|
||||
var useGraphColor = UseGraphColor;
|
||||
var fg = Foreground;
|
||||
var bg = Background;
|
||||
var x = 1.0;
|
||||
foreach (var item in _items)
|
||||
{
|
||||
var iconRect = new RoundedRect(new Rect(x, 0, 16, 16), new CornerRadius(2, 0, 0, 2));
|
||||
var entireRect = new RoundedRect(new Rect(x, 0, item.Width, 16), new CornerRadius(2));
|
||||
|
||||
using (context.PushTransform(Matrix.CreateTranslation(x + 3, 3)))
|
||||
context.DrawGeometry(fg, null, item.Icon);
|
||||
|
||||
if (item.IsHead)
|
||||
{
|
||||
if (useGraphColor)
|
||||
{
|
||||
using (context.PushOpacity(.6))
|
||||
context.DrawRectangle(item.Brush, null, entireRect);
|
||||
}
|
||||
using (context.PushOpacity(.4))
|
||||
context.DrawRectangle(item.Brush, null, entireRect);
|
||||
|
||||
context.DrawText(item.Label, new Point(x + 16, 8.0 - item.Label.Height * 0.5));
|
||||
context.DrawRectangle(null, new Pen(item.Brush), entireRect);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bg != null)
|
||||
context.DrawRectangle(bg, null, entireRect);
|
||||
|
||||
var labelRect = new RoundedRect(new Rect(x + 16, 0, item.Label.Width + 8, 16), new CornerRadius(0, 2, 2, 0));
|
||||
using (context.PushOpacity(.2))
|
||||
context.DrawRectangle(item.Brush, null, labelRect);
|
||||
|
||||
context.DrawLine(new Pen(item.Brush), new Point(x + 16, 0), new Point(x + 16, 16));
|
||||
context.DrawText(item.Label, new Point(x + 20, 8.0 - item.Label.Height * 0.5));
|
||||
context.DrawRectangle(null, new Pen(item.Brush), entireRect);
|
||||
}
|
||||
|
||||
context.DrawRectangle(null, new Pen(item.Brush), entireRect);
|
||||
|
||||
using (context.PushTransform(Matrix.CreateTranslation(x + 3, 3)))
|
||||
context.DrawGeometry(fg, null, item.Icon);
|
||||
|
||||
x += item.Width + 4;
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +123,6 @@ namespace SourceGit.Views
|
|||
var typeface = new Typeface(FontFamily);
|
||||
var typefaceBold = new Typeface(FontFamily, FontStyle.Normal, FontWeight.Bold);
|
||||
var fg = Foreground;
|
||||
var normalBG = UseGraphColor ? commit.Brush : Brushes.Gray;
|
||||
var tagBG = TagBackground;
|
||||
var labelSize = FontSize;
|
||||
var requiredWidth = 0.0;
|
||||
|
@ -169,13 +140,7 @@ namespace SourceGit.Views
|
|||
isHead ? labelSize + 1 : labelSize,
|
||||
fg);
|
||||
|
||||
var item = new RenderItem()
|
||||
{
|
||||
Label = label,
|
||||
Brush = normalBG,
|
||||
IsHead = isHead
|
||||
};
|
||||
|
||||
var item = new RenderItem() { Label = label, Brush = commit.Brush, IsHead = isHead };
|
||||
StreamGeometry geo;
|
||||
switch (decorator.Type)
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
Text="{DynamicResource Text.DeleteRemote}"/>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,16,0,0">
|
||||
<TextBlock Text="{DynamicResource Text.DeleteRemote.Remote}"/>
|
||||
<Path Width="14" Height="14" Margin="8,2,8,0" Data="{StaticResource Icons.Remote}"/>
|
||||
<Path Width="14" Height="14" Margin="8,6,8,0" Data="{StaticResource Icons.Remote}"/>
|
||||
<TextBlock Text="{Binding Remote.Name}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="{x:Type m:Remote}">
|
||||
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
|
||||
<Path Margin="0,2,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<Path Margin="0,6,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
|
|
@ -138,13 +138,11 @@
|
|||
VerticalAlignment="Center"/>
|
||||
|
||||
<v:CommitRefsPresenter Grid.Column="1"
|
||||
Background="{DynamicResource Brush.Contents}"
|
||||
TagBackground="{DynamicResource Brush.DecoratorTag}"
|
||||
Foreground="{DynamicResource Brush.FG1}"
|
||||
FontFamily="{DynamicResource Fonts.Primary}"
|
||||
FontSize="11"
|
||||
VerticalAlignment="Center"
|
||||
UseGraphColor="True"/>
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<v:CommitSubjectPresenter Grid.Column="2"
|
||||
Classes="primary"
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace SourceGit.Views
|
|||
var item = vm.SelectedItem;
|
||||
if (item == null)
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
base.OnKeyDown(e);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="{x:Type m:Remote}">
|
||||
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
|
||||
<Path Margin="0,2,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<Path Margin="0,6,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="{x:Type m:Remote}">
|
||||
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
|
||||
<Path Margin="0,2,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<Path Margin="0,6,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="{x:Type m:Remote}">
|
||||
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
|
||||
<Path Margin="0,2,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<Path Margin="0,6,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
Text="{DynamicResource Text.PruneRemote}"/>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,16,0,0">
|
||||
<TextBlock Text="{DynamicResource Text.PruneRemote.Target}"/>
|
||||
<Path Width="14" Height="14" Margin="8,2,8,0" Data="{StaticResource Icons.Remote}"/>
|
||||
<Path Width="14" Height="14" Margin="8,6,8,0" Data="{StaticResource Icons.Remote}"/>
|
||||
<TextBlock Text="{Binding Remote.Name}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="{x:Type m:Remote}">
|
||||
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
|
||||
<Path Margin="0,2,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<Path Margin="0,6,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="{x:Type m:Remote}">
|
||||
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
|
||||
<Path Margin="0,2,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<Path Margin="0,6,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="{x:Type m:Remote}">
|
||||
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
|
||||
<Path Margin="0,2,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<Path Margin="0,6,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
|
||||
<Path Margin="0,2,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<Path Margin="0,6,8,0" Width="14" Height="14" Fill="{DynamicResource Brush.FG1}" Data="{StaticResource Icons.Remote}"/>
|
||||
<TextBlock Text="{Binding}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
|
Loading…
Reference in a new issue