From 8ec65905b1679f2d8259ee78144dd4e1a78edffb Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 13 May 2025 01:18:42 +1000 Subject: [PATCH] refactor(views): update AutoScaleMode to DPI in SettingsView and OptionsView This change ensures better scaling behavior for high-DPI displays by switching from Font-based scaling to DPI-based scaling. The modification improves the visual consistency of the application across different screen resolutions. --- MSCFixer/Views/OptionsView.Designer.cs | 36 ++++++++++++------------- MSCFixer/Views/SettingsView.Designer.cs | 30 ++++++++++----------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/MSCFixer/Views/OptionsView.Designer.cs b/MSCFixer/Views/OptionsView.Designer.cs index 6e8a797..887396e 100644 --- a/MSCFixer/Views/OptionsView.Designer.cs +++ b/MSCFixer/Views/OptionsView.Designer.cs @@ -2,12 +2,12 @@ { partial class OptionsView { - /// + /// /// Erforderliche Designervariable. /// private System.ComponentModel.IContainer components = null; - /// + /// /// Verwendete Ressourcen bereinigen. /// /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. @@ -22,8 +22,8 @@ #region Vom Komponenten-Designer generierter Code - /// - /// Erforderliche Methode für die Designerunterstützung. + /// + /// Erforderliche Methode für die Designerunterstützung. /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. /// private void InitializeComponent() @@ -34,9 +34,9 @@ this.btnSettingsMenu = new System.Windows.Forms.Button(); this.panelSettings.SuspendLayout(); this.SuspendLayout(); - // + // // panelSettings - // + // this.panelSettings.BackColor = System.Drawing.Color.White; this.panelSettings.Controls.Add(this.panelSubContent); this.panelSettings.Controls.Add(this.btnAboutMenu); @@ -46,20 +46,20 @@ this.panelSettings.Name = "panelSettings"; this.panelSettings.Size = new System.Drawing.Size(625, 395); this.panelSettings.TabIndex = 243; - // + // // panelSubContent - // - this.panelSubContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + // + this.panelSubContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panelSubContent.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panelSubContent.Location = new System.Drawing.Point(135, 14); this.panelSubContent.Name = "panelSubContent"; this.panelSubContent.Size = new System.Drawing.Size(474, 363); this.panelSubContent.TabIndex = 246; - // + // // btnAboutMenu - // + // this.btnAboutMenu.BackColor = System.Drawing.Color.White; this.btnAboutMenu.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(180)))), ((int)(((byte)(209))))); this.btnAboutMenu.FlatStyle = System.Windows.Forms.FlatStyle.Flat; @@ -71,9 +71,9 @@ this.btnAboutMenu.Text = "About"; this.btnAboutMenu.UseVisualStyleBackColor = false; this.btnAboutMenu.Click += new System.EventHandler(this.btnAboutMenu_Click); - // + // // btnSettingsMenu - // + // this.btnSettingsMenu.BackColor = System.Drawing.Color.White; this.btnSettingsMenu.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(180)))), ((int)(((byte)(209))))); this.btnSettingsMenu.FlatStyle = System.Windows.Forms.FlatStyle.Flat; @@ -85,11 +85,11 @@ this.btnSettingsMenu.Text = "Settings"; this.btnSettingsMenu.UseVisualStyleBackColor = false; this.btnSettingsMenu.Click += new System.EventHandler(this.btnSettingsMenu_Click); - // + // // OptionsView - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.Controls.Add(this.panelSettings); this.Name = "OptionsView"; this.Size = new System.Drawing.Size(625, 395); diff --git a/MSCFixer/Views/SettingsView.Designer.cs b/MSCFixer/Views/SettingsView.Designer.cs index fbed524..e5538b4 100644 --- a/MSCFixer/Views/SettingsView.Designer.cs +++ b/MSCFixer/Views/SettingsView.Designer.cs @@ -2,12 +2,12 @@ { partial class SettingsView { - /// + /// /// Erforderliche Designervariable. /// private System.ComponentModel.IContainer components = null; - /// + /// /// Verwendete Ressourcen bereinigen. /// /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. @@ -22,8 +22,8 @@ #region Vom Komponenten-Designer generierter Code - /// - /// Erforderliche Methode für die Designerunterstützung. + /// + /// Erforderliche Methode für die Designerunterstützung. /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. /// private void InitializeComponent() @@ -32,9 +32,9 @@ this.checkBox2 = new System.Windows.Forms.CheckBox(); this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); - // + // // checkBox1 - // + // this.checkBox1.AutoSize = true; this.checkBox1.Checked = true; this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; @@ -45,9 +45,9 @@ this.checkBox1.TabIndex = 0; this.checkBox1.Text = "Save settings to INI file"; this.checkBox1.UseVisualStyleBackColor = true; - // + // // checkBox2 - // + // this.checkBox2.AutoSize = true; this.checkBox2.Checked = true; this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked; @@ -58,10 +58,10 @@ this.checkBox2.TabIndex = 1; this.checkBox2.Text = "Activate Plugins for PowerShell Tooling"; this.checkBox2.UseVisualStyleBackColor = true; - // + // // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.button1.BackColor = System.Drawing.Color.WhiteSmoke; this.button1.FlatAppearance.BorderColor = System.Drawing.Color.Gainsboro; @@ -74,11 +74,11 @@ this.button1.Text = "Basic settings"; this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button1.UseVisualStyleBackColor = false; - // + // // SettingsView - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.button1); this.Controls.Add(this.checkBox2);