Skip to content

Commit 9cca27e

Browse files
Dark Mode (#212)
Dark Mode is here. To use edit the `ComicRack.ini` file and set `UseDarkMode = true` or add `-dark` to your shortcut. See PR #205, #212 for changes detail. Ref: #2 --------- Co-authored-by: gman <[email protected]>
1 parent 9e6ff0f commit 9cca27e

File tree

211 files changed

+7965
-1714
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+7965
-1714
lines changed

ComicRack.Engine/Controls/ComicPageControl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
using System.ComponentModel;
44
using System.Drawing;
55
using System.Linq;
6-
using System.Windows.Forms;
6+
using cYo.Common.Windows.Forms;
77

88
namespace cYo.Projects.ComicRack.Engine.Controls
99
{
10-
public class ComicPageControl : UserControl
10+
public class ComicPageControl : UserControlEx
1111
{
1212
private bool pendingUpdate;
1313

ComicRack.Engine/Controls/ListStyles.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Windows.Forms;
44
using cYo.Common.Drawing;
55
using cYo.Common.Windows.Forms;
6+
using cYo.Common.Windows.Forms.Theme;
67

78
namespace cYo.Projects.ComicRack.Engine.Controls
89
{
@@ -51,11 +52,9 @@ private static void DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
5152
}
5253

5354
private static void DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
54-
{
55-
e.DrawDefault = true;
56-
}
55+
=> ThemeExtensions.ListView_DrawColumnHeader(sender, e); // handles dark text on dark background in Dark Mode
5756

58-
private static void DrawItem(object sender, DrawListViewItemEventArgs e)
57+
private static void DrawItem(object sender, DrawListViewItemEventArgs e)
5958
{
6059
e.DrawDefault = false;
6160
e.DrawBackground();

ComicRack.Engine/Controls/MagnifySetupControl.Designer.cs

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ComicRack.Engine/Controls/MagnifySetupControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace cYo.Projects.ComicRack.Engine.Controls
1010
{
11-
public partial class MagnifySetupControl : UserControl
11+
public partial class MagnifySetupControl : UserControlEx
1212
{
1313
private TrackBarLite tbWidth;
1414
private TrackBarLite tbHeight;

ComicRack.Engine/Controls/MenuRenderer.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
using cYo.Common.Drawing;
2+
using cYo.Common.Windows.Forms.Theme.Resources;
13
using System.Drawing;
24
using System.Drawing.Drawing2D;
35
using System.Linq;
46
using System.Windows.Forms;
5-
using cYo.Common.Drawing;
67

78
namespace cYo.Projects.ComicRack.Engine.Controls
89
{
9-
public class MenuRenderer : ToolStripProfessionalRenderer
10-
{
10+
public class MenuRenderer : ThemeToolStripProRenderer
11+
{
1112
private Image starImage;
1213

1314
public Image StarImage
@@ -39,7 +40,7 @@ public static ProfessionalColorTable GetManagerColors()
3940
return (ToolStripManager.Renderer as ToolStripProfessionalRenderer)?.ColorTable;
4041
}
4142

42-
protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
43+
protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
4344
{
4445
if (starImage == null)
4546
{
@@ -49,7 +50,8 @@ protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
4950
Graphics graphics = e.Graphics;
5051
if (!text.StartsWith("*"))
5152
{
52-
base.OnRenderItemText(e);
53+
SetToolStripItemThemeColor(e);
54+
base.OnRenderItemText(e);
5355
return;
5456
}
5557
float num = text.Count((char c) => c == '*');
@@ -68,5 +70,5 @@ protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
6870
}
6971
}
7072
}
71-
}
73+
}
7274
}

0 commit comments

Comments
 (0)