From 430040886e38b6085748dd951bf19eb15e6f2b56 Mon Sep 17 00:00:00 2001 From: Christian Wade Date: Tue, 29 Aug 2017 13:25:03 -0700 Subject: [PATCH] More DPI --- .../TabularCompare/UI/BlobCredentials.cs | 36 ++++++++++++------ .../UI/ImpersonationCredentials.cs | 37 +++++++++++++------ 2 files changed, 51 insertions(+), 22 deletions(-) diff --git a/BismNormalizer/BismNormalizer/TabularCompare/UI/BlobCredentials.cs b/BismNormalizer/BismNormalizer/TabularCompare/UI/BlobCredentials.cs index d6d593a..1f05842 100644 --- a/BismNormalizer/BismNormalizer/TabularCompare/UI/BlobCredentials.cs +++ b/BismNormalizer/BismNormalizer/TabularCompare/UI/BlobCredentials.cs @@ -51,22 +51,36 @@ namespace BismNormalizer.TabularCompare.UI //DPI float dpiScaleFactorFudged = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor; - this.Scale(new SizeF(dpiScaleFactorFudged * 0.44f, dpiScaleFactorFudged * 0.38f)); - this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * 0.8f); - foreach (Control control in HighDPIUtils.GetChildInControl(this)) + if (Settings.Default.OptionHighDpiLocal) { - if (control is Button) + this.Scale(new SizeF(dpiScaleFactorFudged * 0.44f, dpiScaleFactorFudged * 0.38f)); + this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * 0.8f); + foreach (Control control in HighDPIUtils.GetChildInControl(this)) { - control.Font = new Font(control.Font.FontFamily, - control.Font.Size * dpiScaleFactorFudged * 1.1f * HighDPIUtils.PrimaryFudgeFactor, - control.Font.Style); + if (control is Button) + { + control.Font = new Font(control.Font.FontFamily, + control.Font.Size * dpiScaleFactorFudged * 1.1f * HighDPIUtils.PrimaryFudgeFactor, + control.Font.Style); + } + else + { + control.Font = new Font(control.Font.FontFamily, + //cbw todo check * 1.4f works on remote desktop setting + control.Font.Size * dpiScaleFactorFudged * 1.4f * HighDPIUtils.PrimaryFudgeFactor, + control.Font.Style); + } } - else + } + else + { + this.Scale(new SizeF(dpiScaleFactorFudged * 0.44f, dpiScaleFactorFudged * 0.38f)); + this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * 0.6f); + foreach (Control control in HighDPIUtils.GetChildInControl(this)) { control.Font = new Font(control.Font.FontFamily, - //cbw todo check * 1.4f works on remote desktop setting - control.Font.Size * dpiScaleFactorFudged * 1.4f * HighDPIUtils.PrimaryFudgeFactor, - control.Font.Style); + control.Font.Size * dpiScaleFactorFudged * HighDPIUtils.PrimaryFudgeFactor, + control.Font.Style); } } } diff --git a/BismNormalizer/BismNormalizer/TabularCompare/UI/ImpersonationCredentials.cs b/BismNormalizer/BismNormalizer/TabularCompare/UI/ImpersonationCredentials.cs index 6a60e58..7c7fb22 100644 --- a/BismNormalizer/BismNormalizer/TabularCompare/UI/ImpersonationCredentials.cs +++ b/BismNormalizer/BismNormalizer/TabularCompare/UI/ImpersonationCredentials.cs @@ -56,23 +56,38 @@ namespace BismNormalizer.TabularCompare.UI { //DPI float dpiScaleFactorFudged = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor; - this.Scale(new SizeF(dpiScaleFactorFudged * 0.44f, dpiScaleFactorFudged * 0.35f)); - this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * 0.6f); - foreach (Control control in HighDPIUtils.GetChildInControl(this)) + if (Settings.Default.OptionHighDpiLocal) { - if (control is Button) + this.Scale(new SizeF(dpiScaleFactorFudged * 0.44f, dpiScaleFactorFudged * 0.35f)); + this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * 0.6f); + + foreach (Control control in HighDPIUtils.GetChildInControl(this)) { - control.Font = new Font(control.Font.FontFamily, - control.Font.Size * dpiScaleFactorFudged * 1.1f * HighDPIUtils.PrimaryFudgeFactor, - control.Font.Style); + if (control is Button) + { + control.Font = new Font(control.Font.FontFamily, + control.Font.Size * dpiScaleFactorFudged * 1.1f * HighDPIUtils.PrimaryFudgeFactor, + control.Font.Style); + } + else + { + control.Font = new Font(control.Font.FontFamily, + //cbw todo check * 1.4f works on remote desktop setting + control.Font.Size * dpiScaleFactorFudged * 1.4f * HighDPIUtils.PrimaryFudgeFactor, + control.Font.Style); + } } - else + } + else + { + this.Scale(new SizeF(dpiScaleFactorFudged * 0.44f, dpiScaleFactorFudged * 0.38f)); + this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * 0.6f); + foreach (Control control in HighDPIUtils.GetChildInControl(this)) { control.Font = new Font(control.Font.FontFamily, - //cbw todo check * 1.4f works on remote desktop setting - control.Font.Size * dpiScaleFactorFudged * 1.4f * HighDPIUtils.PrimaryFudgeFactor, - control.Font.Style); + control.Font.Size * dpiScaleFactorFudged * HighDPIUtils.PrimaryFudgeFactor, + control.Font.Style); } } }