fix: 修复初次启动时背景色不一致问题

This commit is contained in:
2026-01-17 13:08:58 +08:00
parent 5fba4ff110
commit aa8467ccce
2 changed files with 83 additions and 10 deletions

17
MainForm.Designer.cs generated
View File

@@ -91,6 +91,7 @@ namespace TimerApp
//
// btnClose
//
this.btnClose.BackColor = System.Drawing.Color.Transparent;
this.btnClose.Dock = System.Windows.Forms.DockStyle.Right;
this.btnClose.FlatAppearance.BorderSize = 0;
this.btnClose.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Red;
@@ -101,12 +102,13 @@ namespace TimerApp
this.btnClose.Size = new System.Drawing.Size(40, 40);
this.btnClose.TabIndex = 1;
this.btnClose.Text = "✕";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.UseVisualStyleBackColor = false;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnTheme
//
this.btnTheme.BackColor = System.Drawing.Color.Transparent;
this.btnTheme.Dock = System.Windows.Forms.DockStyle.Right;
this.btnTheme.FlatAppearance.BorderSize = 0;
this.btnTheme.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
@@ -116,12 +118,13 @@ namespace TimerApp
this.btnTheme.Size = new System.Drawing.Size(40, 40);
this.btnTheme.TabIndex = 3;
this.btnTheme.Text = "☀";
this.btnTheme.UseVisualStyleBackColor = true;
this.btnTheme.UseVisualStyleBackColor = false;
this.btnTheme.Click += new System.EventHandler(this.btnTheme_Click);
//
// btnMin
//
this.btnMin.BackColor = System.Drawing.Color.Transparent;
this.btnMin.Dock = System.Windows.Forms.DockStyle.Right;
this.btnMin.FlatAppearance.BorderSize = 0;
this.btnMin.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
@@ -131,12 +134,13 @@ namespace TimerApp
this.btnMin.Size = new System.Drawing.Size(40, 40);
this.btnMin.TabIndex = 2;
this.btnMin.Text = "―";
this.btnMin.UseVisualStyleBackColor = true;
this.btnMin.UseVisualStyleBackColor = false;
this.btnMin.Click += new System.EventHandler(this.btnMin_Click);
//
// lblTimeLeft
//
this.lblTimeLeft.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
this.lblTimeLeft.Dock = System.Windows.Forms.DockStyle.Top;
this.lblTimeLeft.Font = new System.Drawing.Font("Segoe UI Light", 48F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.lblTimeLeft.ForeColor = System.Drawing.Color.White;
@@ -150,6 +154,7 @@ namespace TimerApp
//
// lblStatus
//
this.lblStatus.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
this.lblStatus.Dock = System.Windows.Forms.DockStyle.Top;
this.lblStatus.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.lblStatus.ForeColor = System.Drawing.Color.Gray;
@@ -163,6 +168,7 @@ namespace TimerApp
//
// pnlSettings
//
this.pnlSettings.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
this.pnlSettings.Controls.Add(this.btnReset);
this.pnlSettings.Controls.Add(this.btnStartStop);
this.pnlSettings.Controls.Add(this.btnRestPlus);
@@ -183,6 +189,7 @@ namespace TimerApp
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label1.ForeColor = System.Drawing.Color.LightGray;
this.label1.Location = new System.Drawing.Point(40, 20);
@@ -238,6 +245,7 @@ namespace TimerApp
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
this.label2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label2.ForeColor = System.Drawing.Color.LightGray;
this.label2.Location = new System.Drawing.Point(40, 60);
@@ -390,9 +398,6 @@ namespace TimerApp
this.Load += new System.EventHandler(this.MainForm_Load);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
// Ensure pnlSettings matches form background initially
this.pnlSettings.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
this.contextMenuStrip1.ResumeLayout(false);
this.pnlTitle.ResumeLayout(false);
this.pnlTitle.PerformLayout();