mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Better dark theme buttons
This commit is contained in:
parent
cf797e801c
commit
2b15df420c
2 changed files with 11 additions and 3 deletions
|
@ -67,10 +67,13 @@ protected override void OnPaint(PaintEventArgs pevent)
|
|||
int arrowX = ClientRectangle.Width - 14;
|
||||
int arrowY = (ClientRectangle.Height / 2) - 1;
|
||||
|
||||
Brush brush = Enabled ? SystemBrushes.ControlText : SystemBrushes.ControlDark;
|
||||
Color color = Enabled ? ForeColor : SystemColors.ControlDark;
|
||||
using (Brush brush = new SolidBrush(color))
|
||||
{
|
||||
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)
|
||||
{
|
||||
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:
|
||||
// Buttons looks better with system colors
|
||||
control.ForeColor = SystemColors.ControlText;
|
||||
|
|
Loading…
Reference in a new issue