diff --git a/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs b/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs index 42ec54e..d02a926 100644 --- a/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs +++ b/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs @@ -5,17 +5,21 @@ namespace EveOPreview.UI { public partial class ThumbnailOverlay : Form { + #region Private fields private readonly Action _areaClickAction; + #endregion - public ThumbnailOverlay(Action areaClickAction) + public ThumbnailOverlay(Form owner, Action areaClickAction) { + this.Owner = owner; this._areaClickAction = areaClickAction; + InitializeComponent(); } private void OverlayArea_Click(object sender, MouseEventArgs e) { - this._areaClickAction(sender, e); + this._areaClickAction(this, e); } public void SetOverlayLabel(string label) diff --git a/Eve-O-Preview/UI/Implementation/ThumbnailView.cs b/Eve-O-Preview/UI/Implementation/ThumbnailView.cs index 618394f..b66b030 100644 --- a/Eve-O-Preview/UI/Implementation/ThumbnailView.cs +++ b/Eve-O-Preview/UI/Implementation/ThumbnailView.cs @@ -40,7 +40,7 @@ namespace EveOPreview.UI InitializeComponent(); - this._overlay = new ThumbnailOverlay(this.ThumbnailActivated_Handler); + this._overlay = new ThumbnailOverlay(this, this.ThumbnailActivated_Handler); } public IntPtr Id { get; set; } @@ -64,6 +64,22 @@ namespace EveOPreview.UI public bool IsOverlayEnabled { get; set; } + public new Point Location + { + get + { + return base.Location; + } + set + { + if ((value.X > 0) || (value.Y > 0)) + { + this.StartPosition=FormStartPosition.Manual; + } + base.Location = value; + } + } + public event Action ThumbnailResized; public event Action ThumbnailMoved; @@ -76,16 +92,11 @@ namespace EveOPreview.UI public new void Show() { - this.StartPosition = (this.Location.X > 0) || (this.Location.Y > 0) - ? FormStartPosition.Manual - : FormStartPosition.WindowsDefaultLocation; - base.Show(); if (this.IsOverlayEnabled) { this._overlay.Show(); - this._overlay.TopMost = true; } else { @@ -138,7 +149,6 @@ namespace EveOPreview.UI public void SetTopMost(bool enableTopmost) { this.TopMost = enableTopmost; - this._overlay.TopMost = true; } public new void Refresh()