Display thumbnails even when Aero is disabled
This commit is contained in:
48
Eve-O-Preview/View/Implementation/LiveThumbnailView.cs
Normal file
48
Eve-O-Preview/View/Implementation/LiveThumbnailView.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using EveOPreview.Services;
|
||||
|
||||
namespace EveOPreview.View
|
||||
{
|
||||
sealed class LiveThumbnailView : ThumbnailView
|
||||
{
|
||||
#region Private fields
|
||||
private IDwmThumbnail _thumbnail;
|
||||
#endregion
|
||||
|
||||
public LiveThumbnailView(IWindowManager windowManager)
|
||||
: base(windowManager)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
this._thumbnail?.Unregister();
|
||||
base.Close();
|
||||
}
|
||||
|
||||
protected override void RefreshThumbnail(bool forceRefresh)
|
||||
{
|
||||
// To prevent flickering the old broken thumbnail is removed AFTER the new shiny one is created
|
||||
IDwmThumbnail obsoleteThumbnail = forceRefresh ? this._thumbnail : null;
|
||||
|
||||
if ((this._thumbnail == null) || forceRefresh)
|
||||
{
|
||||
this.RegisterThumbnail();
|
||||
}
|
||||
|
||||
obsoleteThumbnail?.Unregister();
|
||||
}
|
||||
|
||||
protected override void ResizeThumbnail(int baseWidth, int baseHeight, int highlightWidthTop, int highlightWidthRight, int highlightWidthBottom, int highlightWidthLeft)
|
||||
{
|
||||
this._thumbnail.Move(0 + highlightWidthLeft, 0 + highlightWidthTop, baseWidth - highlightWidthRight, baseHeight - highlightWidthBottom);
|
||||
this._thumbnail.Update();
|
||||
}
|
||||
|
||||
private void RegisterThumbnail()
|
||||
{
|
||||
this._thumbnail = this.WindowManager.GetLiveThumbnail(this.Handle, this.Id);
|
||||
this._thumbnail.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,12 +141,72 @@
|
||||
<metadata name="GeneralTabPage.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailTabPage.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailTabPage.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomTabPage.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="OverlayTabPage.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="OverlayTabPage.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ClientsTabPage.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ClientsTabPage.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="AboutTabPage.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="AboutTabPage.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GeneralTabPage.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="GeneralTabPage.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GeneralSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="GeneralSettingsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="GeneralSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="GeneralSettingsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="MinimizeInactiveClientsCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="EnableClientLayoutTrackingCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="HideActiveClientThumbnailCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ShowThumbnailsAlwaysOnTopCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="HideThumbnailsOnLostFocusCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="EnablePerClientThumbnailsLayoutsCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="MinimizeToTrayCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="MinimizeInactiveClientsCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
@@ -180,6 +240,39 @@
|
||||
<metadata name="ThumbnailSettingsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailSettingsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="HeigthLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="HeigthLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="WidthLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="WidthLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsWidthNumericEdit.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsHeightNumericEdit.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailOpacityTrackBar.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="OpacityLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="OpacityLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="HeigthLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
@@ -216,6 +309,12 @@
|
||||
<metadata name="ZoomSettingsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomSettingsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomFactorLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
@@ -225,6 +324,54 @@
|
||||
<metadata name="ZoomAnchorPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAnchorLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAnchorLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="EnableThumbnailZoomCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailZoomFactorNumericEdit.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomFactorLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomFactorLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAnchorPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorNWRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorNRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorNERadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorWRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorSERadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorCRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorSRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorERadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorSWRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ZoomAanchorNWRadioButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
@@ -276,6 +423,27 @@
|
||||
<metadata name="OverlaySettingsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="OverlaySettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="OverlaySettingsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="HighlightColorLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ActiveClientHighlightColorButton.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="EnableActiveClientHighlightCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ShowThumbnailOverlaysCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ShowThumbnailFramesCheckBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="HighlightColorLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
@@ -303,6 +471,21 @@
|
||||
<metadata name="ClientsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ClientsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ClientsPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsList.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsListLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsListLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="ThumbnailsList.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
@@ -324,6 +507,36 @@
|
||||
<metadata name="AboutPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="AboutPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="AboutPanel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="DocumentationLinkLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="DocumentationLinkLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="DescriptionLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="DescriptionLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="VersionLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="NameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="NameLabel.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="DocumentationLink.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="DocumentationLinkLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
|
||||
23
Eve-O-Preview/View/Implementation/StaticThumbnailImage.cs
Normal file
23
Eve-O-Preview/View/Implementation/StaticThumbnailImage.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace EveOPreview.View
|
||||
{
|
||||
sealed class StaticThumbnailImage : PictureBox
|
||||
{
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
const int WM_NCHITTEST = 0x0084;
|
||||
const int HTTRANSPARENT = (-1);
|
||||
|
||||
if (m.Msg == WM_NCHITTEST)
|
||||
{
|
||||
m.Result = (IntPtr)HTTRANSPARENT;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Eve-O-Preview/View/Implementation/StaticThumbnailView.cs
Normal file
49
Eve-O-Preview/View/Implementation/StaticThumbnailView.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using EveOPreview.Services;
|
||||
|
||||
namespace EveOPreview.View
|
||||
{
|
||||
sealed class StaticThumbnailView : ThumbnailView
|
||||
{
|
||||
#region Private fields
|
||||
private readonly PictureBox _thumbnail;
|
||||
#endregion
|
||||
|
||||
public StaticThumbnailView(IWindowManager windowManager)
|
||||
: base(windowManager)
|
||||
{
|
||||
this._thumbnail = new StaticThumbnailImage
|
||||
{
|
||||
TabStop = false,
|
||||
SizeMode = PictureBoxSizeMode.StretchImage,
|
||||
Location = new Point(0, 0),
|
||||
Size = new Size(this.ClientSize.Width, this.ClientSize.Height)
|
||||
};
|
||||
this.Controls.Add(this._thumbnail);
|
||||
}
|
||||
|
||||
protected override void RefreshThumbnail(bool forceRefresh)
|
||||
{
|
||||
if (!forceRefresh)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var thumbnail = this.WindowManager.GetStaticThumbnail(this.Id);
|
||||
if (thumbnail != null)
|
||||
{
|
||||
var oldImage = this._thumbnail.Image;
|
||||
this._thumbnail.Image = thumbnail;
|
||||
oldImage?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ResizeThumbnail(int baseWidth, int baseHeight, int highlightWidthTop, int highlightWidthRight, int highlightWidthBottom, int highlightWidthLeft)
|
||||
{
|
||||
this._thumbnail.Location = new Point(0 + highlightWidthLeft, 0 + highlightWidthTop);
|
||||
this._thumbnail.Size = new Size(baseWidth - highlightWidthLeft - highlightWidthRight, baseHeight - highlightWidthTop - highlightWidthBottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,11 +19,12 @@ namespace EveOPreview.View
|
||||
// ThumbnailView
|
||||
//
|
||||
this.AccessibleRole = System.Windows.Forms.AccessibleRole.None;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.BackColor = System.Drawing.Color.Black;
|
||||
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
||||
this.ClientSize = new System.Drawing.Size(153, 89);
|
||||
this.ControlBox = false;
|
||||
this.DoubleBuffered = true;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
|
||||
@@ -7,26 +7,25 @@ using EveOPreview.UI.Hotkeys;
|
||||
|
||||
namespace EveOPreview.View
|
||||
{
|
||||
public partial class ThumbnailView : Form, IThumbnailView
|
||||
public abstract partial class ThumbnailView : Form, IThumbnailView
|
||||
{
|
||||
#region Private constants
|
||||
private const int RESIZE_EVENT_TIMEOUT = 500;
|
||||
#endregion
|
||||
|
||||
#region Private fields
|
||||
private readonly IWindowManager _windowManager;
|
||||
private readonly ThumbnailOverlay _overlay;
|
||||
private IDwmThumbnail _thumbnail;
|
||||
|
||||
// Part of the logic (namely current size / position management)
|
||||
// was moved to the view due to the performance reasons
|
||||
private bool _isOverlayVisible;
|
||||
private bool _isTopMost;
|
||||
private bool _isHighlightEnabled;
|
||||
private bool _isHighlightRequested;
|
||||
private int _highlightWidth;
|
||||
private bool _isLocationChanged;
|
||||
private bool _isSizeChanged;
|
||||
private bool _isCustomMouseModeActive;
|
||||
private bool _isHighlightEnabled;
|
||||
private int _highlightWidth;
|
||||
private DateTime _suppressResizeEventsTimestamp;
|
||||
private Size _baseZoomSize;
|
||||
private Point _baseZoomLocation;
|
||||
@@ -36,29 +35,32 @@ namespace EveOPreview.View
|
||||
private HotkeyHandler _hotkeyHandler;
|
||||
#endregion
|
||||
|
||||
public ThumbnailView(IWindowManager windowManager)
|
||||
protected ThumbnailView(IWindowManager windowManager)
|
||||
{
|
||||
this.SuppressResizeEvent();
|
||||
|
||||
this._windowManager = windowManager;
|
||||
this.WindowManager = windowManager;
|
||||
|
||||
this.IsActive = false;
|
||||
|
||||
this.IsOverlayEnabled = false;
|
||||
this._isOverlayVisible = false;
|
||||
this._isTopMost = false;
|
||||
this._isHighlightEnabled = false;
|
||||
|
||||
this._isLocationChanged = true;
|
||||
this._isSizeChanged = true;
|
||||
this._isCustomMouseModeActive = false;
|
||||
|
||||
this._isHighlightEnabled = false;
|
||||
this._isHighlightRequested = false;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
this._overlay = new ThumbnailOverlay(this, this.MouseDown_Handler);
|
||||
}
|
||||
|
||||
protected IWindowManager WindowManager { get; }
|
||||
|
||||
public IntPtr Id { get; set; }
|
||||
|
||||
public string Title
|
||||
@@ -131,12 +133,11 @@ namespace EveOPreview.View
|
||||
base.Hide();
|
||||
}
|
||||
|
||||
public new void Close()
|
||||
public new virtual void Close()
|
||||
{
|
||||
this.SuppressResizeEvent();
|
||||
|
||||
this.IsActive = false;
|
||||
this._thumbnail?.Unregister();
|
||||
this._overlay.Close();
|
||||
base.Close();
|
||||
}
|
||||
@@ -177,9 +178,6 @@ namespace EveOPreview.View
|
||||
this.SuppressResizeEvent();
|
||||
|
||||
this.FormBorderStyle = style;
|
||||
|
||||
// Notify about possible contents position change
|
||||
this._isSizeChanged = true;
|
||||
}
|
||||
|
||||
public void SetTopMost(bool enableTopmost)
|
||||
@@ -198,20 +196,20 @@ namespace EveOPreview.View
|
||||
|
||||
public void SetHighlight(bool enabled, Color color, int width)
|
||||
{
|
||||
if (this._isHighlightEnabled == enabled)
|
||||
if (this._isHighlightRequested == enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (enabled)
|
||||
{
|
||||
this._isHighlightEnabled = true;
|
||||
this._isHighlightRequested = true;
|
||||
this._highlightWidth = width;
|
||||
this.BackColor = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._isHighlightEnabled = false;
|
||||
this._isHighlightRequested = false;
|
||||
this.BackColor = SystemColors.Control;
|
||||
}
|
||||
|
||||
@@ -305,69 +303,31 @@ namespace EveOPreview.View
|
||||
|
||||
public void Refresh(bool forceRefresh)
|
||||
{
|
||||
// To prevent flickering the old broken thumbnail is removed AFTER the new shiny one is created
|
||||
IDwmThumbnail obsoleteThumbnail = forceRefresh ? this._thumbnail : null;
|
||||
this.RefreshThumbnail(forceRefresh);
|
||||
this.HighlightThumbnail(forceRefresh || this._isSizeChanged);
|
||||
this.RefreshOverlay(forceRefresh || this._isSizeChanged || this._isLocationChanged);
|
||||
|
||||
if ((this._thumbnail == null) || forceRefresh)
|
||||
{
|
||||
this.RegisterThumbnail();
|
||||
}
|
||||
|
||||
bool sizeChanged = this._isSizeChanged || forceRefresh;
|
||||
bool locationChanged = this._isLocationChanged || forceRefresh;
|
||||
|
||||
if (sizeChanged)
|
||||
{
|
||||
this.RecalculateThumbnailSize();
|
||||
|
||||
this.UpdateThumbnail();
|
||||
|
||||
this._isSizeChanged = false;
|
||||
}
|
||||
|
||||
obsoleteThumbnail?.Unregister();
|
||||
|
||||
this._overlay.EnableOverlayLabel(this.IsOverlayEnabled);
|
||||
|
||||
if (!this._isOverlayVisible)
|
||||
{
|
||||
// One-time action to show the Overlay before it is set up
|
||||
// Otherwise its position won't be set
|
||||
this._overlay.Show();
|
||||
this._isOverlayVisible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(sizeChanged || locationChanged))
|
||||
{
|
||||
// No need to adjust in the overlay location if it is already visible and properly set
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Size overlaySize = this.ClientSize;
|
||||
Point overlayLocation = this.Location;
|
||||
|
||||
int borderWidth = (this.Size.Width - this.ClientSize.Width) / 2;
|
||||
overlayLocation.X += borderWidth;
|
||||
overlayLocation.Y += (this.Size.Height - this.ClientSize.Height) - borderWidth;
|
||||
|
||||
this._isLocationChanged = false;
|
||||
this._overlay.Size = overlaySize;
|
||||
this._overlay.Location = overlayLocation;
|
||||
this._overlay.Refresh();
|
||||
this._isSizeChanged = false;
|
||||
}
|
||||
|
||||
private void RecalculateThumbnailSize()
|
||||
protected abstract void RefreshThumbnail(bool forceRefresh);
|
||||
|
||||
protected abstract void ResizeThumbnail(int baseWidth, int baseHeight, int highlightWidthTop, int highlightWidthRight, int highlightWidthBottom, int highlightWidthLeft);
|
||||
|
||||
private void HighlightThumbnail(bool forceRefresh)
|
||||
{
|
||||
// This approach would work only for square-shaped thumbnail window
|
||||
// To get PROPER results we have to do some crazy math
|
||||
//int delta = this._isHighlightEnabled ? this._highlightWidth : 0;
|
||||
//this._thumbnail.rcDestination = new RECT(0 + delta, 0 + delta, this.ClientSize.Width - delta, this.ClientSize.Height - delta);
|
||||
if (!this._isHighlightEnabled)
|
||||
if (!forceRefresh && (this._isHighlightRequested == this._isHighlightEnabled))
|
||||
{
|
||||
//No highlighting enabled, so no odd math required
|
||||
this._thumbnail.Move(0, 0, this.ClientSize.Width, this.ClientSize.Height);
|
||||
// Nothing to do here
|
||||
return;
|
||||
}
|
||||
|
||||
this._isHighlightEnabled = this._isHighlightRequested;
|
||||
|
||||
if (!this._isHighlightRequested)
|
||||
{
|
||||
//No highlighting enabled, so no math required
|
||||
this.ResizeThumbnail(this.ClientSize.Width, this.ClientSize.Height, 0, 0, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -381,7 +341,38 @@ namespace EveOPreview.View
|
||||
int highlightWidthLeft = (baseWidth - actualWidth) / 2;
|
||||
int highlightWidthRight = baseWidth - actualWidth - highlightWidthLeft;
|
||||
|
||||
this._thumbnail.Move(0 + highlightWidthLeft, 0 + this._highlightWidth, baseWidth - highlightWidthRight, baseHeight - this._highlightWidth);
|
||||
this.ResizeThumbnail(this.ClientSize.Width, this.ClientSize.Height, this._highlightWidth, highlightWidthRight, this._highlightWidth, highlightWidthLeft);
|
||||
}
|
||||
|
||||
private void RefreshOverlay(bool forceRefresh)
|
||||
{
|
||||
if (this._isOverlayVisible && !forceRefresh)
|
||||
{
|
||||
// No need to update anything. Everything is already set up
|
||||
return;
|
||||
}
|
||||
|
||||
this._overlay.EnableOverlayLabel(this.IsOverlayEnabled);
|
||||
|
||||
if (!this._isOverlayVisible)
|
||||
{
|
||||
// One-time action to show the Overlay before it is set up
|
||||
// Otherwise its position won't be set
|
||||
this._overlay.Show();
|
||||
this._isOverlayVisible = true;
|
||||
}
|
||||
|
||||
Size overlaySize = this.ClientSize;
|
||||
Point overlayLocation = this.Location;
|
||||
|
||||
int borderWidth = (this.Size.Width - this.ClientSize.Width) / 2;
|
||||
overlayLocation.X += borderWidth;
|
||||
overlayLocation.Y += (this.Size.Height - this.ClientSize.Height) - borderWidth;
|
||||
|
||||
this._isLocationChanged = false;
|
||||
this._overlay.Size = overlaySize;
|
||||
this._overlay.Location = overlayLocation;
|
||||
this._overlay.Refresh();
|
||||
}
|
||||
|
||||
private void SuppressResizeEvent()
|
||||
@@ -482,18 +473,6 @@ namespace EveOPreview.View
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Thumbnail management
|
||||
private void RegisterThumbnail()
|
||||
{
|
||||
this._thumbnail = this._windowManager.RegisterThumbnail(this.Handle, this.Id);
|
||||
}
|
||||
|
||||
private void UpdateThumbnail()
|
||||
{
|
||||
this._thumbnail.Update();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Custom Mouse mode
|
||||
// This pair of methods saves/restores certain window properties
|
||||
// Methods are used to remove the 'Zoom' effect (if any) when the
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using EveOPreview.Configuration;
|
||||
|
||||
namespace EveOPreview.View
|
||||
{
|
||||
sealed class ThumbnailViewFactory : IThumbnailViewFactory
|
||||
{
|
||||
private readonly IApplicationController _controller;
|
||||
private readonly bool _isCompatibilityModeEnabled;
|
||||
|
||||
public ThumbnailViewFactory(IApplicationController controller)
|
||||
public ThumbnailViewFactory(IApplicationController controller, IThumbnailConfiguration configuration)
|
||||
{
|
||||
this._controller = controller;
|
||||
this._isCompatibilityModeEnabled = configuration.EnableCompatibilityMode;
|
||||
}
|
||||
|
||||
public IThumbnailView Create(IntPtr id, string title, Size size)
|
||||
{
|
||||
IThumbnailView view = this._controller.Create<IThumbnailView>();
|
||||
IThumbnailView view = this._isCompatibilityModeEnabled
|
||||
? (IThumbnailView)this._controller.Create<StaticThumbnailView>()
|
||||
: (IThumbnailView)this._controller.Create<LiveThumbnailView>();
|
||||
|
||||
view.Id = id;
|
||||
view.Title = title;
|
||||
|
||||
Reference in New Issue
Block a user