diff --git a/Eve-O-Preview/View/Implementation/ThumbnailOverlay.Designer.cs b/Eve-O-Preview/View/Implementation/ThumbnailOverlay.Designer.cs index a089ab4..b1668ae 100644 --- a/Eve-O-Preview/View/Implementation/ThumbnailOverlay.Designer.cs +++ b/Eve-O-Preview/View/Implementation/ThumbnailOverlay.Designer.cs @@ -61,7 +61,7 @@ // ThumbnailOverlay // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(284, 262); this.ControlBox = false; diff --git a/Eve-O-Preview/View/Implementation/ThumbnailView.Designer.cs b/Eve-O-Preview/View/Implementation/ThumbnailView.Designer.cs index 2271a94..c0540fd 100644 --- a/Eve-O-Preview/View/Implementation/ThumbnailView.Designer.cs +++ b/Eve-O-Preview/View/Implementation/ThumbnailView.Designer.cs @@ -20,7 +20,7 @@ namespace EveOPreview.View // this.AccessibleRole = System.Windows.Forms.AccessibleRole.None; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(153, 89); this.ControlBox = false; diff --git a/Eve-O-Preview/View/Implementation/ThumbnailView.cs b/Eve-O-Preview/View/Implementation/ThumbnailView.cs index 238196e..5426fcf 100644 --- a/Eve-O-Preview/View/Implementation/ThumbnailView.cs +++ b/Eve-O-Preview/View/Implementation/ThumbnailView.cs @@ -9,6 +9,10 @@ namespace EveOPreview.View { public partial class ThumbnailView : Form, IThumbnailView { + #region Private constants + private const int ResizeEventTimeout = 500; + #endregion + #region Private fields private readonly IWindowManager _windowManager; private readonly ThumbnailOverlay _overlay; @@ -34,6 +38,8 @@ namespace EveOPreview.View public ThumbnailView(IWindowManager windowManager) { + this.SuppressResizeEvent(); + this._windowManager = windowManager; this.IsActive = false; @@ -48,8 +54,6 @@ namespace EveOPreview.View this._isHighlightEnabled = false; - this._suppressResizeEventsTimestamp = DateTime.UtcNow; - InitializeComponent(); this._overlay = new ThumbnailOverlay(this, this.MouseDown_Handler); @@ -104,6 +108,8 @@ namespace EveOPreview.View public new void Show() { + this.SuppressResizeEvent(); + base.Show(); this._isLocationChanged = true; @@ -118,6 +124,8 @@ namespace EveOPreview.View public new void Hide() { + this.SuppressResizeEvent(); + this.IsActive = false; this._overlay.Hide(); @@ -126,6 +134,8 @@ namespace EveOPreview.View public new void Close() { + this.SuppressResizeEvent(); + this.IsActive = false; this._thumbnail?.Unregister(); this._overlay.Close(); @@ -165,9 +175,8 @@ namespace EveOPreview.View return; } - // Fix for WinForms issue with the Resize event being fired with inconsistent ClientSize value - // Any Resize events fired before this timestamp will be ignored - this._suppressResizeEventsTimestamp = DateTime.UtcNow.AddMilliseconds(450); + this.SuppressResizeEvent(); + this.FormBorderStyle = style; // Notify about possible contents position change @@ -384,6 +393,13 @@ namespace EveOPreview.View this._thumbnail.Move(0 + highlightWidthLeft, 0 + this._highlightWidth, baseWidth - highlightWidthRight, baseHeight - this._highlightWidth); } + private void SuppressResizeEvent() + { + // Workaround for WinForms issue with the Resize event being fired with inconsistent ClientSize value + // Any Resize events fired before this timestamp will be ignored + this._suppressResizeEventsTimestamp = DateTime.UtcNow.AddMilliseconds(ThumbnailView.ResizeEventTimeout); + } + #region GUI events protected override CreateParams CreateParams { diff --git a/Eve-O-Preview/app.manifest b/Eve-O-Preview/app.manifest index 555d4c6..5fc7044 100644 --- a/Eve-O-Preview/app.manifest +++ b/Eve-O-Preview/app.manifest @@ -75,6 +75,7 @@ True/PM + PerMonitorV2