mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-02 21:20:28 +12:00
Better dark theme buttons
This commit is contained in:
parent
cf797e801c
commit
2b15df420c
|
@ -67,9 +67,12 @@ protected override void OnPaint(PaintEventArgs pevent)
|
||||||
int arrowX = ClientRectangle.Width - 14;
|
int arrowX = ClientRectangle.Width - 14;
|
||||||
int arrowY = (ClientRectangle.Height / 2) - 1;
|
int arrowY = (ClientRectangle.Height / 2) - 1;
|
||||||
|
|
||||||
Brush brush = Enabled ? SystemBrushes.ControlText : SystemBrushes.ControlDark;
|
Color color = Enabled ? ForeColor : SystemColors.ControlDark;
|
||||||
Point[] arrows = new Point[] { new Point(arrowX, arrowY), new Point(arrowX + 7, arrowY), new Point(arrowX + 3, arrowY + 4) };
|
using (Brush brush = new SolidBrush(color))
|
||||||
pevent.Graphics.FillPolygon(brush, arrows);
|
{
|
||||||
|
Point[] arrows = new Point[] { new Point(arrowX, arrowY), new Point(arrowX + 7, arrowY), new Point(arrowX + 3, arrowY + 4) };
|
||||||
|
pevent.Graphics.FillPolygon(brush, arrows);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,11 @@ private static void ApplyDarkThemeToControl(Control control)
|
||||||
switch (control)
|
switch (control)
|
||||||
{
|
{
|
||||||
case Button btn:
|
case Button btn:
|
||||||
|
btn.FlatStyle = FlatStyle.Flat;
|
||||||
|
btn.FlatAppearance.BorderColor = DarkBorderColor;
|
||||||
|
btn.ForeColor = DarkTextColor;
|
||||||
|
btn.BackColor = DarkBackgroundVariantColor;
|
||||||
|
return;
|
||||||
case CheckBox cb when cb.Appearance == Appearance.Button:
|
case CheckBox cb when cb.Appearance == Appearance.Button:
|
||||||
// Buttons looks better with system colors
|
// Buttons looks better with system colors
|
||||||
control.ForeColor = SystemColors.ControlText;
|
control.ForeColor = SystemColors.ControlText;
|
||||||
|
|
Loading…
Reference in a new issue