mirror of
https://github.com/FroggMaster/CreamInstaller.git
synced 2026-06-12 11:01:23 -07:00
Fix Light Mode Selection Bar
- Adjusts the selection bar so it properly selects the whole field. - Adjusted the color of the selection bar to be a lighter blue so text is easier to read.
This commit is contained in:
@@ -162,7 +162,32 @@ internal sealed class CustomTreeView : TreeView
|
||||
}
|
||||
else
|
||||
{
|
||||
e.DrawDefault = true;
|
||||
if (highlighted && CheckBoxes)
|
||||
{
|
||||
// In light mode, take ownership of the row when selected so the
|
||||
// highlight fills the full width (same approach as dark mode).
|
||||
e.DrawDefault = false;
|
||||
|
||||
Rectangle rowRect = new(0, node.Bounds.Top, ClientSize.Width, node.Bounds.Height);
|
||||
graphics.FillRectangle(selectionBrush, rowRect);
|
||||
|
||||
Font nodeFont = node.NodeFont ?? Font;
|
||||
Color textColor = Enabled ? ForeColor : SystemColors.GrayText;
|
||||
TextRenderer.DrawText(graphics, node.Text, nodeFont,
|
||||
new Point(node.Bounds.Left, node.Bounds.Top + 1), textColor, TextFormatFlags.Default);
|
||||
|
||||
CheckBoxState cbState = node.Checked
|
||||
? (Enabled ? CheckBoxState.CheckedNormal : CheckBoxState.CheckedDisabled)
|
||||
: (Enabled ? CheckBoxState.UncheckedNormal : CheckBoxState.UncheckedDisabled);
|
||||
Size cbSize = CheckBoxRenderer.GetGlyphSize(graphics, cbState);
|
||||
Point cbPoint = new(node.Bounds.Left - cbSize.Width - 2,
|
||||
node.Bounds.Top + node.Bounds.Height / 2 - cbSize.Height / 2);
|
||||
CheckBoxRenderer.DrawCheckBox(graphics, cbPoint, cbState);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.DrawDefault = true;
|
||||
}
|
||||
}
|
||||
|
||||
Font font = node.NodeFont ?? Font;
|
||||
|
||||
@@ -43,7 +43,7 @@ internal static class ThemeManager
|
||||
private static readonly Color LightPlatform = ColorTranslator.FromHtml("#696900");
|
||||
private static readonly Color LightId = ColorTranslator.FromHtml("#006969");
|
||||
private static readonly Color LightProxy = ColorTranslator.FromHtml("#006900");
|
||||
private static readonly Color LightSelectionBack = SystemColors.Highlight;
|
||||
private static readonly Color LightSelectionBack = ColorTranslator.FromHtml("#ADD6FF");
|
||||
private static readonly Color LightComboBack = SystemColors.Control;
|
||||
private static readonly Color LightComboBorder = SystemColors.ControlDark;
|
||||
private static readonly Color LightComboText = SystemColors.ControlText;
|
||||
|
||||
Reference in New Issue
Block a user