From 55721154e004edb04713ecce7e926bb6b02b6c0b Mon Sep 17 00:00:00 2001 From: Ivan Grek Date: Sat, 27 Feb 2021 23:13:27 +0200 Subject: [PATCH] Apply experimental grid/list layout (cherry picked from commit 534c0b6d212c3720a306813f158826d7aff8072f) --- GitExtUtils/GitUI/Theming/AppColorDefaults.cs | 4 ++-- GitUI/Themes/invariant.css | 4 ++-- .../Columns/MessageColumnProvider.cs | 6 ++---- .../RevisionGrid/RevisionGridRefRenderer.cs | 20 +++++++------------ 4 files changed, 13 insertions(+), 21 deletions(-) diff --git a/GitExtUtils/GitUI/Theming/AppColorDefaults.cs b/GitExtUtils/GitUI/Theming/AppColorDefaults.cs index 1e582e44e06..862efc4aa8f 100644 --- a/GitExtUtils/GitUI/Theming/AppColorDefaults.cs +++ b/GitExtUtils/GitUI/Theming/AppColorDefaults.cs @@ -15,8 +15,8 @@ public static class AppColorDefaults { AppColor.HighlightAllOccurences, Color.LightYellow }, { AppColor.Tag, Color.DarkBlue }, { AppColor.Graph, Color.DarkRed }, - { AppColor.Branch, Color.Green }, - { AppColor.RemoteBranch, Color.DarkRed }, + { AppColor.Branch, Color.FromArgb(34, 166, 57) }, + { AppColor.RemoteBranch, Color.FromArgb(230, 99, 99) }, { AppColor.DiffSection, Color.FromArgb(230, 230, 230) }, { AppColor.DiffRemoved, Color.FromArgb(255, 200, 200) }, { AppColor.DiffRemovedExtra, Color.FromArgb(255, 165, 165) }, diff --git a/GitUI/Themes/invariant.css b/GitUI/Themes/invariant.css index 00039ff424d..8174fd342a6 100644 --- a/GitUI/Themes/invariant.css +++ b/GitUI/Themes/invariant.css @@ -39,8 +39,8 @@ .HighlightAllOccurences { color: #ffffe0; } .Tag { color: #00008b; } .Graph { color: #8b0000; } -.Branch { color: #008000; } -.RemoteBranch { color: #8b0000; } +.Branch { color: #22a639; } +.RemoteBranch { color: #e66363; } .DiffSection { color: #e6e6e6; } .DiffRemoved { color: #ffc8c8; } .DiffRemovedExtra { color: #ffa5a5; } diff --git a/GitUI/UserControls/RevisionGrid/Columns/MessageColumnProvider.cs b/GitUI/UserControls/RevisionGrid/Columns/MessageColumnProvider.cs index 4c0a2c91189..c15f5e9bda3 100644 --- a/GitUI/UserControls/RevisionGrid/Columns/MessageColumnProvider.cs +++ b/GitUI/UserControls/RevisionGrid/Columns/MessageColumnProvider.cs @@ -168,8 +168,7 @@ private void DrawArtificialRevision( RefArrowType.None, messageBounds, e.Graphics, - dashedLine: false, - fill: true); + dashedLine: false); var max = Math.Max( TextRenderer.MeasureText(ResourceManager.Strings.Workspace, style.NormalFont).Width, @@ -312,8 +311,7 @@ private void DrawRef( arrowType, messageBounds, e.Graphics, - dashedLine: superprojectRef is not null, - fill: true); + dashedLine: superprojectRef is not null); } private void DrawImage( diff --git a/GitUI/UserControls/RevisionGrid/RevisionGridRefRenderer.cs b/GitUI/UserControls/RevisionGrid/RevisionGridRefRenderer.cs index 1ef79ceba14..2c8caa06b81 100644 --- a/GitUI/UserControls/RevisionGrid/RevisionGridRefRenderer.cs +++ b/GitUI/UserControls/RevisionGrid/RevisionGridRefRenderer.cs @@ -16,13 +16,13 @@ internal static class RevisionGridRefRenderer private static readonly float[] _dashPattern = { 4, 4 }; private static readonly PointF[] _arrowPoints = new PointF[4]; - public static void DrawRef(bool isRowSelected, Font font, ref int offset, string name, Color headColor, RefArrowType arrowType, in Rectangle bounds, Graphics graphics, bool dashedLine = false, bool fill = false) + public static void DrawRef(bool isRowSelected, Font font, ref int offset, string name, Color headColor, RefArrowType arrowType, in Rectangle bounds, Graphics graphics, bool dashedLine = false) { var paddingLeftRight = DpiUtil.Scale(4); var paddingTopBottom = DpiUtil.Scale(2); var marginRight = DpiUtil.Scale(7); - var textColor = fill ? headColor : Lerp(headColor, Color.White, 0.5f); + var textColor = Lerp(headColor, Color.Black, 0.25F); var textSize = TextRenderer.MeasureText(graphics, name, font, Size.Empty, TextFormatFlags.NoPadding); @@ -47,7 +47,7 @@ public static void DrawRef(bool isRowSelected, Font font, ref int offset, string graphics, headColor, rect, - radius: 3, arrowType, dashedLine, fill); + radius: 3, arrowType, dashedLine); var textBounds = new Rectangle( rect.X + arrowWidth + paddingLeftRight, @@ -60,7 +60,7 @@ public static void DrawRef(bool isRowSelected, Font font, ref int offset, string offset += rect.Width + marginRight; } - private static void DrawRefBackground(bool isRowSelected, Graphics graphics, Color color, Rectangle bounds, int radius, RefArrowType arrowType, bool dashedLine, bool fill) + private static void DrawRefBackground(bool isRowSelected, Graphics graphics, Color color, Rectangle bounds, int radius, RefArrowType arrowType, bool dashedLine) { var oldMode = graphics.SmoothingMode; graphics.SmoothingMode = SmoothingMode.AntiAlias; @@ -68,20 +68,14 @@ private static void DrawRefBackground(bool isRowSelected, Graphics graphics, Col try { using var path = CreateRoundRectPath(bounds, radius); - if (fill) - { - var color1 = Lerp(color, SystemColors.Window, 0.92F); - var color2 = Lerp(color1, SystemColors.Window, 0.9f); - using var brush = new LinearGradientBrush(bounds, color1, color2, angle: 90); - graphics.FillPath(brush, path); - } - else if (isRowSelected) + + if (isRowSelected) { graphics.FillPath(SystemBrushes.Window, path); } // frame - using var pen = new Pen(Lerp(color, SystemColors.Window, 0.83F)); + using var pen = new Pen(Lerp(color, SystemColors.Window, 0.5F)); if (dashedLine) { pen.DashPattern = _dashPattern;