From 91d79e12beccec39d75b54b771f5a1192fbfffc4 Mon Sep 17 00:00:00 2001 From: biwa <6475593+biwa@users.noreply.github.com> Date: Sun, 20 Mar 2022 16:17:00 +0100 Subject: [PATCH] Moved some custom scaling code for MainForm from the designed file to code file --- Source/Core/Windows/MainForm.Designer.cs | 6 +++--- Source/Core/Windows/MainForm.cs | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Core/Windows/MainForm.Designer.cs b/Source/Core/Windows/MainForm.Designer.cs index cbb94417..62a051c5 100755 --- a/Source/Core/Windows/MainForm.Designer.cs +++ b/Source/Core/Windows/MainForm.Designer.cs @@ -1642,7 +1642,7 @@ namespace CodeImp.DoomBuilder.Windows this.thingfilters.ImageTransparentColor = System.Drawing.Color.Magenta; this.thingfilters.Margin = new System.Windows.Forms.Padding(1, 1, 0, 2); this.thingfilters.Name = "thingfilters"; - this.thingfilters.Size = new System.Drawing.Size((int)(120 * MainForm.DPIScaler.Width), (int)(22 * MainForm.DPIScaler.Height)); + this.thingfilters.Size = new System.Drawing.Size(120, 22); this.thingfilters.Text = "(show all)"; this.thingfilters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.thingfilters.DropDownClosed += new System.EventHandler(this.LoseFocus); @@ -1672,7 +1672,7 @@ namespace CodeImp.DoomBuilder.Windows this.linedefcolorpresets.ImageTransparentColor = System.Drawing.Color.Magenta; this.linedefcolorpresets.Margin = new System.Windows.Forms.Padding(1, 1, 0, 2); this.linedefcolorpresets.Name = "linedefcolorpresets"; - this.linedefcolorpresets.Size = new System.Drawing.Size((int)(120 * MainForm.DPIScaler.Width), (int)(22 * MainForm.DPIScaler.Height)); + this.linedefcolorpresets.Size = new System.Drawing.Size(120, 22); this.linedefcolorpresets.Text = "No presets"; this.linedefcolorpresets.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.linedefcolorpresets.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.linedefcolorpresets_DropDownItemClicked); @@ -2284,7 +2284,7 @@ namespace CodeImp.DoomBuilder.Windows this.configlabel.AutoSize = false; this.configlabel.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.configlabel.Name = "configlabel"; - this.configlabel.Size = new System.Drawing.Size((int)(280 * MainForm.DPIScaler.Width), (int)(18 * MainForm.DPIScaler.Height)); + this.configlabel.Size = new System.Drawing.Size(280, 18); this.configlabel.Text = "ZDoom (Doom in Hexen Format)"; this.configlabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.configlabel.ToolTipText = "Current Game Configuration"; diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index 65876db9..65fd9762 100755 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -215,6 +215,10 @@ namespace CodeImp.DoomBuilder.Windows xposlabel.Width = (int)Math.Round(xposlabel.Width * DPIScaler.Width); yposlabel.Width = (int)Math.Round(yposlabel.Width * DPIScaler.Width); warnsLabel.Width = (int)Math.Round(warnsLabel.Width * DPIScaler.Width); + + thingfilters.Size = new Size((int)(120 * DPIScaler.Width), (int)(22 * DPIScaler.Height)); + linedefcolorpresets.Size = new Size((int)(120 * DPIScaler.Width), (int)(22 * DPIScaler.Height)); + configlabel.Size = new Size((int)(280 * DPIScaler.Width), (int)(18 * DPIScaler.Height)); } pluginbuttons = new List();