Skip to content

Commit 5967010

Browse files
authored
Merge pull request #490 from LogExperts/darkmode
first iteration of darkmode, needs to be adapted to the cellpainting DarkMode is Back, but its HIGHLY EXPERIMENTAL!
2 parents 337cac1 + 51d0214 commit 5967010

File tree

5 files changed

+44
-24
lines changed

5 files changed

+44
-24
lines changed

src/LogExpert.UI/Controls/BufferedDataGridView.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.ComponentModel;
12
using System.Drawing.Drawing2D;
23
using System.Runtime.Versioning;
34

@@ -6,7 +7,6 @@
67
using LogExpert.UI.Controls;
78

89
using NLog;
9-
using System.ComponentModel;
1010

1111
namespace LogExpert.Dialogs;
1212

@@ -246,6 +246,7 @@ private void PaintOverlays (PaintEventArgs e)
246246
foreach (var overlay in _overlayList.Values)
247247
{
248248
var textSize = myBuffer.Graphics.MeasureString(overlay.Bookmark.Text, _font, 300);
249+
249250
Rectangle rectBubble = new(overlay.Position, new Size((int)textSize.Width, (int)textSize.Height));
250251
rectBubble.Offset(60, -(rectBubble.Height + 40));
251252
rectBubble.Inflate(3, 3);
@@ -254,6 +255,7 @@ private void PaintOverlays (PaintEventArgs e)
254255
myBuffer.Graphics.SetClip(rectBubble, CombineMode.Union); // Bubble to clip
255256
myBuffer.Graphics.SetClip(rectTableHeader, CombineMode.Exclude);
256257
e.Graphics.SetClip(rectBubble, CombineMode.Union);
258+
257259
RectangleF textRect = new(rectBubble.X, rectBubble.Y, rectBubble.Width, rectBubble.Height);
258260
myBuffer.Graphics.FillRectangle(_brush, rectBubble);
259261
//myBuffer.Graphics.DrawLine(_pen, overlay.Position, new Point(rect.X, rect.Y + rect.Height / 2));

src/LogExpert.UI/Entities/PaintHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static void CellPainting (ILogPaintContextUI logPaintCtx, bool focused, i
7878
Alignment = StringAlignment.Center
7979
};
8080

81-
using var brush2 = new SolidBrush(Color.FromArgb(255, 190, 100, 0));
81+
using var brush2 = new SolidBrush(Color.FromArgb(255, 190, 100, 0)); //DarkOrange
8282
using var font = logPaintCtx.MonospacedFont;
8383
e.Graphics.DrawString("i", font, brush2, new RectangleF(r.Left, r.Top, r.Width, r.Height), format);
8484
}

src/LogExpert.UI/Interface/ILogPaintContextUI.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,26 @@ internal interface ILogPaintContextUI : ILogPaintContext
1414
#region Properties
1515

1616
Font MonospacedFont { get; } // Font font = new Font("Courier New", this.Preferences.fontSize, FontStyle.Bold);
17+
1718
Font NormalFont { get; }
19+
1820
Font BoldFont { get; }
21+
1922
Color BookmarkColor { get; }
2023

2124
#endregion
2225

2326
#region Public methods
2427

25-
ILogLine GetLogLine(int lineNum);
28+
ILogLine GetLogLine (int lineNum);
2629

27-
IColumn GetCellValue(int rowIndex, int columnIndex);
30+
IColumn GetCellValue (int rowIndex, int columnIndex);
2831

29-
Bookmark GetBookmarkForLine(int lineNum);
32+
Bookmark GetBookmarkForLine (int lineNum);
3033

31-
HighlightEntry FindHighlightEntry(ITextValue line, bool noWordMatches);
34+
HighlightEntry FindHighlightEntry (ITextValue line, bool noWordMatches);
3235

33-
IList<HighlightMatchEntry> FindHighlightMatches(ITextValue line);
36+
IList<HighlightMatchEntry> FindHighlightMatches (ITextValue line);
3437

3538
#endregion
3639
}

src/LogExpert/Program.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ private static void Main (string[] args)
9999
_ = PluginRegistry.PluginRegistry.Create(ConfigManager.Instance.ConfigDir, ConfigManager.Instance.Settings.Preferences.PollingInterval);
100100

101101
SetCulture();
102+
SetDarkMode();
102103

103104
ColumnizerLib.Column.SetMaxDisplayLength(ConfigManager.Instance.Settings.Preferences.MaxDisplayLength);
104105

@@ -215,6 +216,20 @@ or ArgumentNullException
215216
}
216217
}
217218

219+
[SupportedOSPlatform("windows")]
220+
private static void SetDarkMode ()
221+
{
222+
var darkModeEnabled = ConfigManager.Instance.Settings.Preferences.DarkMode;
223+
if (darkModeEnabled)
224+
{
225+
Application.SetColorMode(SystemColorMode.Dark);
226+
}
227+
else
228+
{
229+
Application.SetColorMode(SystemColorMode.System);
230+
}
231+
}
232+
218233
[SupportedOSPlatform("windows")]
219234
private static void SetCulture ()
220235
{
@@ -439,4 +454,4 @@ private static void CurrentDomain_UnhandledException (object sender, UnhandledEx
439454
}
440455

441456
#endregion
442-
}
457+
}

src/PluginRegistry/PluginHashGenerator.Generated.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,35 @@ public static partial class PluginValidator
1010
{
1111
/// <summary>
1212
/// Gets pre-calculated SHA256 hashes for built-in plugins.
13-
/// Generated: 2025-11-30 18:45:26 UTC
13+
/// Generated: 2025-12-01 20:32:57 UTC
1414
/// Configuration: Release
1515
/// Plugin count: 21
1616
/// </summary>
1717
public static Dictionary<string, string> GetBuiltInPluginHashes()
1818
{
1919
return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
2020
{
21-
["AutoColumnizer.dll"] = "377982AD769D3479E89B45F514BBE65548D77B9A942DF3FDC18FDC87CC43668E",
21+
["AutoColumnizer.dll"] = "37E42D7BD8BF4B6C28A701A2E121F24692359AAFF26D544BD4FE82F5BA0D02DE",
2222
["BouncyCastle.Cryptography.dll"] = "E5EEAF6D263C493619982FD3638E6135077311D08C961E1FE128F9107D29EBC6",
2323
["BouncyCastle.Cryptography.dll (x86)"] = "E5EEAF6D263C493619982FD3638E6135077311D08C961E1FE128F9107D29EBC6",
24-
["CsvColumnizer.dll"] = "B99857E99D37BE82DB17E930B3CD1CEF00C6441608F08DEC267245A9B5719E10",
25-
["CsvColumnizer.dll (x86)"] = "B99857E99D37BE82DB17E930B3CD1CEF00C6441608F08DEC267245A9B5719E10",
26-
["DefaultPlugins.dll"] = "B8DC13ECEB0C8B41E486A312B433703D3BB888BDC58A2D656DB4C5E1E4F8CCD2",
27-
["FlashIconHighlighter.dll"] = "53EDA420D21E396F3A40E92C21B042315C477C8C6E2DEA63AC9E3FCFFA889FCD",
28-
["GlassfishColumnizer.dll"] = "F0DD8A34B52C1C2EEA32129F16DD26F96FB1A8078F84282FFFCC92DDF6CF05CB",
29-
["JsonColumnizer.dll"] = "E3B8F96EAE3A8FA9E9A968BACD594510FBE592C15A92FA903EE8BE7814762E60",
30-
["JsonCompactColumnizer.dll"] = "576D983D73CC400734D53CE4EA017399A3229B7DD0DB6BEFAC933503EC50FFBB",
31-
["Log4jXmlColumnizer.dll"] = "EB734D044E52C697BFEC9C030A9F430F2DD82607F4FF04E86961DF82AC06CEC4",
32-
["LogExpert.Core.dll"] = "961C823B40481346B171EB5A7824DCF9757FB8CB534BC35F3C9B19BCE833FF86",
24+
["CsvColumnizer.dll"] = "0FAD54058DA267AFE64F27E35A8DBC9E158DDD1F2F5AED499705E1A9C3B1F154",
25+
["CsvColumnizer.dll (x86)"] = "0FAD54058DA267AFE64F27E35A8DBC9E158DDD1F2F5AED499705E1A9C3B1F154",
26+
["DefaultPlugins.dll"] = "31239786021979ABA32EDDD54B1A97B6E58CB5C65B8ADD5F64800AAAEC943208",
27+
["FlashIconHighlighter.dll"] = "B04EB26D5C4925428FC9604F3B429379FACF0028242FF928C7C24A1E554706C8",
28+
["GlassfishColumnizer.dll"] = "63B1BBEE663CF3DA4EF93A8FD049E5F8173F2E7ED1D5CF234945BC547D743B0F",
29+
["JsonColumnizer.dll"] = "1C06A934A034364FC9F0974C0FA335A0A1BD92A188538F020CF6AAC6C21BCFC7",
30+
["JsonCompactColumnizer.dll"] = "DA285ED66FAB1534A7257D0FB7D9219DB030A4FEB6ABB73623505EBD546B4083",
31+
["Log4jXmlColumnizer.dll"] = "688E34C5100AFD00E4AE0A5C42A4F8DC9A9E30938BAE6EF6AFA07D2ADAADA6CA",
32+
["LogExpert.Core.dll"] = "5BCB8ACA88FA0A90EDA57082241081B3A8F808B4C15D63D2988016FDE1BE7785",
3333
["Microsoft.Extensions.DependencyInjection.Abstractions.dll"] = "67FA4325000DB017DC0C35829B416F024F042D24EFB868BCF17A895EE6500A93",
3434
["Microsoft.Extensions.DependencyInjection.Abstractions.dll (x86)"] = "67FA4325000DB017DC0C35829B416F024F042D24EFB868BCF17A895EE6500A93",
3535
["Microsoft.Extensions.Logging.Abstractions.dll"] = "BB853130F5AFAF335BE7858D661F8212EC653835100F5A4E3AA2C66A4D4F685D",
3636
["Microsoft.Extensions.Logging.Abstractions.dll (x86)"] = "BB853130F5AFAF335BE7858D661F8212EC653835100F5A4E3AA2C66A4D4F685D",
37-
["RegexColumnizer.dll"] = "0A11B032FC19C6F573345B6B960BE55DDD17444141215EBB65A5FA22E5F31CF1",
38-
["SftpFileSystem.dll"] = "CBBCA0AE2150BE0325C92E2E175EA18B1EC3569203328D64FFDF5B35774B6CC4",
39-
["SftpFileSystem.dll (x86)"] = "E48351D978ABA385BB3D0829E82FDADA01A22876D7E0E304ACE6ACCD04F82FD3",
40-
["SftpFileSystem.Resources.dll"] = "AAA32F2CF836D3F8CCF23CDD945B3D7B242883F565DE966C8B5275544558DE60",
41-
["SftpFileSystem.Resources.dll (x86)"] = "AAA32F2CF836D3F8CCF23CDD945B3D7B242883F565DE966C8B5275544558DE60",
37+
["RegexColumnizer.dll"] = "285FF717F8A6BB6D0C7CD876B78126C3BF5FEF60EFC4B8E887CEE3E72A134C1A",
38+
["SftpFileSystem.dll"] = "F2B5EC7FB30D23CDD6B0179EDB426F0BE2B8D89C7FD468CFA29214E7DFBD5E73",
39+
["SftpFileSystem.dll (x86)"] = "24029844F510573B5ACD9E21F1BF6818EFA3DF8CC1C19FFD3C1FE716A89873E6",
40+
["SftpFileSystem.Resources.dll"] = "DB8D188C0113C27F65161D644DC4177707A255E601D53F0924779609E26E1205",
41+
["SftpFileSystem.Resources.dll (x86)"] = "DB8D188C0113C27F65161D644DC4177707A255E601D53F0924779609E26E1205",
4242

4343
};
4444
}

0 commit comments

Comments
 (0)