418 gui design highlighting unreadable color#424
Conversation
src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindowEventHandlers.cs
Outdated
Show resolved
Hide resolved
src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindowEventHandlers.cs
Outdated
Show resolved
Hide resolved
…ble-color # Conflicts: # src/LogExpert.Core/EventHandlers/EventHandlers.cs # src/LogExpert.UI/Entities/PaintHelper.cs
src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindowEventHandlers.cs
Outdated
Show resolved
Hide resolved
src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindowEventHandlers.cs
Outdated
Show resolved
Hide resolved
dotnet-version changed to 9.0.x
src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindowEventHandlers.cs
Outdated
Show resolved
Hide resolved
… are no longer resx problems when opening a form and visual studio creates a resx file
…ble-color # Conflicts: # src/LogExpert.UI/LogExpert.UI.csproj
…ble-color # Conflicts: # src/LogExpert.UI/Controls/LogWindow/LogWindowPrivate.cs
…ble-color # Conflicts: # src/LogExpert.UI/Controls/LogWindow/LogWindow.designer.cs
|
|
||
| if (_logFileReader != null) | ||
| { | ||
| if (CurrentColumnizer is IPreProcessColumnizer columnizer1) |
There was a problem hiding this comment.
Solve IDE0045:
_logFileReader.PreProcessColumnizer = CurrentColumnizer is IPreProcessColumnizer columnizer1 ? columnizer1 : null;
| { | ||
| //keeping this comment, because it's the original code | ||
| // = new Rectangle(e.CellBounds.Left + 2, e.CellBounds.Top + 2, 6, 6); | ||
| var r = e.CellBounds; |
There was a problem hiding this comment.
Instead of the r do:
e.CellBounds.Inflate(-2, -2);
I think if you do that you can also remove the comment unless you really still want to keep it.
| Rectangle wordRect = new(wordPos, wordSize); | ||
|
|
||
| var foreColor = matchEntry.HighlightEntry.ForegroundColor; | ||
| if (!e.State.HasFlag(DataGridViewElementStates.Selected)) |
There was a problem hiding this comment.
I prefer positive comparison over negative ones so if you don't mind change the condition.
| [SupportedOSPlatform("windows")] | ||
| private void CreateDefaultViewStyle () | ||
| { | ||
|
|
|
|
||
| e.Graphics.DrawString(entry.SearchText, e.Font, new SolidBrush(entry.ForegroundColor), | ||
| new PointF(rectangle.Left, rectangle.Top)); | ||
| e.Graphics.DrawString(entry.SearchText, e.Font, new SolidBrush(forgroundColor), new PointF(rectangle.Left, rectangle.Top)); |
There was a problem hiding this comment.
Solid brush should be disposed:
using (var brush = new SolidBrush(forgroundColor))
{
e.Graphics.DrawString(entry.SearchText, e.Font, brush, new PointF(rectangle.Left, rectangle.Top));
}| IList<HighlightMatchEntry> matchList = logPaintCtx.FindHighlightMatches(value as ILogLine); | ||
| var matchList = logPaintCtx.FindHighlightMatches(value as ILogLine); | ||
| // too many entries per line seem to cause problems with the GDI | ||
| while (matchList.Count > 50) |
There was a problem hiding this comment.
What is this number 50? I don't like magic numbers in the code so if it possible maybe remove it or put it in a const with a meaningful name or something else.
Regardless of the above, Simplify:
if (matchList.Count > 50)
{
matchList.RemoveRange(50, matchList.Count - 50);
}
| @@ -314,7 +368,7 @@ private static void PaintHighlightedCell (ILogPaintContextUI logPaintCtx, DataGr | |||
| { | |||
There was a problem hiding this comment.
remove the gridView param
| @@ -314,7 +368,7 @@ private static void PaintHighlightedCell (ILogPaintContextUI logPaintCtx, DataGr | |||
| { | |||
| var value = e.Value ?? string.Empty; | |||
There was a problem hiding this comment.
I think it is safe and more logic to change the code to:
var value = e.Value as ITextValue;
var matchList = logPaintCtx.FindHighlightMatches(value);maybe even to:
var value = e.Value as Column;| @@ -366,7 +420,7 @@ private static void PaintHighlightedCell (ILogPaintContextUI logPaintCtx, DataGr | |||
| } | |||
|
|
|||
|
|
|||
| @@ -314,7 +368,7 @@ private static void PaintHighlightedCell (ILogPaintContextUI logPaintCtx, DataGr | |||
| { | |||
There was a problem hiding this comment.
I would put a TODO: Refactor on this method
No description provided.