Clean up the cringe from settings form

This commit is contained in:
2025-08-31 20:20:59 +02:00
parent baeadba638
commit f234279135
3 changed files with 137 additions and 59 deletions

View File

@@ -7,11 +7,7 @@ using System.Windows.Forms;
namespace DD2Switcher {
public partial class SettingsForm : Form {
private Label titleLabel;
private FlowLayoutPanel windowsPanel;
private Label statusLabel;
private Button refreshButton;
private Button closeButton;
private int firstIndex = -1;
private int lastIndex = -1;
@@ -22,74 +18,33 @@ namespace DD2Switcher {
}
private void InitializeComponent() {
this.titleLabel = new Label();
this.windowsPanel = new FlowLayoutPanel();
this.statusLabel = new Label();
this.refreshButton = new Button();
this.closeButton = new Button();
this.windowsPanel = new System.Windows.Forms.FlowLayoutPanel();
this.SuspendLayout();
//
// titleLabel
//
this.titleLabel.AutoSize = true;
this.titleLabel.Font = new Font("Segoe UI", 14F, FontStyle.Bold);
this.titleLabel.Location = new Point(20, 20);
this.titleLabel.Name = "titleLabel";
this.titleLabel.Size = new Size(200, 25);
this.titleLabel.Text = "DD2Switcher Settings";
//
// windowsPanel
//
this.windowsPanel.AutoScroll = true;
this.windowsPanel.BorderStyle = BorderStyle.FixedSingle;
this.windowsPanel.Location = new Point(20, 60);
this.windowsPanel.BackColor = System.Drawing.Color.White;
this.windowsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.windowsPanel.Location = new System.Drawing.Point(12, 12);
this.windowsPanel.Name = "windowsPanel";
this.windowsPanel.Size = new Size(560, 300);
this.windowsPanel.Padding = new Padding(10);
this.windowsPanel.BackColor = Color.White;
//
// statusLabel
//
this.statusLabel.AutoSize = true;
this.statusLabel.Location = new Point(20, 380);
this.statusLabel.Name = "statusLabel";
this.statusLabel.Size = new Size(400, 15);
this.statusLabel.Text = "DD2Switcher is running in the system tray.";
//
// refreshButton
//
this.refreshButton.Location = new Point(450, 375);
this.refreshButton.Name = "refreshButton";
this.refreshButton.Size = new Size(75, 23);
this.refreshButton.Text = "Refresh";
this.refreshButton.Click += new EventHandler(this.refreshButton_Click);
//
// closeButton
//
this.closeButton.Location = new Point(530, 375);
this.closeButton.Name = "closeButton";
this.closeButton.Size = new Size(75, 23);
this.closeButton.Text = "Close";
this.closeButton.Click += new EventHandler(this.closeButton_Click);
this.windowsPanel.Padding = new System.Windows.Forms.Padding(10);
this.windowsPanel.Size = new System.Drawing.Size(576, 396);
this.windowsPanel.TabIndex = 1;
//
// SettingsForm
//
this.AutoScaleDimensions = new SizeF(6F, 13F);
this.AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new Size(600, 420);
this.Controls.Add(this.titleLabel);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(600, 420);
this.Controls.Add(this.windowsPanel);
this.Controls.Add(this.statusLabel);
this.Controls.Add(this.refreshButton);
this.Controls.Add(this.closeButton);
this.Name = "SettingsForm";
this.Text = "DD2Switcher Settings";
this.StartPosition = FormStartPosition.CenterScreen;
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "DD2Switcher Settings";
this.ResumeLayout(false);
this.PerformLayout();
}
private void closeButton_Click(object sender, EventArgs e) {