--- a/UI/FormHandshake.cs Mon Oct 31 17:30:03 2016 +0100
+++ b/UI/FormHandshake.cs Wed Nov 02 18:48:28 2016 +0100
@@ -1,4 +1,5 @@
-using System.Windows;
+using System.Drawing;
+using System.Windows;
using System.Windows.Forms;
namespace pEp.UI
@@ -8,6 +9,9 @@
/// </summary>
internal partial class FormHandshake : Form
{
+ private double scaleX = 1;
+ private double scaleY = 1;
+
/**************************************************************
*
* Constructors
@@ -21,6 +25,10 @@
{
this.InitializeComponent();
+ Graphics g = this.CreateGraphics();
+ this.scaleX = g.DpiX / 96;
+ this.scaleY = g.DpiY / 96;
+
this.FormControlHandshakeChild.PropertyChanged += DisplayState_PropertyChanged;
this.FormControlHandshakeChild.CancelClick += ButtonCancel_Click;
this.FormControlHandshakeChild.ConfirmClick += ButtonConfirm_Click;
@@ -72,11 +80,11 @@
// Window height
if (this.FormControlHandshakeChild.DisplayState.Mode == FormControlHandshake.State.HandshakeMode.Standard)
{
- this.Height = 400;
+ this.Height = (int)(400 * this.scaleY);
}
else
{
- this.Height = 300;
+ this.Height = (int)(300 * this.scaleY);
}
return;