mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-11 23:57:21 -08:00
feature: add option to only highlight current branch in commit graph (#848)
- add a toggle button to only highlight current branch in commit graph - re-order buttons in histories toolbar - remove unused icons and styles
This commit is contained in:
parent
65e820e4d5
commit
26ebd5ae7e
20 changed files with 194 additions and 120 deletions
|
@ -25,10 +25,11 @@ namespace SourceGit.Models
|
|||
s_penCount = colors.Count;
|
||||
}
|
||||
|
||||
public class Path(int color)
|
||||
public class Path(int color, bool isMerged)
|
||||
{
|
||||
public List<Point> Points { get; } = [];
|
||||
public int Color { get; } = color;
|
||||
public bool IsMerged { get; } = isMerged;
|
||||
}
|
||||
|
||||
public class Link
|
||||
|
@ -37,6 +38,7 @@ namespace SourceGit.Models
|
|||
public Point Control;
|
||||
public Point End;
|
||||
public int Color;
|
||||
public bool IsMerged;
|
||||
}
|
||||
|
||||
public enum DotType
|
||||
|
@ -51,6 +53,7 @@ namespace SourceGit.Models
|
|||
public DotType Type;
|
||||
public Point Center;
|
||||
public int Color;
|
||||
public bool IsMerged;
|
||||
}
|
||||
|
||||
public List<Path> Paths { get; } = [];
|
||||
|
@ -108,7 +111,6 @@ namespace SourceGit.Models
|
|||
}
|
||||
|
||||
isMerged = isMerged || l.IsMerged;
|
||||
major.IsMerged = isMerged;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -122,7 +124,8 @@ namespace SourceGit.Models
|
|||
unsolved.Remove(l);
|
||||
ended.Clear();
|
||||
|
||||
// Create new curve for branch head
|
||||
// If no path found, create new curve for branch head
|
||||
// Otherwise, create new curve for new merged commit
|
||||
if (major == null)
|
||||
{
|
||||
offsetX += unitWidth;
|
||||
|
@ -136,11 +139,16 @@ namespace SourceGit.Models
|
|||
|
||||
colorIdx = (colorIdx + 1) % s_penCount;
|
||||
}
|
||||
else if (isMerged && !major.IsMerged && commit.Parents.Count > 0)
|
||||
{
|
||||
major.ReplaceMerged();
|
||||
temp.Paths.Add(major.Path);
|
||||
}
|
||||
|
||||
// Calculate link position of this commit.
|
||||
var position = new Point(major?.LastX ?? offsetX, offsetY);
|
||||
var dotColor = major?.Path.Color ?? 0;
|
||||
var anchor = new Dot() { Center = position, Color = dotColor };
|
||||
var anchor = new Dot() { Center = position, Color = dotColor, IsMerged = isMerged };
|
||||
if (commit.IsCurrentHead)
|
||||
anchor.Type = DotType.Head;
|
||||
else if (commit.Parents.Count > 1)
|
||||
|
@ -158,16 +166,20 @@ namespace SourceGit.Models
|
|||
var parent = unsolved.Find(x => x.Next.Equals(parentHash, StringComparison.Ordinal));
|
||||
if (parent != null)
|
||||
{
|
||||
// Try to change the merge state of linked graph
|
||||
if (isMerged)
|
||||
parent.IsMerged = true;
|
||||
if (isMerged && !parent.IsMerged)
|
||||
{
|
||||
parent.Goto(parent.LastX, offsetY + halfHeight, halfHeight);
|
||||
parent.ReplaceMerged();
|
||||
temp.Paths.Add(parent.Path);
|
||||
}
|
||||
|
||||
temp.Links.Add(new Link
|
||||
{
|
||||
Start = position,
|
||||
End = new Point(parent.LastX, offsetY + halfHeight),
|
||||
Control = new Point(parent.LastX, position.Y),
|
||||
Color = parent.Path.Color
|
||||
Color = parent.Path.Color,
|
||||
IsMerged = isMerged,
|
||||
});
|
||||
}
|
||||
else
|
||||
|
@ -207,30 +219,29 @@ namespace SourceGit.Models
|
|||
|
||||
private class PathHelper
|
||||
{
|
||||
public Path Path { get; }
|
||||
public Path Path { get; private set; }
|
||||
public string Next { get; set; }
|
||||
public bool IsMerged { get; set; }
|
||||
public double LastX { get; private set; }
|
||||
|
||||
public bool IsMerged => Path.IsMerged;
|
||||
|
||||
public PathHelper(string next, bool isMerged, int color, Point start)
|
||||
{
|
||||
Next = next;
|
||||
IsMerged = isMerged;
|
||||
LastX = start.X;
|
||||
_lastY = start.Y;
|
||||
|
||||
Path = new Path(color);
|
||||
Path = new Path(color, isMerged);
|
||||
Path.Points.Add(start);
|
||||
}
|
||||
|
||||
public PathHelper(string next, bool isMerged, int color, Point start, Point to)
|
||||
{
|
||||
Next = next;
|
||||
IsMerged = isMerged;
|
||||
LastX = to.X;
|
||||
_lastY = to.Y;
|
||||
|
||||
Path = new Path(color);
|
||||
Path = new Path(color, isMerged);
|
||||
Path.Points.Add(start);
|
||||
Path.Points.Add(to);
|
||||
}
|
||||
|
@ -310,6 +321,19 @@ namespace SourceGit.Models
|
|||
_lastY = y;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// End the current path and create a new from the end.
|
||||
/// </summary>
|
||||
public void ReplaceMerged()
|
||||
{
|
||||
var color = Path.Color;
|
||||
Add(LastX, _lastY);
|
||||
|
||||
Path = new Path(color, true);
|
||||
Path.Points.Add(new Point(LastX, _lastY));
|
||||
_endY = 0;
|
||||
}
|
||||
|
||||
private void Add(double x, double y)
|
||||
{
|
||||
if (_endY < y)
|
||||
|
@ -327,7 +351,6 @@ namespace SourceGit.Models
|
|||
private static readonly List<Color> s_defaultPenColors = [
|
||||
Colors.Orange,
|
||||
Colors.ForestGreen,
|
||||
Colors.Gray,
|
||||
Colors.Turquoise,
|
||||
Colors.Olive,
|
||||
Colors.Magenta,
|
||||
|
|
|
@ -32,6 +32,12 @@ namespace SourceGit.Models
|
|||
set;
|
||||
} = false;
|
||||
|
||||
public bool OnlyHighlighCurrentBranchInHistories
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = false;
|
||||
|
||||
public bool IncludeUntrackedInLocalChanges
|
||||
{
|
||||
get;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
<StreamGeometry x:Key="Icons.Bookmark">M832 64H192c-18 0-32 14-32 32v832c0 18 14 32 32 32h640c18 0 32-14 32-32V96c0-18-14-32-32-32zM736 596 624 502 506 596V131h230v318z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Branch">M757 226a143 143 0 00-55 276 96 96 0 01-88 59h-191a187 187 0 00-96 27V312a143 143 0 10-96 0v399a143 143 0 10103 2 96 96 0 0188-59h191a191 191 0 00187-151 143 143 0 00-43-279zM280 130a48 48 0 110 96 48 48 0 010-96zm0 764a48 48 0 110-96 48 48 0 010 96zM757 417a48 48 0 110-96 48 48 0 010 96z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Branch.Add">M896 128h-64V64c0-35-29-64-64-64s-64 29-64 64v64h-64c-35 0-64 29-64 64s29 64 64 64h64v64c0 35 29 64 64 64s64-29 64-64V256h64c35 0 64-29 64-64s-29-64-64-64zm-204 307C673 481 628 512 576 512H448c-47 0-90 13-128 35V372C394 346 448 275 448 192c0-106-86-192-192-192S64 86 64 192c0 83 54 154 128 180v280c-74 26-128 97-128 180c0 106 86 192 192 192s192-86 192-192c0-67-34-125-84-159c22-20 52-33 84-33h128c122 0 223-85 249-199c-19 4-37 7-57 7c-26 0-51-5-76-13zM256 128c35 0 64 29 64 64s-29 64-64 64s-64-29-64-64s29-64 64-64zm0 768c-35 0-64-29-64-64s29-64 64-64s64 29 64 64s-29 64-64 64z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Calender">M378 116l265 0 0 47-265 0 0-47ZM888 116 748 116l0 47 124 0c18 0 33 15 33 33l0 93L115 290l0-93c0-18 15-33 33-33l124 0 0-47L132 116c-35 0-64 29-64 64l0 714c0 35 29 64 64 64l757 0c35 0 64-29 64-64l-0-714C952 145 924 116 888 116zM905 337l0 540c0 18-15 33-33 33L148 910c-18 0-33-15-33-33L115 337 905 337zM301 65l47 0 0 170-47 0 0-170ZM673 65l47 0 0 170-47 0 0-170ZM358 548l0 231 53 0L411 459l-35 0-3 4c-18 26-41 49-70 68l-4 3 0 54 13-8C331 569 346 559 358 548zM618 727c-10 6-24 8-42 5-16-3-28-18-35-46l-2-9-48 13 2 8c6 30 18 52 36 65 17 13 36 20 55 21 3 0 7 0 10 0 15 0 28-2 40-7 14-6 27-13 37-23 10-10 18-22 23-37 5-14 8-28 8-42 1-14-1-27-4-39l-0-0c-3-12-8-24-15-36-7-13-19-23-35-30-15-7-31-11-47-11-11-0-23 1-36 5 4-15 8-32 11-52l114 0 0-49L536 464l-1 7c-25 116-32 145-33 150l-3 10 46 5 3-4c8-11 18-18 31-21 13-3 25-3 35-0 10 3 18 9 24 18 7 9 10 20 11 34 1 14-2 26-6 37C636 711 629 720 618 727z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Check">M512 597m-1 0a1 1 0 103 0a1 1 0 10-3 0ZM810 393 732 315 448 600 293 444 214 522l156 156 78 78 362-362z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Changes">M747 467c29 0 56 4 82 12v-363c0-47-38-84-84-84H125c-47 0-84 38-84 84v707c0 47 38 84 84 84h375a287 287 0 01-43-152c0-160 129-289 289-289zm-531-250h438c19 0 34 15 34 34s-15 34-34 34H216c-19 0-34-15-34-34s15-34 34-34zm0 179h263c19 0 34 15 34 34s-15 34-34 34H216c-19 0-34-15-34-34s15-34 34-34zm131 247h-131c-19 0-34-15-34-34s15-34 34-34h131c19 0 34 15 34 34s-15 34-34 34zM747 521c-130 0-236 106-236 236S617 992 747 992s236-106 236-236S877 521 747 521zm11 386v-65h-130c-12 0-22-10-22-22s10-22 22-22h260l-130 108zm108-192H606l130-108v65h130c12 0 22 10 22 22s-10 22-22 22z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.CherryPick">M529 511c115 0 212 79 239 185h224a62 62 0 017 123l-7 0-224 0a247 247 0 01-479 0H65a62 62 0 01-7-123l7-0h224a247 247 0 01239-185zm0 124a124 124 0 100 247 124 124 0 000-247zm0-618c32 0 58 24 61 55l0 7V206c89 11 165 45 225 103a74 74 0 0122 45l0 9v87a62 62 0 01-123 7l-0-7v-65l-6-4c-43-33-97-51-163-53l-17-0c-74 0-133 18-180 54l-6 4v65a62 62 0 01-55 61l-7 0a62 62 0 01-61-55l-0-7V362c0-20 8-39 23-53 60-58 135-92 224-103V79c0-34 28-62 62-62z</StreamGeometry>
|
||||
|
@ -63,9 +62,9 @@
|
|||
<StreamGeometry x:Key="Icons.Init">M412 66C326 132 271 233 271 347c0 17 1 34 4 50-41-48-98-79-162-83a444 444 0 00-46 196c0 207 142 382 337 439h2c19 0 34 15 34 33 0 11-6 21-14 26l1 14C183 973 0 763 0 511 0 272 166 70 393 7A35 35 0 01414 0c19 0 34 15 34 33a33 33 0 01-36 33zm200 893c86-66 141-168 141-282 0-17-1-34-4-50 41 48 98 79 162 83a444 444 0 0046-196c0-207-142-382-337-439h-2a33 33 0 01-34-33c0-11 6-21 14-26L596 0C841 51 1024 261 1024 513c0 239-166 441-393 504A35 35 0 01610 1024a33 33 0 01-34-33 33 33 0 0136-33zM512 704a192 192 0 110-384 192 192 0 010 384z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.InteractiveRebase">M512 64A447 447 0 0064 512c0 248 200 448 448 448s448-200 448-448S760 64 512 64zM218 295h31c54 0 105 19 145 55 13 12 13 31 3 43a35 35 0 01-22 10 36 36 0 01-21-7 155 155 0 00-103-39h-31a32 32 0 01-31-31c0-18 13-31 30-31zm31 433h-31a32 32 0 01-31-31c0-16 13-31 31-31h31A154 154 0 00403 512 217 217 0 01620 295h75l-93-67a33 33 0 01-7-43 33 33 0 0143-7l205 148-205 148a29 29 0 01-18 6 32 32 0 01-31-31c0-10 4-19 13-25l93-67H620a154 154 0 00-154 154c0 122-97 220-217 220zm390 118a29 29 0 01-18 6 32 32 0 01-31-31c0-10 4-19 13-25l93-67h-75c-52 0-103-19-143-54-12-12-13-31-1-43a30 30 0 0142-3 151 151 0 00102 39h75L602 599a33 33 0 01-7-43 33 33 0 0143-7l205 148-203 151z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Issue">M922 39H102A65 65 0 0039 106v609a65 65 0 0063 68h94v168a34 34 0 0019 31 30 30 0 0012 3 30 30 0 0022-10l182-192H922a65 65 0 0063-68V106A65 65 0 00922 39zM288 378h479a34 34 0 010 68H288a34 34 0 010-68zm0-135h479a34 34 0 010 68H288a34 34 0 010-68zm0 270h310a34 34 0 010 68H288a34 34 0 010-68z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.LayoutHorizontal">M875 117H149C109 117 75 151 75 192v640c0 41 34 75 75 75h725c41 0 75-34 75-75V192c0-41-34-75-75-75zM139 832V192c0-6 4-11 11-11h331v661H149c-6 0-11-4-11-11zm747 0c0 6-4 11-11 11H544v-661H875c6 0 11 4 11 11v640z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.LayoutVertical">M875 117H149C109 117 75 151 75 192v640c0 41 34 75 75 75h725c41 0 75-34 75-75V192c0-41-34-75-75-75zm-725 64h725c6 0 11 4 11 11v288h-747V192c0-6 4-11 11-11zm725 661H149c-6 0-11-4-11-11V544h747V832c0 6-4 11-11 11z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Layout">M875 117H149C109 117 75 151 75 192v640c0 41 34 75 75 75h725c41 0 75-34 75-75V192c0-41-34-75-75-75zM139 832V192c0-6 4-11 11-11h331v661H149c-6 0-11-4-11-11zm747 0c0 6-4 11-11 11H544v-661H875c6 0 11 4 11 11v640z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.LFS">M40 9 15 23 15 31 9 28 9 20 34 5 24 0 0 14 0 34 25 48 25 28 49 14zM26 29 26 48 49 34 49 15z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.LightOn">M892 251c-5-11-18-18-30-18H162c-12 0-23 7-30 18-5 11-5 26 2 35l179 265v320c0 56 44 102 99 102h200c55 0 99-46 99-102v-320l179-266c9-11 9-24 4-34zm-345 540c0 18-14 35-34 35-18 0-34-14-34-35v-157c0-18 14-34 34-34 18 0 34 14 34 34v157zM512 205c18 0 34-14 34-35V87c0-20-16-35-34-35s-34 14-34 35v84c1 20 16 34 34 34zM272 179c5 18 23 30 40 24 17-6 28-24 23-42l-25-51c-5-18-23-30-40-24s-28 24-23 42L272 179zM777 127c5-18-6-36-23-42-17-6-35 5-40 24l-25 51c-5 18 6 37 23 42 17 6 35-5 40-24l25-52z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Lines.All">M416 192m32 0 448 0q32 0 32 32l0 0q0 32-32 32l-448 0q-32 0-32-32l0 0q0-32 32-32ZM416 448m32 0 448 0q32 0 32 32l0 0q0 32-32 32l-448 0q-32 0-32-32l0 0q0-32 32-32ZM416 704m32 0 448 0q32 0 32 32l0 0q0 32-32 32l-448 0q-32 0-32-32l0 0q0-32 32-32ZM96 320l128-192 128 192h-256zM96 640l128 192 128-192h-256zM190 320h64v320H190z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Lines.Incr">M408 232C408 210 426 192 448 192h416a40 40 0 110 80H448a40 40 0 01-40-40zM408 512c0-22 18-40 40-40h416a40 40 0 110 80H448A40 40 0 01408 512zM448 752A40 40 0 00448 832h416a40 40 0 100-80H448zM32 480l132 0 0-128 64 0 0 128 132 0 0 64-132 0 0 128-64 0 0-128-132 0Z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Lines.Decr">M408 232C408 210 426 192 448 192h416a40 40 0 110 80H448a40 40 0 01-40-40zM408 512c0-22 18-40 40-40h416a40 40 0 110 80H448A40 40 0 01408 512zM448 752A40 40 0 00448 832h416a40 40 0 100-80H448zM32 480l328 0 0 64-328 0Z</StreamGeometry>
|
||||
|
@ -77,6 +76,7 @@
|
|||
<StreamGeometry x:Key="Icons.Menu">M192 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0ZM192 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0ZM192 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0ZM864 160H352c-17.7 0-32 14.3-32 32s14.3 32 32 32h512c17.7 0 32-14.3 32-32s-14.3-32-32-32zM864 480H352c-17.7 0-32 14.3-32 32s14.3 32 32 32h512c17.7 0 32-14.3 32-32s-14.3-32-32-32zM864 800H352c-17.7 0-32 14.3-32 32s14.3 32 32 32h512c17.7 0 32-14.3 32-32s-14.3-32-32-32z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Merge">M824 645V307c0-56-46-102-102-102h-102V102l-154 154 154 154V307h102v338c-46 20-82 67-82 123 0 72 61 133 133 133 72 0 133-61 133-133 0-56-36-102-82-123zm-51 195c-41 0-72-31-72-72s31-72 72-72c41 0 72 31 72 72s-31 72-72 72zM384 256c0-72-61-133-133-133-72 0-133 61-133 133 0 56 36 102 82 123v266C154 666 118 712 118 768c0 72 61 133 133 133 72 0 133-61 133-133 0-56-36-102-82-123V379C348 358 384 312 384 256zM323 768c0 41-31 72-72 72-41 0-72-31-72-72s31-72 72-72c41 0 72 31 72 72zM251 328c-41 0-72-31-72-72s31-72 72-72c41 0 72 31 72 72s-31 72-72 72z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Modified">M896 64H128C96 64 64 96 64 128v768c0 32 32 64 64 64h768c32 0 64-32 64-64V128c0-32-32-64-64-64z m-64 736c0 16-17 32-32 32H224c-18 0-32-12-32-32V224c0-16 16-32 32-32h576c15 0 32 16 32 32v576zM512 384c-71 0-128 57-128 128s57 128 128 128 128-57 128-128-57-128-128-128z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.More">M0 512M1024 512M512 0M512 1024M813 448c-46 0-83 37-83 83 0 46 37 83 83 83 46 0 83-37 83-83 0-46-37-83-83-83zM211 448C165 448 128 485 128 531c0 46 37 83 83 83 46 0 83-37 83-83 0-46-37-83-83-83zM512 448c-46 0-83 37-83 83 0 46 37 83 83 83 46 0 83-37 83-83C595 485 558 448 512 448z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Move">M299 811 299 725 384 725 384 811 299 811M469 811 469 725 555 725 555 811 469 811M640 811 640 725 725 725 725 811 640 811M299 640 299 555 384 555 384 640 299 640M469 640 469 555 555 555 555 640 469 640M640 640 640 555 725 555 725 640 640 640M299 469 299 384 384 384 384 469 299 469M469 469 469 384 555 384 555 469 469 469M640 469 640 384 725 384 725 469 640 469M299 299 299 213 384 213 384 299 299 299M469 299 469 213 555 213 555 299 469 299M640 299 640 213 725 213 725 299 640 299Z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.MoveToAnotherGroup">M64 363l0 204 265 0L329 460c0-11 6-18 14-20C349 437 355 437 362 441c93 60 226 149 226 149 33 22 34 60 0 82 0 0-133 89-226 149-14 9-32-3-32-18l-1-110L64 693l0 117c0 41 34 75 75 75l746 0c41 0 75-34 75-74L960 364c0-0 0-1 0-1L64 363zM64 214l0 75 650 0-33-80c-16-38-62-69-103-69l-440 0C97 139 64 173 64 214z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.OpenWith">M683 409v204L1024 308 683 0v191c-413 0-427 526-427 526c117-229 203-307 427-307zm85 492H102V327h153s38-63 114-122H51c-28 0-51 27-51 61v697c0 34 23 61 51 61h768c28 0 51-27 51-61V614l-102 100v187z</StreamGeometry>
|
||||
|
|
|
@ -351,7 +351,6 @@
|
|||
<x:String x:Key="Text.GitLFS.Track" xml:space="preserve">Verfolge alle '{0}' Dateien</x:String>
|
||||
<x:String x:Key="Text.GitLFS.TrackByExtension" xml:space="preserve">Verfolge alle *{0} Dateien</x:String>
|
||||
<x:String x:Key="Text.Histories" xml:space="preserve">Verlauf</x:String>
|
||||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">Wechsle zwischen horizontalem und vertikalem Layout</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>
|
||||
|
@ -565,7 +564,6 @@
|
|||
<x:String x:Key="Text.Repository.FilterCommits.Default" xml:space="preserve">Aufheben</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Exclude" xml:space="preserve">Im Graph ausblenden</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Include" xml:space="preserve">Im Graph filtern</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder" xml:space="preserve">Sortierungsmodus wechseln</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.ByDate" xml:space="preserve">Commit Zeitpunkt (--date-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.Topo" xml:space="preserve">Topologie (--topo-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">LOKALE BRANCHES</x:String>
|
||||
|
|
|
@ -348,7 +348,6 @@
|
|||
<x:String x:Key="Text.GitLFS.Track" xml:space="preserve">Track files named '{0}'</x:String>
|
||||
<x:String x:Key="Text.GitLFS.TrackByExtension" xml:space="preserve">Track all *{0} files</x:String>
|
||||
<x:String x:Key="Text.Histories" xml:space="preserve">HISTORY</x:String>
|
||||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">Switch Horizontal/Vertical Layout</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Author" xml:space="preserve">AUTHOR</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.AuthorTime" xml:space="preserve">AUTHOR TIME</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">GRAPH & SUBJECT</x:String>
|
||||
|
@ -563,13 +562,15 @@
|
|||
<x:String x:Key="Text.Repository.FilterCommits.Default" xml:space="preserve">Unset</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Exclude" xml:space="preserve">Hide in commit graph</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Include" xml:space="preserve">Filter in commit graph</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder" xml:space="preserve">Switch Order Mode</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesLayout.Horizontal" xml:space="preserve">Horizontal</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesLayout.Vertical" xml:space="preserve">Vertical</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.ByDate" xml:space="preserve">Commit Date (--date-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.Topo" xml:space="preserve">Topologically (--topo-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">LOCAL BRANCHES</x:String>
|
||||
<x:String x:Key="Text.Repository.NavigateToCurrentHead" xml:space="preserve">Navigate to HEAD</x:String>
|
||||
<x:String x:Key="Text.Repository.FirstParentFilterToggle" xml:space="preserve">Enable '--first-parent' Option</x:String>
|
||||
<x:String x:Key="Text.Repository.NewBranch" xml:space="preserve">Create Branch</x:String>
|
||||
<x:String x:Key="Text.Repository.OnlyHighlightCurrentBranchInHistories" xml:space="preserve">Only highlight current branch in graph</x:String>
|
||||
<x:String x:Key="Text.Repository.OpenIn" xml:space="preserve">Open in {0}</x:String>
|
||||
<x:String x:Key="Text.Repository.OpenWithExternalTools" xml:space="preserve">Open in External Tools</x:String>
|
||||
<x:String x:Key="Text.Repository.Refresh" xml:space="preserve">Refresh</x:String>
|
||||
|
@ -590,6 +591,7 @@
|
|||
<x:String x:Key="Text.Repository.Tags" xml:space="preserve">TAGS</x:String>
|
||||
<x:String x:Key="Text.Repository.Tags.Add" xml:space="preserve">NEW TAG</x:String>
|
||||
<x:String x:Key="Text.Repository.Terminal" xml:space="preserve">Open in Terminal</x:String>
|
||||
<x:String x:Key="Text.Repository.UseRelativeTimeInHistories" xml:space="preserve">Use relative time in histories</x:String>
|
||||
<x:String x:Key="Text.Repository.Worktrees" xml:space="preserve">WORKTREES</x:String>
|
||||
<x:String x:Key="Text.Repository.Worktrees.Add" xml:space="preserve">ADD WORKTREE</x:String>
|
||||
<x:String x:Key="Text.Repository.Worktrees.Prune" xml:space="preserve">PRUNE</x:String>
|
||||
|
|
|
@ -351,7 +351,6 @@
|
|||
<x:String x:Key="Text.GitLFS.Track" xml:space="preserve">Seguir archivos llamados '{0}'</x:String>
|
||||
<x:String x:Key="Text.GitLFS.TrackByExtension" xml:space="preserve">Seguir todos los archivos *{0}</x:String>
|
||||
<x:String x:Key="Text.Histories" xml:space="preserve">Historias</x:String>
|
||||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">Cambiar a Disposición Horizontal/Vertical</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">HORA DEL AUTOR</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">GRÁFICO & ASUNTO</x:String>
|
||||
|
@ -566,7 +565,6 @@
|
|||
<x:String x:Key="Text.Repository.FilterCommits.Default" xml:space="preserve">Desestablecer</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Exclude" xml:space="preserve">Ocultar en el Gráfico de Commits</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Include" xml:space="preserve">Filtrar en el Gráfico de Commits</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder" xml:space="preserve">Cambiar Modo de Ordenación</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.ByDate" xml:space="preserve">Fecha de Commit (--date-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.Topo" xml:space="preserve">Topológicamente (--topo-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">RAMAS LOCALES</x:String>
|
||||
|
|
|
@ -342,7 +342,6 @@
|
|||
<x:String x:Key="Text.GitLFS.Track" xml:space="preserve">Suivre les fichiers appelés '{0}'</x:String>
|
||||
<x:String x:Key="Text.GitLFS.TrackByExtension" xml:space="preserve">Suivre tous les fichiers *{0}</x:String>
|
||||
<x:String x:Key="Text.Histories" xml:space="preserve">Historique</x:String>
|
||||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">Basculer entre dispositions Horizontal/Vertical</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Author" xml:space="preserve">AUTEUR</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.AuthorTime" xml:space="preserve">HEURE DE L'AUTEUR</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">GRAPHE & SUJET</x:String>
|
||||
|
|
|
@ -344,7 +344,6 @@
|
|||
<x:String x:Key="Text.GitLFS.Track" xml:space="preserve">Traccia file con nome '{0}'</x:String>
|
||||
<x:String x:Key="Text.GitLFS.TrackByExtension" xml:space="preserve">Traccia tutti i file *{0}</x:String>
|
||||
<x:String x:Key="Text.Histories" xml:space="preserve">Storico</x:String>
|
||||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">Passa Layout Orizzontale/Verticale</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Author" xml:space="preserve">AUTORE</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.AuthorTime" xml:space="preserve">ORA AUTORE</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">GRAFICO & OGGETTO</x:String>
|
||||
|
|
|
@ -368,7 +368,6 @@
|
|||
<x:String x:Key="Text.GitLFS.Track" xml:space="preserve">Rastrear arquivos nomeados '{0}'</x:String>
|
||||
<x:String x:Key="Text.GitLFS.TrackByExtension" xml:space="preserve">Rastrear todos os arquivos *{0}</x:String>
|
||||
<x:String x:Key="Text.Histories" xml:space="preserve">Históricos</x:String>
|
||||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">Alternar Layout Horizontal/Vertical</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">DATA DO AUTOR</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">GRÁFICO & ASSUNTO</x:String>
|
||||
|
@ -570,7 +569,6 @@
|
|||
<x:String x:Key="Text.Repository.FilterCommits.Default" xml:space="preserve">Desfazer</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Exclude" xml:space="preserve">Esconder no gráfico de commit</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Include" xml:space="preserve">Incluir no gráfico de commit</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder" xml:space="preserve">Alternar Modo de Ordenação</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.ByDate" xml:space="preserve">Data do Commit (--date-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.Topo" xml:space="preserve">Topologicamente (--topo-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">BRANCHES LOCAIS</x:String>
|
||||
|
|
|
@ -352,7 +352,6 @@
|
|||
<x:String x:Key="Text.GitLFS.Track" xml:space="preserve">Отслеживать файлы с именем «{0}»</x:String>
|
||||
<x:String x:Key="Text.GitLFS.TrackByExtension" xml:space="preserve">Отслеживать все *{0} файлов</x:String>
|
||||
<x:String x:Key="Text.Histories" xml:space="preserve">Истории</x:String>
|
||||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">Переключение горизонтального/вертикального расположения</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Author" xml:space="preserve">АВТОР</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.AuthorTime" xml:space="preserve">ВРЕМЯ АВТОРА</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">ГРАФ И СУБЪЕКТ</x:String>
|
||||
|
@ -568,7 +567,6 @@
|
|||
<x:String x:Key="Text.Repository.FilterCommits.Exclude" xml:space="preserve">Скрыть в графе ревизии</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Include" xml:space="preserve">Фильтр в графе ревизии</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Prefix" xml:space="preserve">ОТФИЛЬТРОВАНО:</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder" xml:space="preserve">Переключить режим запроса</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.ByDate" xml:space="preserve">Дата ревизии (--date-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.Topo" xml:space="preserve">Топологически (--topo-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">ЛОКАЛЬНЫЕ ВЕТКИ</x:String>
|
||||
|
|
|
@ -351,7 +351,6 @@
|
|||
<x:String x:Key="Text.GitLFS.Track" xml:space="preserve">跟踪名为'{0}'的文件</x:String>
|
||||
<x:String x:Key="Text.GitLFS.TrackByExtension" xml:space="preserve">跟踪所有 *{0} 文件</x:String>
|
||||
<x:String x:Key="Text.Histories" xml:space="preserve">历史记录</x:String>
|
||||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">切换横向/纵向显示</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Author" xml:space="preserve">作者</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.AuthorTime" xml:space="preserve">修改时间</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">路线图与主题</x:String>
|
||||
|
@ -567,13 +566,15 @@
|
|||
<x:String x:Key="Text.Repository.FilterCommits.Default" xml:space="preserve">不指定</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Exclude" xml:space="preserve">在提交列表中隐藏</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Include" xml:space="preserve">使用其对提交列表过滤</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder" xml:space="preserve">切换排序模式</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesLayout.Horizontal" xml:space="preserve">水平排布</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesLayout.Vertical" xml:space="preserve">竖直排布</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.ByDate" xml:space="preserve">按提交时间 (--date-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.Topo" xml:space="preserve">按拓扑排序 (--topo-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">本地分支</x:String>
|
||||
<x:String x:Key="Text.Repository.NavigateToCurrentHead" xml:space="preserve">定位HEAD</x:String>
|
||||
<x:String x:Key="Text.Repository.FirstParentFilterToggle" xml:space="preserve">启用 --first-parent 过滤选项</x:String>
|
||||
<x:String x:Key="Text.Repository.NewBranch" xml:space="preserve">新建分支</x:String>
|
||||
<x:String x:Key="Text.Repository.OnlyHighlightCurrentBranchInHistories" xml:space="preserve">提交路线图中仅高亮显示当前分支</x:String>
|
||||
<x:String x:Key="Text.Repository.OpenIn" xml:space="preserve">在 {0} 中打开</x:String>
|
||||
<x:String x:Key="Text.Repository.OpenWithExternalTools" xml:space="preserve">使用外部工具打开</x:String>
|
||||
<x:String x:Key="Text.Repository.Refresh" xml:space="preserve">重新加载</x:String>
|
||||
|
@ -594,6 +595,7 @@
|
|||
<x:String x:Key="Text.Repository.Tags" xml:space="preserve">标签列表</x:String>
|
||||
<x:String x:Key="Text.Repository.Tags.Add" xml:space="preserve">新建标签</x:String>
|
||||
<x:String x:Key="Text.Repository.Terminal" xml:space="preserve">在终端中打开</x:String>
|
||||
<x:String x:Key="Text.Repository.UseRelativeTimeInHistories" xml:space="preserve">在提交列表中使用相对时间</x:String>
|
||||
<x:String x:Key="Text.Repository.Worktrees" xml:space="preserve">工作树列表</x:String>
|
||||
<x:String x:Key="Text.Repository.Worktrees.Add" xml:space="preserve">新增工作树</x:String>
|
||||
<x:String x:Key="Text.Repository.Worktrees.Prune" xml:space="preserve">清理</x:String>
|
||||
|
|
|
@ -351,7 +351,6 @@
|
|||
<x:String x:Key="Text.GitLFS.Track" xml:space="preserve">追蹤名稱為「{0}」的檔案</x:String>
|
||||
<x:String x:Key="Text.GitLFS.TrackByExtension" xml:space="preserve">追蹤所有 *{0} 檔案</x:String>
|
||||
<x:String x:Key="Text.Histories" xml:space="preserve">歷史記錄</x:String>
|
||||
<x:String x:Key="Text.Histories.DisplayMode" xml:space="preserve">切換橫向/縱向顯示</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Author" xml:space="preserve">作者</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.AuthorTime" xml:space="preserve">修改時間</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.GraphAndSubject" xml:space="preserve">路線圖與訊息標題</x:String>
|
||||
|
@ -566,13 +565,15 @@
|
|||
<x:String x:Key="Text.Repository.FilterCommits.Default" xml:space="preserve">取消指定</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Exclude" xml:space="preserve">在提交列表中隱藏</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommits.Include" xml:space="preserve">以其篩選提交列表</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder" xml:space="preserve">切換排序方式</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesLayout.Horizontal" xml:space="preserve">橫向顯示</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesLayout.Vertical" xml:space="preserve">縱向顯示</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.ByDate" xml:space="preserve">依提交時間排序 (--date-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.HistoriesOrder.Topo" xml:space="preserve">依拓撲排序 (--topo-order)</x:String>
|
||||
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">本機分支</x:String>
|
||||
<x:String x:Key="Text.Repository.NavigateToCurrentHead" xml:space="preserve">回到 HEAD</x:String>
|
||||
<x:String x:Key="Text.Repository.FirstParentFilterToggle" xml:space="preserve">啟用 [--first-parent] 選項</x:String>
|
||||
<x:String x:Key="Text.Repository.NewBranch" xml:space="preserve">新增分支</x:String>
|
||||
<x:String x:Key="Text.Repository.OnlyHighlightCurrentBranchInHistories" xml:space="preserve">提交圖表中僅高亮顯示目前分支</x:String>
|
||||
<x:String x:Key="Text.Repository.OpenIn" xml:space="preserve">在 {0} 中開啟</x:String>
|
||||
<x:String x:Key="Text.Repository.OpenWithExternalTools" xml:space="preserve">使用外部工具開啟</x:String>
|
||||
<x:String x:Key="Text.Repository.Refresh" xml:space="preserve">重新載入</x:String>
|
||||
|
@ -593,6 +594,7 @@
|
|||
<x:String x:Key="Text.Repository.Tags" xml:space="preserve">標籤列表</x:String>
|
||||
<x:String x:Key="Text.Repository.Tags.Add" xml:space="preserve">新增標籤</x:String>
|
||||
<x:String x:Key="Text.Repository.Terminal" xml:space="preserve">在終端機中開啟</x:String>
|
||||
<x:String x:Key="Text.Repository.UseRelativeTimeInHistories" xml:space="preserve">在提交清單中使用相對時間</x:String>
|
||||
<x:String x:Key="Text.Repository.Worktrees" xml:space="preserve">工作區列表</x:String>
|
||||
<x:String x:Key="Text.Repository.Worktrees.Add" xml:space="preserve">新增工作區</x:String>
|
||||
<x:String x:Key="Text.Repository.Worktrees.Prune" xml:space="preserve">清理</x:String>
|
||||
|
|
|
@ -1140,36 +1140,6 @@
|
|||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="ToggleButton.time_display_mode">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Background="Transparent"
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center">
|
||||
<Path x:Name="ChevronPath"
|
||||
Data="{StaticResource Icons.Calender}"
|
||||
Fill="{DynamicResource Brush.FG1}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Opacity="0.65"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^:checked /template/ Path#ChevronPath">
|
||||
<Setter Property="Data" Value="{StaticResource Icons.Stopwatch}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pointerover /template/ Path#ChevronPath">
|
||||
<Setter Property="Fill" Value="{DynamicResource Brush.Accent}" />
|
||||
<Setter Property="Opacity" Value="1"/>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="ToggleButton.folder">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
|
@ -1196,32 +1166,6 @@
|
|||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="ToggleButton.layout_direction">
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Background="Transparent">
|
||||
<Path x:Name="PART_IndicatorIcon"
|
||||
Width="14" Height="14"
|
||||
Stretch="Uniform"
|
||||
Data="{StaticResource Icons.LayoutVertical}"
|
||||
Fill="{DynamicResource Brush.FG1}"
|
||||
Opacity=".8"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="ToggleButton.layout_direction:checked /template/ Path#PART_IndicatorIcon">
|
||||
<Setter Property="Data" Value="{StaticResource Icons.LayoutHorizontal}"/>
|
||||
</Style>
|
||||
<Style Selector="ToggleButton.layout_direction:pointerover /template/ Path#PART_IndicatorIcon">
|
||||
<Setter Property="Opacity" Value="1"/>
|
||||
</Style>
|
||||
|
||||
<Style Selector="ToggleButton.line_path">
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
|
|
|
@ -128,6 +128,19 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
public bool OnlyHighlightCurrentBranchInHistories
|
||||
{
|
||||
get => _settings.OnlyHighlighCurrentBranchInHistories;
|
||||
set
|
||||
{
|
||||
if (value != _settings.OnlyHighlighCurrentBranchInHistories)
|
||||
{
|
||||
_settings.OnlyHighlighCurrentBranchInHistories = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string Filter
|
||||
{
|
||||
get => _filter;
|
||||
|
|
|
@ -88,9 +88,8 @@ namespace SourceGit.Views
|
|||
FontFamilyProperty,
|
||||
FontSizeProperty,
|
||||
ForegroundProperty,
|
||||
TagBackgroundProperty);
|
||||
|
||||
AffectsRender<CommitRefsPresenter>(
|
||||
UseGraphColorProperty,
|
||||
TagBackgroundProperty,
|
||||
BackgroundProperty);
|
||||
}
|
||||
|
||||
|
@ -172,7 +171,7 @@ namespace SourceGit.Views
|
|||
var typefaceBold = new Typeface(FontFamily, FontStyle.Normal, FontWeight.Bold);
|
||||
var fg = Foreground;
|
||||
var normalBG = UseGraphColor ? commit.Brush : Brushes.Gray;
|
||||
var tagBG = TagBackground;
|
||||
var tagBG = UseGraphColor ? TagBackground : Brushes.Gray;
|
||||
var labelSize = FontSize;
|
||||
var requiredWidth = 0.0;
|
||||
var requiredHeight = 16.0;
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=UseSideBySideDiff, Mode=TwoWay}"
|
||||
IsVisible="{Binding IsTextDiff}"
|
||||
ToolTip.Tip="{DynamicResource Text.Diff.SideBySide}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.LayoutHorizontal}" Margin="0,2,0,0"/>
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Layout}" Margin="0,2,0,0"/>
|
||||
</ToggleButton>
|
||||
|
||||
<Button Classes="icon_button" Width="28" Command="{Binding OpenExternalMergeTool}" ToolTip.Tip="{DynamicResource Text.Diff.UseMerger}">
|
||||
|
|
|
@ -48,9 +48,6 @@
|
|||
<TextBlock Classes="table_header" Text="{DynamicResource Text.Histories.Header.SHA}" HorizontalAlignment="Center"/>
|
||||
</Border>
|
||||
<StackPanel Grid.Column="4" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<ToggleButton Classes="time_display_mode"
|
||||
Width="10" Height="10"
|
||||
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=DisplayTimeAsPeriodInHistories, Mode=TwoWay}"/>
|
||||
<TextBlock Classes="table_header"
|
||||
Margin="6,0,0,0"
|
||||
Text="{DynamicResource Text.Histories.Header.Time}"
|
||||
|
@ -143,8 +140,14 @@
|
|||
Foreground="{DynamicResource Brush.FG1}"
|
||||
FontFamily="{DynamicResource Fonts.Primary}"
|
||||
FontSize="11"
|
||||
VerticalAlignment="Center"
|
||||
UseGraphColor="True"/>
|
||||
VerticalAlignment="Center">
|
||||
<v:CommitRefsPresenter.UseGraphColor>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.Or}">
|
||||
<Binding Path="IsMerged"/>
|
||||
<Binding Path="$parent[v:Histories].OnlyHighlightCurrentBranch" Converter="{x:Static BoolConverters.Not}"/>
|
||||
</MultiBinding>
|
||||
</v:CommitRefsPresenter.UseGraphColor>
|
||||
</v:CommitRefsPresenter>
|
||||
|
||||
<v:CommitSubjectPresenter Grid.Column="2"
|
||||
Classes="primary"
|
||||
|
@ -202,6 +205,7 @@
|
|||
<v:CommitGraph x:Name="CommitGraph"
|
||||
Graph="{Binding Graph}"
|
||||
DotBrush="{DynamicResource Brush.Contents}"
|
||||
OnlyHighlightCurrentBranch="{Binding $parent[v:Histories].OnlyHighlightCurrentBranch}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
IsHitTestVisible="False"
|
||||
ClipToBounds="True"/>
|
||||
|
|
|
@ -506,9 +506,18 @@ namespace SourceGit.Views
|
|||
set => SetValue(DotBrushProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<bool> OnlyHighlightCurrentBranchProperty =
|
||||
AvaloniaProperty.Register<CommitGraph, bool>(nameof(OnlyHighlightCurrentBranch), true);
|
||||
|
||||
public bool OnlyHighlightCurrentBranch
|
||||
{
|
||||
get => GetValue(OnlyHighlightCurrentBranchProperty);
|
||||
set => SetValue(OnlyHighlightCurrentBranchProperty, value);
|
||||
}
|
||||
|
||||
static CommitGraph()
|
||||
{
|
||||
AffectsRender<CommitGraph>(GraphProperty, DotBrushProperty);
|
||||
AffectsRender<CommitGraph>(GraphProperty, DotBrushProperty, OnlyHighlightCurrentBranchProperty);
|
||||
}
|
||||
|
||||
public override void Render(DrawingContext context)
|
||||
|
@ -545,6 +554,31 @@ namespace SourceGit.Views
|
|||
|
||||
private void DrawCurves(DrawingContext context, Models.CommitGraph graph, double top, double bottom)
|
||||
{
|
||||
var grayedPen = new Pen(Brushes.Gray, Models.CommitGraph.Pens[0].Thickness);
|
||||
var onlyHighlightCurrentBranch = OnlyHighlightCurrentBranch;
|
||||
|
||||
if (onlyHighlightCurrentBranch)
|
||||
{
|
||||
foreach (var link in graph.Links)
|
||||
{
|
||||
if (link.IsMerged)
|
||||
continue;
|
||||
if (link.End.Y < top)
|
||||
continue;
|
||||
if (link.Start.Y > bottom)
|
||||
break;
|
||||
|
||||
var geo = new StreamGeometry();
|
||||
using (var ctx = geo.Open())
|
||||
{
|
||||
ctx.BeginFigure(link.Start, false);
|
||||
ctx.QuadraticBezierTo(link.Control, link.End);
|
||||
}
|
||||
|
||||
context.DrawGeometry(null, grayedPen, geo);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var line in graph.Paths)
|
||||
{
|
||||
var last = line.Points[0];
|
||||
|
@ -610,11 +644,16 @@ namespace SourceGit.Views
|
|||
}
|
||||
}
|
||||
|
||||
if (!line.IsMerged && onlyHighlightCurrentBranch)
|
||||
context.DrawGeometry(null, grayedPen, geo);
|
||||
else
|
||||
context.DrawGeometry(null, pen, geo);
|
||||
}
|
||||
|
||||
foreach (var link in graph.Links)
|
||||
{
|
||||
if (onlyHighlightCurrentBranch && !link.IsMerged)
|
||||
continue;
|
||||
if (link.End.Y < top)
|
||||
continue;
|
||||
if (link.Start.Y > bottom)
|
||||
|
@ -633,8 +672,10 @@ namespace SourceGit.Views
|
|||
|
||||
private void DrawAnchors(DrawingContext context, Models.CommitGraph graph, double top, double bottom)
|
||||
{
|
||||
IBrush dotFill = DotBrush;
|
||||
Pen dotFillPen = new Pen(dotFill, 2);
|
||||
var dotFill = DotBrush;
|
||||
var dotFillPen = new Pen(dotFill, 2);
|
||||
var grayedPen = new Pen(Brushes.Gray, Models.CommitGraph.Pens[0].Thickness);
|
||||
var onlyHighlightCurrentBranch = OnlyHighlightCurrentBranch;
|
||||
|
||||
foreach (var dot in graph.Dots)
|
||||
{
|
||||
|
@ -644,6 +685,9 @@ namespace SourceGit.Views
|
|||
break;
|
||||
|
||||
var pen = Models.CommitGraph.Pens[dot.Color];
|
||||
if (!dot.IsMerged && onlyHighlightCurrentBranch)
|
||||
pen = grayedPen;
|
||||
|
||||
switch (dot.Type)
|
||||
{
|
||||
case Models.CommitGraph.DotType.Head:
|
||||
|
@ -692,6 +736,15 @@ namespace SourceGit.Views
|
|||
set => SetValue(IssueTrackerRulesProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<bool> OnlyHighlightCurrentBranchProperty =
|
||||
AvaloniaProperty.Register<Histories, bool>(nameof(OnlyHighlightCurrentBranch), true);
|
||||
|
||||
public bool OnlyHighlightCurrentBranch
|
||||
{
|
||||
get => GetValue(OnlyHighlightCurrentBranchProperty);
|
||||
set => SetValue(OnlyHighlightCurrentBranchProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<long> NavigationIdProperty =
|
||||
AvaloniaProperty.Register<Histories, long>(nameof(NavigationId));
|
||||
|
||||
|
|
|
@ -83,15 +83,11 @@
|
|||
</ListBox.ItemsPanel>
|
||||
|
||||
<ListBoxItem>
|
||||
<Grid Classes="view_mode" ColumnDefinitions="Auto,*,Auto,Auto,Auto,Auto">
|
||||
<Grid Classes="view_mode" ColumnDefinitions="Auto,*,Auto,Auto,Auto,Auto,Auto">
|
||||
<Path Grid.Column="0" Classes="icon" Data="{StaticResource Icons.Histories}"/>
|
||||
<TextBlock Grid.Column="1" Classes="header" Text="{DynamicResource Text.Histories}"/>
|
||||
|
||||
<ToggleButton Grid.Column="2"
|
||||
Classes="layout_direction"
|
||||
Width="28" Height="26"
|
||||
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=UseTwoColumnsLayoutInHistories, Mode=TwoWay}"
|
||||
ToolTip.Tip="{DynamicResource Text.Histories.DisplayMode}"/>
|
||||
<ToggleButton Grid.Column="3"
|
||||
Classes="line_path"
|
||||
Width="28" Height="26"
|
||||
Background="Transparent"
|
||||
|
@ -99,7 +95,7 @@
|
|||
ToolTip.Tip="{DynamicResource Text.Repository.EnableReflog}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Reference}"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Grid.Column="4"
|
||||
<ToggleButton Grid.Column="3"
|
||||
Classes="line_path"
|
||||
Width="28" Height="26"
|
||||
Background="Transparent"
|
||||
|
@ -107,12 +103,27 @@
|
|||
ToolTip.Tip="{DynamicResource Text.Repository.FirstParentFilterToggle}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.FirstParentFilter}"/>
|
||||
</ToggleButton>
|
||||
<Button Grid.Column="5"
|
||||
<ToggleButton Grid.Column="4"
|
||||
Classes="line_path"
|
||||
Width="28" Height="26"
|
||||
Background="Transparent"
|
||||
IsChecked="{Binding OnlyHighlightCurrentBranchInHistories, Mode=TwoWay}"
|
||||
ToolTip.Tip="{DynamicResource Text.Repository.OnlyHighlightCurrentBranchInHistories}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.LightOn}"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Grid.Column="5"
|
||||
Classes="line_path"
|
||||
Width="28" Height="26"
|
||||
Background="Transparent"
|
||||
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=DisplayTimeAsPeriodInHistories, Mode=TwoWay}"
|
||||
ToolTip.Tip="{DynamicResource Text.Repository.UseRelativeTimeInHistories}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Stopwatch}"/>
|
||||
</ToggleButton>
|
||||
<Button Grid.Column="6"
|
||||
Classes="icon_button"
|
||||
Width="28" Height="26"
|
||||
Click="OnSwitchHistoriesOrderClicked"
|
||||
ToolTip.Tip="{DynamicResource Text.Repository.HistoriesOrder}">
|
||||
<Path Width="12" Height="12" Margin="0,2,0,0" Data="{StaticResource Icons.Order}"/>
|
||||
Click="OnOpenAdvancedHistoriesOption">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.More}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</ListBoxItem>
|
||||
|
@ -677,6 +688,7 @@
|
|||
<v:Histories CurrentBranch="{Binding Repo.CurrentBranch}"
|
||||
AuthorNameColumnWidth="{Binding Source={x:Static vm:Preference.Instance}, Path=Layout.HistoriesAuthorColumnWidth, Mode=TwoWay}"
|
||||
IssueTrackerRules="{Binding Repo.Settings.IssueTrackerRules}"
|
||||
OnlyHighlightCurrentBranch="{Binding Repo.OnlyHighlightCurrentBranchInHistories}"
|
||||
NavigationId="{Binding NavigationId}"/>
|
||||
</DataTemplate>
|
||||
|
||||
|
|
|
@ -396,15 +396,35 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnSwitchHistoriesOrderClicked(object sender, RoutedEventArgs e)
|
||||
private void OnOpenAdvancedHistoriesOption(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button button && DataContext is ViewModels.Repository repo)
|
||||
{
|
||||
var checkIcon = App.CreateMenuIcon("Icons.Check");
|
||||
var isHorizontal = ViewModels.Preference.Instance.UseTwoColumnsLayoutInHistories;
|
||||
var horizontal = new MenuItem();
|
||||
horizontal.Header = App.Text("Repository.HistoriesLayout.Horizontal");
|
||||
if (isHorizontal)
|
||||
horizontal.Icon = App.CreateMenuIcon("Icons.Check");
|
||||
horizontal.Click += (_, ev) =>
|
||||
{
|
||||
ViewModels.Preference.Instance.UseTwoColumnsLayoutInHistories = true;
|
||||
ev.Handled = true;
|
||||
};
|
||||
|
||||
var vertical = new MenuItem();
|
||||
vertical.Header = App.Text("Repository.HistoriesLayout.Vertical");
|
||||
if (!isHorizontal)
|
||||
vertical.Icon = App.CreateMenuIcon("Icons.Check");
|
||||
vertical.Click += (_, ev) =>
|
||||
{
|
||||
ViewModels.Preference.Instance.UseTwoColumnsLayoutInHistories = false;
|
||||
ev.Handled = true;
|
||||
};
|
||||
|
||||
var dateOrder = new MenuItem();
|
||||
dateOrder.Header = App.Text("Repository.HistoriesOrder.ByDate");
|
||||
dateOrder.Icon = repo.EnableTopoOrderInHistories ? null : checkIcon;
|
||||
if (!repo.EnableTopoOrderInHistories)
|
||||
dateOrder.Icon = App.CreateMenuIcon("Icons.Check");
|
||||
dateOrder.Click += (_, ev) =>
|
||||
{
|
||||
repo.EnableTopoOrderInHistories = false;
|
||||
|
@ -413,7 +433,8 @@ namespace SourceGit.Views
|
|||
|
||||
var topoOrder = new MenuItem();
|
||||
topoOrder.Header = App.Text("Repository.HistoriesOrder.Topo");
|
||||
topoOrder.Icon = repo.EnableTopoOrderInHistories ? checkIcon : null;
|
||||
if (repo.EnableTopoOrderInHistories)
|
||||
topoOrder.Icon = App.CreateMenuIcon("Icons.Check");
|
||||
topoOrder.Click += (_, ev) =>
|
||||
{
|
||||
repo.EnableTopoOrderInHistories = true;
|
||||
|
@ -421,6 +442,9 @@ namespace SourceGit.Views
|
|||
};
|
||||
|
||||
var menu = new ContextMenu();
|
||||
menu.Items.Add(horizontal);
|
||||
menu.Items.Add(vertical);
|
||||
menu.Items.Add(new MenuItem() { Header = "-" });
|
||||
menu.Items.Add(dateOrder);
|
||||
menu.Items.Add(topoOrder);
|
||||
menu.Open(button);
|
||||
|
|
Loading…
Reference in a new issue