Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Kasyanov committed Apr 3, 2018
2 parents 348a420 + dd06044 commit 9a68208
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace EveOPreview.Configuration
namespace EveOPreview.Configuration.Implementation
{
class AppConfig : IAppConfig
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.IO;
using Newtonsoft.Json;

namespace EveOPreview.Configuration
namespace EveOPreview.Configuration.Implementation
{
class ConfigurationStorage : IConfigurationStorage
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Windows.Forms;
using Newtonsoft.Json;

namespace EveOPreview.Configuration.Omplementation
namespace EveOPreview.Configuration.Implementation
{
sealed class ThumbnailConfiguration : IThumbnailConfiguration
{
Expand Down
16 changes: 8 additions & 8 deletions Eve-O-Preview/Eve-O-Preview.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\bin</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -30,7 +30,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\bin</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down Expand Up @@ -108,11 +108,11 @@
<Compile Include="ApplicationBase\LightInjectContainer.cs" />
<Compile Include="ApplicationBase\Presenter.cs" />
<Compile Include="ApplicationBase\PresenterGeneric.cs" />
<Compile Include="Configuration\AppConfig.cs" />
<Compile Include="Configuration\ConfigurationStorage.cs" />
<Compile Include="Configuration\IAppConfig.cs" />
<Compile Include="Configuration\Implementation\AppConfig.cs" />
<Compile Include="Configuration\Implementation\ConfigurationStorage.cs" />
<Compile Include="Configuration\Interface\IAppConfig.cs" />
<Compile Include="Configuration\Interface\IThumbnailConfiguration.cs" />
<Compile Include="Configuration\ZoomAnchor.cs" />
<Compile Include="Configuration\Interface\ZoomAnchor.cs" />
<Compile Include="Mediator\Handlers\Configuration\SaveConfigurationHandler.cs" />
<Compile Include="Mediator\Handlers\Thumbnails\ThumbnailFrameSettingsUpdatedHandler.cs" />
<Compile Include="Mediator\Handlers\Thumbnails\ThumbnailConfiguredSizeUpdatedHandler.cs" />
Expand Down Expand Up @@ -143,7 +143,7 @@
<Compile Include="Services\Interface\IWindowManager.cs" />
<Compile Include="Services\Interop\MARGINS.cs" />
<Compile Include="Services\Interop\RECT.cs" />
<Compile Include="Configuration\ClientLayout.cs" />
<Compile Include="Configuration\Interface\ClientLayout.cs" />
<Compile Include="ApplicationBase\IPresenter.cs" />
<Compile Include="Services\Implementation\WindowManager.cs" />
<Compile Include="Services\Interop\User32NativeMethods.cs" />
Expand All @@ -167,7 +167,7 @@
<Compile Include="View\Implementation\MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Configuration\IConfigurationStorage.cs" />
<Compile Include="Configuration\Interface\IConfigurationStorage.cs" />
<Compile Include="View\Interface\IThumbnailView.cs" />
<Compile Include="View\Implementation\ThumbnailViewFactory.cs" />
<Compile Include="Services\Implementation\ThumbnailManager.cs" />
Expand Down
4 changes: 2 additions & 2 deletions Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace EveOPreview.Presenters
public class MainFormPresenter : Presenter<IMainFormView>, IMainFormPresenter
{
#region Private constants
private const string ForumUrl = @"https://meta.eveonline.com/t/4202";
private const string ForumUrl = @"https://forum.eveonline.com/t/4202";
#endregion

#region Private fields
Expand Down Expand Up @@ -232,7 +232,7 @@ private void OpenDocumentationLink()
private string GetApplicationVersion()
{
Version version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version;
return $"{version.Major}.{version.Minor}.{version.Revision}";
return $"{version.Major}.{version.Minor}.{version.Build}";
}

private void ExitApplication()
Expand Down
4 changes: 2 additions & 2 deletions Eve-O-Preview/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("04f08f8d-9e98-423b-acdb-4effb31c0d35")]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyVersion("4.0.1.0")]
[assembly: AssemblyFileVersion("4.0.1.0")]

[assembly: CLSCompliant(false)]
17 changes: 13 additions & 4 deletions Eve-O-Preview/Services/Implementation/ThumbnailManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private void RefreshThumbnails()
this.SwitchActiveClient(foregroundWindowHandle, foregroundWindowTitle);
}

bool hideAllThumbnails = this._configuration.HideThumbnailsOnLostFocus && !(string.IsNullOrEmpty(foregroundWindowTitle) || this.IsClientWindowActive(foregroundWindowHandle));
bool hideAllThumbnails = this._configuration.HideThumbnailsOnLostFocus && !this.IsClientWindowActive(foregroundWindowHandle);

this._refreshCycleCount++;

Expand Down Expand Up @@ -383,11 +383,20 @@ private void ThumbnailViewLostFocus(IntPtr id)

private void ThumbnailActivated(IntPtr id)
{
// View is always available because this method is actually being called by
// a view callback
IThumbnailView view = this._thumbnailViews[id];

Task.Run(() => this._windowManager.ActivateWindow(view.Id));
Task.Run(() =>
{
this._windowManager.ActivateWindow(view.Id);
})
.ConfigureAwait(true)
.GetAwaiter()
.OnCompleted(() =>
{
this.SwitchActiveClient(view.Id, view.Title);
this.UpdateClientLayouts();
this.RefreshThumbnails();
});

this.UpdateClientLayouts();
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 23 additions & 8 deletions Eve-O-Preview/View/Implementation/ThumbnailView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,6 +38,8 @@ public partial class ThumbnailView : Form, IThumbnailView

public ThumbnailView(IWindowManager windowManager)
{
this.SuppressResizeEvent();

this._windowManager = windowManager;

this.IsActive = false;
Expand All @@ -48,8 +54,6 @@ public ThumbnailView(IWindowManager windowManager)

this._isHighlightEnabled = false;

this._suppressResizeEventsTimestamp = DateTime.UtcNow;

InitializeComponent();

this._overlay = new ThumbnailOverlay(this, this.MouseDown_Handler);
Expand Down Expand Up @@ -104,20 +108,23 @@ public Size ThumbnailSize

public new void Show()
{
this.SuppressResizeEvent();

base.Show();

this._isLocationChanged = true;
this._isSizeChanged = true;
this._isOverlayVisible = false;

// Thumbnail will be properly registered during the Manager's Refresh cycle
this.Refresh();
this.Refresh(true);

this.IsActive = true;
}

public new void Hide()
{
this.SuppressResizeEvent();

this.IsActive = false;

this._overlay.Hide();
Expand All @@ -126,6 +133,8 @@ public Size ThumbnailSize

public new void Close()
{
this.SuppressResizeEvent();

this.IsActive = false;
this._thumbnail?.Unregister();
this._overlay.Close();
Expand Down Expand Up @@ -165,9 +174,8 @@ public void SetFrames(bool enable)
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
Expand All @@ -176,12 +184,12 @@ public void SetFrames(bool enable)

public void SetTopMost(bool enableTopmost)
{
// IMO WinForms could check this too
if (this._isTopMost == enableTopmost)
{
return;
}

this.TopLevel = enableTopmost;
this.TopMost = enableTopmost;
this._overlay.TopMost = enableTopmost;

Expand Down Expand Up @@ -384,6 +392,13 @@ private void RecalculateThumbnailSize()
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
{
Expand Down
1 change: 1 addition & 0 deletions Eve-O-Preview/app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>True/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>

Expand Down

0 comments on commit 9a68208

Please sign in to comment.