Skip to content

418 gui design highlighting unreadable color#424

Merged
Hirogen merged 31 commits intoDevelopmentfrom
418-gui-design---highlighting-unreadable-color
Jun 26, 2025
Merged

418 gui design highlighting unreadable color#424
Hirogen merged 31 commits intoDevelopmentfrom
418-gui-design---highlighting-unreadable-color

Conversation

@Hirogen
Copy link
Copy Markdown
Collaborator

@Hirogen Hirogen commented Jun 16, 2025

No description provided.

@Hirogen Hirogen linked an issue Jun 16, 2025 that may be closed by this pull request
@Hirogen Hirogen linked an issue Jun 16, 2025 that may be closed by this pull request
Hirogen added 5 commits June 17, 2025 08:19
…ble-color

# Conflicts:
#	src/LogExpert.Core/EventHandlers/EventHandlers.cs
#	src/LogExpert.UI/Entities/PaintHelper.cs
@Hirogen Hirogen requested a review from RandallFlagg June 18, 2025 14:11
@Hirogen Hirogen requested a review from RandallFlagg June 19, 2025 18:01
dotnet-version changed to 9.0.x
Hirogen added 5 commits June 21, 2025 18:09
… 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
Hirogen added 3 commits June 21, 2025 20:48
…ble-color

# Conflicts:
#	src/LogExpert.UI/Controls/LogWindow/LogWindowPrivate.cs
…ble-color

# Conflicts:
#	src/LogExpert.UI/Controls/LogWindow/LogWindow.designer.cs
@Hirogen Hirogen requested a review from RandallFlagg June 22, 2025 11:57

if (_logFileReader != null)
{
if (CurrentColumnizer is IPreProcessColumnizer columnizer1)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer positive comparison over negative ones so if you don't mind change the condition.

[SupportedOSPlatform("windows")]
private void CreateDefaultViewStyle ()
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete line


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));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the gridView param

@@ -314,7 +368,7 @@ private static void PaintHighlightedCell (ILogPaintContextUI logPaintCtx, DataGr
{
var value = e.Value ?? string.Empty;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
}


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete line

@@ -314,7 +368,7 @@ private static void PaintHighlightedCell (ILogPaintContextUI logPaintCtx, DataGr
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put a TODO: Refactor on this method

@Hirogen Hirogen merged commit c828c52 into Development Jun 26, 2025
1 check passed
@Hirogen Hirogen deleted the 418-gui-design---highlighting-unreadable-color branch June 26, 2025 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants