feat: 添加标题按钮的悬停背景色设置以支持深浅色模式
This commit is contained in:
16
MainForm.cs
16
MainForm.cs
@@ -270,6 +270,22 @@ namespace TimerApp
|
|||||||
btnClose.ForeColor = text;
|
btnClose.ForeColor = text;
|
||||||
btnMin.ForeColor = text;
|
btnMin.ForeColor = text;
|
||||||
|
|
||||||
|
// Set hover background colors for title buttons
|
||||||
|
if (dark)
|
||||||
|
{
|
||||||
|
// 深色模式下使用深色悬停背景
|
||||||
|
btnClose.FlatAppearance.MouseOverBackColor = Color.FromArgb(232, 17, 35); // 深色模式下的红色(稍微暗一点)
|
||||||
|
btnMin.FlatAppearance.MouseOverBackColor = Color.FromArgb(63, 63, 70);
|
||||||
|
btnTheme.FlatAppearance.MouseOverBackColor = Color.FromArgb(63, 63, 70);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 浅色模式下使用浅色悬停背景
|
||||||
|
btnClose.FlatAppearance.MouseOverBackColor = Color.Red;
|
||||||
|
btnMin.FlatAppearance.MouseOverBackColor = Color.FromArgb(220, 220, 220); // 浅灰色,接近标题栏背景
|
||||||
|
btnTheme.FlatAppearance.MouseOverBackColor = Color.FromArgb(220, 220, 220); // 浅灰色,接近标题栏背景
|
||||||
|
}
|
||||||
|
|
||||||
// Theme button with Segoe MDL2 Assets
|
// Theme button with Segoe MDL2 Assets
|
||||||
btnTheme.ForeColor = text;
|
btnTheme.ForeColor = text;
|
||||||
btnTheme.Font = new Font("Segoe MDL2 Assets", 10F, FontStyle.Regular, GraphicsUnit.Point);
|
btnTheme.Font = new Font("Segoe MDL2 Assets", 10F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
|||||||
Reference in New Issue
Block a user