fix animation settings and allow Original animation or no animation - setable from GUI. This should fix client switching when using fixed window
This commit is contained in:
@@ -81,7 +81,7 @@ CCP Grimmi wrote:
|
|||||||
| Track client locations | Determines whether the client's window position should be restored when it is activated or started |
|
| Track client locations | Determines whether the client's window position should be restored when it is activated or started |
|
||||||
| Hide preview of active EVE client | Determines whether the thumbnail corresponding to the active EVE client is not displayed |
|
| Hide preview of active EVE client | Determines whether the thumbnail corresponding to the active EVE client is not displayed |
|
||||||
| Minimize inactive EVE clients | Allows to auto-minimize inactive EVE clients to save CPU and GPU |
|
| Minimize inactive EVE clients | Allows to auto-minimize inactive EVE clients to save CPU and GPU |
|
||||||
| Minimize inactive EVE clients Animation | If Minimize Clients is set, this setting will enable windows animations (if checked) or disable if unchecked.
|
| Animation Style | Use original animation style (0) or No Animation style (1). You may find Original is cleaner with fixed window mode and No Animation is cleaner with windowed mode. Especially when using minimize inactive clients.
|
||||||
| Previews always on top | Determines whether EVE client thumbnails should stay on top of all other windows |
|
| Previews always on top | Determines whether EVE client thumbnails should stay on top of all other windows |
|
||||||
| Hide previews when EVE client is not active | Determines whether all thumbnails should be visible only when an EVE client is active |
|
| Hide previews when EVE client is not active | Determines whether all thumbnails should be visible only when an EVE client is active |
|
||||||
| Unique layout for each EVE client | Determines whether thumbnails positions are different depending on the EVE client being active |
|
| Unique layout for each EVE client | Determines whether thumbnails positions are different depending on the EVE client being active |
|
||||||
|
@@ -71,7 +71,7 @@ namespace EveOPreview.Configuration.Implementation
|
|||||||
this.EnableClientLayoutTracking = false;
|
this.EnableClientLayoutTracking = false;
|
||||||
this.HideActiveClientThumbnail = false;
|
this.HideActiveClientThumbnail = false;
|
||||||
this.MinimizeInactiveClients = false;
|
this.MinimizeInactiveClients = false;
|
||||||
this.MinimizeInactiveClientsAnimation = false;
|
this.WindowsAnimationStyle = AnimationStyle.NoAnimation;
|
||||||
this.ShowThumbnailsAlwaysOnTop = true;
|
this.ShowThumbnailsAlwaysOnTop = true;
|
||||||
this.EnablePerClientThumbnailLayouts = false;
|
this.EnablePerClientThumbnailLayouts = false;
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ namespace EveOPreview.Configuration.Implementation
|
|||||||
|
|
||||||
public bool HideActiveClientThumbnail { get; set; }
|
public bool HideActiveClientThumbnail { get; set; }
|
||||||
public bool MinimizeInactiveClients { get; set; }
|
public bool MinimizeInactiveClients { get; set; }
|
||||||
public bool MinimizeInactiveClientsAnimation { get; set; }
|
public AnimationStyle WindowsAnimationStyle { get; set; }
|
||||||
public bool ShowThumbnailsAlwaysOnTop { get; set; }
|
public bool ShowThumbnailsAlwaysOnTop { get; set; }
|
||||||
|
|
||||||
public bool EnablePerClientThumbnailLayouts
|
public bool EnablePerClientThumbnailLayouts
|
||||||
|
@@ -0,0 +1,8 @@
|
|||||||
|
namespace EveOPreview.Configuration
|
||||||
|
{
|
||||||
|
public enum AnimationStyle
|
||||||
|
{
|
||||||
|
OriginalAnimation,
|
||||||
|
NoAnimation
|
||||||
|
}
|
||||||
|
}
|
@@ -27,7 +27,7 @@ namespace EveOPreview.Configuration
|
|||||||
bool EnableClientLayoutTracking { get; set; }
|
bool EnableClientLayoutTracking { get; set; }
|
||||||
bool HideActiveClientThumbnail { get; set; }
|
bool HideActiveClientThumbnail { get; set; }
|
||||||
bool MinimizeInactiveClients { get; set; }
|
bool MinimizeInactiveClients { get; set; }
|
||||||
bool MinimizeInactiveClientsAnimation { get; set; }
|
AnimationStyle WindowsAnimationStyle { get; set; }
|
||||||
bool ShowThumbnailsAlwaysOnTop { get; set; }
|
bool ShowThumbnailsAlwaysOnTop { get; set; }
|
||||||
bool EnablePerClientThumbnailLayouts { get; set; }
|
bool EnablePerClientThumbnailLayouts { get; set; }
|
||||||
|
|
||||||
|
@@ -126,6 +126,7 @@
|
|||||||
<Compile Include="ApplicationBase\PresenterGeneric.cs" />
|
<Compile Include="ApplicationBase\PresenterGeneric.cs" />
|
||||||
<Compile Include="Configuration\Implementation\AppConfig.cs" />
|
<Compile Include="Configuration\Implementation\AppConfig.cs" />
|
||||||
<Compile Include="Configuration\Implementation\ConfigurationStorage.cs" />
|
<Compile Include="Configuration\Implementation\ConfigurationStorage.cs" />
|
||||||
|
<Compile Include="Configuration\Interface\AnimationStyle.cs" />
|
||||||
<Compile Include="Configuration\Interface\IAppConfig.cs" />
|
<Compile Include="Configuration\Interface\IAppConfig.cs" />
|
||||||
<Compile Include="Configuration\Interface\IThumbnailConfiguration.cs" />
|
<Compile Include="Configuration\Interface\IThumbnailConfiguration.cs" />
|
||||||
<Compile Include="Configuration\Interface\ZoomAnchor.cs" />
|
<Compile Include="Configuration\Interface\ZoomAnchor.cs" />
|
||||||
@@ -145,6 +146,7 @@
|
|||||||
<Compile Include="Mediator\Messages\Services\StopService.cs" />
|
<Compile Include="Mediator\Messages\Services\StopService.cs" />
|
||||||
<Compile Include="Mediator\Messages\Thumbnails\ThumbnailLocationUpdated.cs" />
|
<Compile Include="Mediator\Messages\Thumbnails\ThumbnailLocationUpdated.cs" />
|
||||||
<Compile Include="Mediator\Messages\Thumbnails\ThumbnailActiveSizeUpdated.cs" />
|
<Compile Include="Mediator\Messages\Thumbnails\ThumbnailActiveSizeUpdated.cs" />
|
||||||
|
<Compile Include="Presenters\Implementation\ViewAnimationStyleConverter.cs" />
|
||||||
<Compile Include="Presenters\Interface\IMainFormPresenter.cs" />
|
<Compile Include="Presenters\Interface\IMainFormPresenter.cs" />
|
||||||
<Compile Include="Services\Implementation\ProcessInfo.cs" />
|
<Compile Include="Services\Implementation\ProcessInfo.cs" />
|
||||||
<Compile Include="Services\Implementation\ProcessMonitor.cs" />
|
<Compile Include="Services\Implementation\ProcessMonitor.cs" />
|
||||||
@@ -184,6 +186,7 @@
|
|||||||
<Compile Include="View\Interface\IMainFormView.cs" />
|
<Compile Include="View\Interface\IMainFormView.cs" />
|
||||||
<Compile Include="ApplicationBase\IView.cs" />
|
<Compile Include="ApplicationBase\IView.cs" />
|
||||||
<Compile Include="View\Interface\IThumbnailDescription.cs" />
|
<Compile Include="View\Interface\IThumbnailDescription.cs" />
|
||||||
|
<Compile Include="View\Interface\ViewAnimationStyle.cs" />
|
||||||
<Compile Include="View\Interface\ViewZoomAnchor.cs" />
|
<Compile Include="View\Interface\ViewZoomAnchor.cs" />
|
||||||
<Compile Include="Configuration\Implementation\ThumbnailConfiguration.cs" />
|
<Compile Include="Configuration\Implementation\ThumbnailConfiguration.cs" />
|
||||||
<Compile Include="Hotkeys\HotkeyHandler.cs" />
|
<Compile Include="Hotkeys\HotkeyHandler.cs" />
|
||||||
|
@@ -107,7 +107,7 @@ namespace EveOPreview.Presenters
|
|||||||
this.View.EnableClientLayoutTracking = this._configuration.EnableClientLayoutTracking;
|
this.View.EnableClientLayoutTracking = this._configuration.EnableClientLayoutTracking;
|
||||||
this.View.HideActiveClientThumbnail = this._configuration.HideActiveClientThumbnail;
|
this.View.HideActiveClientThumbnail = this._configuration.HideActiveClientThumbnail;
|
||||||
this.View.MinimizeInactiveClients = this._configuration.MinimizeInactiveClients;
|
this.View.MinimizeInactiveClients = this._configuration.MinimizeInactiveClients;
|
||||||
this.View.MinimizeInactiveClientsAnimation = this._configuration.MinimizeInactiveClientsAnimation;
|
this.View.WindowsAnimationStyle = ViewAnimationStyleConverter.Convert(this._configuration.WindowsAnimationStyle);
|
||||||
this.View.ShowThumbnailsAlwaysOnTop = this._configuration.ShowThumbnailsAlwaysOnTop;
|
this.View.ShowThumbnailsAlwaysOnTop = this._configuration.ShowThumbnailsAlwaysOnTop;
|
||||||
this.View.HideThumbnailsOnLostFocus = this._configuration.HideThumbnailsOnLostFocus;
|
this.View.HideThumbnailsOnLostFocus = this._configuration.HideThumbnailsOnLostFocus;
|
||||||
this.View.EnablePerClientThumbnailLayouts = this._configuration.EnablePerClientThumbnailLayouts;
|
this.View.EnablePerClientThumbnailLayouts = this._configuration.EnablePerClientThumbnailLayouts;
|
||||||
@@ -142,7 +142,7 @@ namespace EveOPreview.Presenters
|
|||||||
this._configuration.EnableClientLayoutTracking = this.View.EnableClientLayoutTracking;
|
this._configuration.EnableClientLayoutTracking = this.View.EnableClientLayoutTracking;
|
||||||
this._configuration.HideActiveClientThumbnail = this.View.HideActiveClientThumbnail;
|
this._configuration.HideActiveClientThumbnail = this.View.HideActiveClientThumbnail;
|
||||||
this._configuration.MinimizeInactiveClients = this.View.MinimizeInactiveClients;
|
this._configuration.MinimizeInactiveClients = this.View.MinimizeInactiveClients;
|
||||||
this._configuration.MinimizeInactiveClientsAnimation = this.View.MinimizeInactiveClientsAnimation;
|
this._configuration.WindowsAnimationStyle = ViewAnimationStyleConverter.Convert(this.View.WindowsAnimationStyle);
|
||||||
this._configuration.ShowThumbnailsAlwaysOnTop = this.View.ShowThumbnailsAlwaysOnTop;
|
this._configuration.ShowThumbnailsAlwaysOnTop = this.View.ShowThumbnailsAlwaysOnTop;
|
||||||
this._configuration.HideThumbnailsOnLostFocus = this.View.HideThumbnailsOnLostFocus;
|
this._configuration.HideThumbnailsOnLostFocus = this.View.HideThumbnailsOnLostFocus;
|
||||||
this._configuration.EnablePerClientThumbnailLayouts = this.View.EnablePerClientThumbnailLayouts;
|
this._configuration.EnablePerClientThumbnailLayouts = this.View.EnablePerClientThumbnailLayouts;
|
||||||
|
@@ -0,0 +1,19 @@
|
|||||||
|
using EveOPreview.Configuration;
|
||||||
|
|
||||||
|
namespace EveOPreview.View
|
||||||
|
{
|
||||||
|
static class ViewAnimationStyleConverter
|
||||||
|
{
|
||||||
|
public static AnimationStyle Convert(ViewAnimationStyle value)
|
||||||
|
{
|
||||||
|
// Cheat based on fact that the order and byte values of both enums are the same
|
||||||
|
return (AnimationStyle)((int)value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ViewAnimationStyle Convert(AnimationStyle value)
|
||||||
|
{
|
||||||
|
// Cheat based on fact that the order and byte values of both enums are the same
|
||||||
|
return (ViewAnimationStyle)((int)value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -12,7 +12,7 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
[assembly: Guid("04f08f8d-9e98-423b-acdb-4effb31c0d35")]
|
[assembly: Guid("04f08f8d-9e98-423b-acdb-4effb31c0d35")]
|
||||||
[assembly: AssemblyVersion("8.0.1.4")]
|
[assembly: AssemblyVersion("8.0.1.5")]
|
||||||
[assembly: AssemblyFileVersion("8.0.1.4")]
|
[assembly: AssemblyFileVersion("8.0.1.5")]
|
||||||
|
|
||||||
[assembly: CLSCompliant(false)]
|
[assembly: CLSCompliant(false)]
|
@@ -102,7 +102,7 @@ namespace EveOPreview.Services
|
|||||||
{
|
{
|
||||||
this.GetActiveClient()?.ClearBorder();
|
this.GetActiveClient()?.ClearBorder();
|
||||||
|
|
||||||
this._windowManager.ActivateWindow(newClient.Key, this._configuration.MinimizeInactiveClientsAnimation);
|
this._windowManager.ActivateWindow(newClient.Key, this._configuration.WindowsAnimationStyle);
|
||||||
this.SwitchActiveClient(newClient.Key, newClient.Value.Title);
|
this.SwitchActiveClient(newClient.Key, newClient.Value.Title);
|
||||||
|
|
||||||
newClient.Value.SetHighlight();
|
newClient.Value.SetHighlight();
|
||||||
@@ -490,7 +490,7 @@ namespace EveOPreview.Services
|
|||||||
// Minimize the currently active client if needed
|
// Minimize the currently active client if needed
|
||||||
if (this._configuration.MinimizeInactiveClients && !this._configuration.IsPriorityClient(this._activeClient.Title))
|
if (this._configuration.MinimizeInactiveClients && !this._configuration.IsPriorityClient(this._activeClient.Title))
|
||||||
{
|
{
|
||||||
this._windowManager.MinimizeWindow(this._activeClient.Handle, this._configuration.MinimizeInactiveClientsAnimation);
|
this._windowManager.MinimizeWindow(this._activeClient.Handle, this._configuration.WindowsAnimationStyle, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._activeClient = (foregroundClientHandle, foregroundClientTitle);
|
this._activeClient = (foregroundClientHandle, foregroundClientTitle);
|
||||||
@@ -541,7 +541,7 @@ namespace EveOPreview.Services
|
|||||||
|
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
this._windowManager.ActivateWindow(view.Id, this._configuration.MinimizeInactiveClientsAnimation);
|
this._windowManager.ActivateWindow(view.Id, this._configuration.WindowsAnimationStyle);
|
||||||
})
|
})
|
||||||
.ContinueWith((task) =>
|
.ContinueWith((task) =>
|
||||||
{
|
{
|
||||||
@@ -556,7 +556,7 @@ namespace EveOPreview.Services
|
|||||||
{
|
{
|
||||||
if (switchOut)
|
if (switchOut)
|
||||||
{
|
{
|
||||||
this._windowManager.ActivateWindow(this._externalApplication, this._configuration.MinimizeInactiveClientsAnimation);
|
this._windowManager.ActivateWindow(this._externalApplication, this._configuration.WindowsAnimationStyle);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -565,7 +565,7 @@ namespace EveOPreview.Services
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._windowManager.MinimizeWindow(view.Id, this._configuration.MinimizeInactiveClientsAnimation);
|
this._windowManager.MinimizeWindow(view.Id, this._configuration.WindowsAnimationStyle, true);
|
||||||
this.RefreshThumbnails();
|
this.RefreshThumbnails();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -750,7 +750,7 @@ namespace EveOPreview.Services
|
|||||||
|
|
||||||
if (clientLayout.IsMaximized)
|
if (clientLayout.IsMaximized)
|
||||||
{
|
{
|
||||||
this._windowManager.MaximizeWindow(clientHandle, this._configuration.MinimizeInactiveClientsAnimation);
|
this._windowManager.MaximizeWindow(clientHandle);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using EveOPreview.Configuration;
|
||||||
using EveOPreview.Services.Interop;
|
using EveOPreview.Services.Interop;
|
||||||
|
|
||||||
namespace EveOPreview.Services.Implementation
|
namespace EveOPreview.Services.Implementation
|
||||||
@@ -9,6 +10,7 @@ namespace EveOPreview.Services.Implementation
|
|||||||
{
|
{
|
||||||
#region Private constants
|
#region Private constants
|
||||||
private const int WINDOW_SIZE_THRESHOLD = 300;
|
private const int WINDOW_SIZE_THRESHOLD = 300;
|
||||||
|
private const int NO_ANIMATION = 0;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public WindowManager()
|
public WindowManager()
|
||||||
@@ -18,8 +20,12 @@ namespace EveOPreview.Services.Implementation
|
|||||||
((Environment.OSVersion.Version.Major == 6) && (Environment.OSVersion.Version.Minor >= 2)) // Win 8 and Win 8.1
|
((Environment.OSVersion.Version.Major == 6) && (Environment.OSVersion.Version.Minor >= 2)) // Win 8 and Win 8.1
|
||||||
|| (Environment.OSVersion.Version.Major >= 10) // Win 10
|
|| (Environment.OSVersion.Version.Major >= 10) // Win 10
|
||||||
|| DwmNativeMethods.DwmIsCompositionEnabled(); // In case of Win 7 an API call is requiredWin 7
|
|| DwmNativeMethods.DwmIsCompositionEnabled(); // In case of Win 7 an API call is requiredWin 7
|
||||||
|
_animationParam.cbSize = (System.UInt32)Marshal.SizeOf(typeof(ANIMATIONINFO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int? _currentAnimationSetting = null;
|
||||||
|
private ANIMATIONINFO _animationParam = new ANIMATIONINFO();
|
||||||
|
|
||||||
public bool IsCompositionEnabled { get; }
|
public bool IsCompositionEnabled { get; }
|
||||||
|
|
||||||
public IntPtr GetForegroundWindowHandle()
|
public IntPtr GetForegroundWindowHandle()
|
||||||
@@ -27,7 +33,36 @@ namespace EveOPreview.Services.Implementation
|
|||||||
return User32NativeMethods.GetForegroundWindow();
|
return User32NativeMethods.GetForegroundWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ActivateWindow(IntPtr handle, bool enableAnimation)
|
private void TurnOffAnimation()
|
||||||
|
{
|
||||||
|
var currentAnimationSetup = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_GETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref _animationParam, 0);
|
||||||
|
if (_currentAnimationSetting == null)
|
||||||
|
{
|
||||||
|
// Store the current Animation Setting
|
||||||
|
_currentAnimationSetting = _animationParam.iMinAnimate;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentAnimationSetup != NO_ANIMATION)
|
||||||
|
{
|
||||||
|
// Turn off Animation
|
||||||
|
_animationParam.iMinAnimate = NO_ANIMATION;
|
||||||
|
var animationOffReturn = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_SETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref _animationParam, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RestoreAnimation()
|
||||||
|
{
|
||||||
|
var currentAnimationSetup = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_GETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref _animationParam, 0);
|
||||||
|
// Restore current Animation Settings
|
||||||
|
if (_animationParam.iMinAnimate != (int)_currentAnimationSetting)
|
||||||
|
{
|
||||||
|
_animationParam.iMinAnimate = (int)_currentAnimationSetting;
|
||||||
|
var animationResetReturn = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_SETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref _animationParam, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void ActivateWindow(IntPtr handle, AnimationStyle animation)
|
||||||
{
|
{
|
||||||
User32NativeMethods.SetForegroundWindow(handle);
|
User32NativeMethods.SetForegroundWindow(handle);
|
||||||
User32NativeMethods.SetFocus(handle);
|
User32NativeMethods.SetFocus(handle);
|
||||||
@@ -36,57 +71,54 @@ namespace EveOPreview.Services.Implementation
|
|||||||
|
|
||||||
if ((style & InteropConstants.WS_MINIMIZE) == InteropConstants.WS_MINIMIZE)
|
if ((style & InteropConstants.WS_MINIMIZE) == InteropConstants.WS_MINIMIZE)
|
||||||
{
|
{
|
||||||
if (enableAnimation)
|
switch (animation)
|
||||||
{
|
{
|
||||||
User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_RESTORE);
|
case AnimationStyle.OriginalAnimation:
|
||||||
}
|
User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_RESTORE);
|
||||||
else
|
break;
|
||||||
{
|
case AnimationStyle.NoAnimation:
|
||||||
ANIMATIONINFO param = new ANIMATIONINFO();
|
TurnOffAnimation();
|
||||||
param.cbSize = (System.UInt32)Marshal.SizeOf(typeof(ANIMATIONINFO));
|
User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_RESTORE);
|
||||||
|
RestoreAnimation();
|
||||||
// Store the current Animation Setting
|
break;
|
||||||
var ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_GETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
|
}
|
||||||
int currentAnimationSetting = param.iMinAnimate;
|
}
|
||||||
|
|
||||||
// Turn off Animation
|
|
||||||
param.iMinAnimate = 0;
|
|
||||||
ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_SETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
|
|
||||||
|
|
||||||
User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_RESTORE);
|
|
||||||
|
|
||||||
// Restore current Animation Settings
|
|
||||||
param.iMinAnimate = currentAnimationSetting;
|
|
||||||
ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_SETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MinimizeWindow(IntPtr handle, bool enableAnimation)
|
public void MinimizeWindow(IntPtr handle, AnimationStyle animation, bool enableAnimation)
|
||||||
{
|
{
|
||||||
if (enableAnimation)
|
if (enableAnimation)
|
||||||
{
|
{
|
||||||
User32NativeMethods.SendMessage(handle, InteropConstants.WM_SYSCOMMAND, InteropConstants.SC_MINIMIZE, 0);
|
switch (animation)
|
||||||
|
{
|
||||||
|
case AnimationStyle.OriginalAnimation:
|
||||||
|
User32NativeMethods.SendMessage(handle, InteropConstants.WM_SYSCOMMAND, InteropConstants.SC_MINIMIZE, 0);
|
||||||
|
break;
|
||||||
|
case AnimationStyle.NoAnimation:
|
||||||
|
TurnOffAnimation();
|
||||||
|
User32NativeMethods.SendMessage(handle, InteropConstants.WM_SYSCOMMAND, InteropConstants.SC_MINIMIZE, 0);
|
||||||
|
RestoreAnimation();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ANIMATIONINFO param = new ANIMATIONINFO();
|
switch (animation)
|
||||||
param.cbSize = (System.UInt32)Marshal.SizeOf(typeof(ANIMATIONINFO));
|
{
|
||||||
|
case AnimationStyle.OriginalAnimation:
|
||||||
// Store Current Animation Setting
|
WINDOWPLACEMENT param = new WINDOWPLACEMENT();
|
||||||
var ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_GETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
|
param.length = Marshal.SizeOf(typeof(WINDOWPLACEMENT));
|
||||||
int currentAnimationSetting = param.iMinAnimate;
|
User32NativeMethods.GetWindowPlacement(handle, ref param);
|
||||||
|
param.showCmd = WINDOWPLACEMENT.SW_MINIMIZE;
|
||||||
// Turn off Animation
|
User32NativeMethods.SetWindowPlacement(handle, ref param);
|
||||||
param.iMinAnimate = 0;
|
break;
|
||||||
ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_SETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
|
case AnimationStyle.NoAnimation:
|
||||||
|
TurnOffAnimation();
|
||||||
User32NativeMethods.SendMessage(handle, InteropConstants.WM_SYSCOMMAND, InteropConstants.SC_MINIMIZE, 0);
|
User32NativeMethods.SendMessage(handle, InteropConstants.WM_SYSCOMMAND, InteropConstants.SC_MINIMIZE, 0);
|
||||||
|
RestoreAnimation();
|
||||||
// Restore current Animation Settings
|
break;
|
||||||
param.iMinAnimate = currentAnimationSetting;
|
}
|
||||||
ret = User32NativeMethods.SystemParametersInfo(User32NativeMethods.SPI_SETANIMATION, (System.Int32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref param, 0);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveWindow(IntPtr handle, int left, int top, int width, int height)
|
public void MoveWindow(IntPtr handle, int left, int top, int width, int height)
|
||||||
@@ -94,21 +126,9 @@ namespace EveOPreview.Services.Implementation
|
|||||||
User32NativeMethods.MoveWindow(handle, left, top, width, height, true);
|
User32NativeMethods.MoveWindow(handle, left, top, width, height, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MaximizeWindow(IntPtr handle, bool enableAnimation)
|
public void MaximizeWindow(IntPtr handle)
|
||||||
{
|
{
|
||||||
if (enableAnimation)
|
User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_SHOWMAXIMIZED);
|
||||||
{
|
|
||||||
User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_SHOWMAXIMIZED);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
WINDOWPLACEMENT param = new WINDOWPLACEMENT();
|
|
||||||
param.length = Marshal.SizeOf(typeof(WINDOWPLACEMENT));
|
|
||||||
User32NativeMethods.GetWindowPlacement(handle, ref param);
|
|
||||||
param.showCmd = WINDOWPLACEMENT.SW_MINIMIZE;
|
|
||||||
User32NativeMethods.SetWindowPlacement(handle, ref param);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public (int Left, int Top, int Right, int Bottom) GetWindowPosition(IntPtr handle)
|
public (int Left, int Top, int Right, int Bottom) GetWindowPosition(IntPtr handle)
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using EveOPreview.Configuration;
|
||||||
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|
||||||
namespace EveOPreview.Services
|
namespace EveOPreview.Services
|
||||||
@@ -8,10 +9,10 @@ namespace EveOPreview.Services
|
|||||||
bool IsCompositionEnabled { get; }
|
bool IsCompositionEnabled { get; }
|
||||||
|
|
||||||
IntPtr GetForegroundWindowHandle();
|
IntPtr GetForegroundWindowHandle();
|
||||||
void ActivateWindow(IntPtr handle, bool enableAnimation);
|
void ActivateWindow(IntPtr handle, AnimationStyle animation);
|
||||||
void MinimizeWindow(IntPtr handle, bool enableAnimation);
|
void MinimizeWindow(IntPtr handle, AnimationStyle animation, bool enableAnimation);
|
||||||
void MoveWindow(IntPtr handle, int left, int top, int width, int height);
|
void MoveWindow(IntPtr handle, int left, int top, int width, int height);
|
||||||
void MaximizeWindow(IntPtr handle, bool enableAnimation);
|
void MaximizeWindow(IntPtr handle);
|
||||||
(int Left, int Top, int Right, int Bottom) GetWindowPosition(IntPtr handle);
|
(int Left, int Top, int Right, int Bottom) GetWindowPosition(IntPtr handle);
|
||||||
bool IsWindowMaximized(IntPtr handle);
|
bool IsWindowMaximized(IntPtr handle);
|
||||||
bool IsWindowMinimized(IntPtr handle);
|
bool IsWindowMinimized(IntPtr handle);
|
||||||
|
2238
src/Eve-O-Preview/View/Implementation/MainForm.Designer.cs
generated
2238
src/Eve-O-Preview/View/Implementation/MainForm.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,10 @@
|
|||||||
|
using EveOPreview.Configuration;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||||
|
|
||||||
namespace EveOPreview.View
|
namespace EveOPreview.View
|
||||||
{
|
{
|
||||||
@@ -36,6 +38,10 @@ namespace EveOPreview.View
|
|||||||
this.InitZoomAnchorMap();
|
this.InitZoomAnchorMap();
|
||||||
this.InitOverlayLabelMap();
|
this.InitOverlayLabelMap();
|
||||||
this.InitFormSize();
|
this.InitFormSize();
|
||||||
|
|
||||||
|
|
||||||
|
this.AnimationStyleCombo.DataSource = Enum.GetValues(typeof(AnimationStyle));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool MinimizeToTray
|
public bool MinimizeToTray
|
||||||
@@ -80,10 +86,10 @@ namespace EveOPreview.View
|
|||||||
get => this.MinimizeInactiveClientsCheckBox.Checked;
|
get => this.MinimizeInactiveClientsCheckBox.Checked;
|
||||||
set => this.MinimizeInactiveClientsCheckBox.Checked = value;
|
set => this.MinimizeInactiveClientsCheckBox.Checked = value;
|
||||||
}
|
}
|
||||||
public bool MinimizeInactiveClientsAnimation
|
public ViewAnimationStyle WindowsAnimationStyle
|
||||||
{
|
{
|
||||||
get => this.MinimizeInactiveClientsAnimationCheckBox.Checked;
|
get => (ViewAnimationStyle)this.AnimationStyleCombo.SelectedItem;
|
||||||
set => this.MinimizeInactiveClientsAnimationCheckBox.Checked = value;
|
set => this.AnimationStyleCombo.SelectedIndex = (int)value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ShowThumbnailsAlwaysOnTop
|
public bool ShowThumbnailsAlwaysOnTop
|
||||||
@@ -515,5 +521,15 @@ namespace EveOPreview.View
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void AnimationStyleCombo_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GeneralSettingsPanel_Paint(object sender, PaintEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -138,15 +138,33 @@
|
|||||||
<metadata name="GeneralSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="GeneralSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="label4.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>False</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="ThumbnailTabPage.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="ThumbnailTabPage.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="ThumbnailSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="ThumbnailSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="HeigthLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>False</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="OpacityLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>False</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="ZoomSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="ZoomSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="ZoomFactorLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>False</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="OverlayTabPage.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="OverlayTabPage.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
@@ -159,75 +177,15 @@
|
|||||||
<metadata name="ClientsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="ClientsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="ThumbnailsListLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>False</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="AboutTabPage.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="AboutTabPage.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="AboutPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="AboutPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="GeneralSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>False</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="HeigthLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>False</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="OpacityLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>False</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="WidthLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>False</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="ZoomSettingsPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>False</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="ZoomAnchorLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>False</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="ZoomAnchorLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>False</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="ThumbnailsListLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>False</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="AboutPanel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>False</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="CreditMaintLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>False</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="DescriptionLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>False</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="CreditMaintLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="CreditMaintLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
@@ -17,7 +17,7 @@ namespace EveOPreview.View
|
|||||||
bool EnableClientLayoutTracking { get; set; }
|
bool EnableClientLayoutTracking { get; set; }
|
||||||
bool HideActiveClientThumbnail { get; set; }
|
bool HideActiveClientThumbnail { get; set; }
|
||||||
bool MinimizeInactiveClients { get; set; }
|
bool MinimizeInactiveClients { get; set; }
|
||||||
bool MinimizeInactiveClientsAnimation { get; set; }
|
ViewAnimationStyle WindowsAnimationStyle { get; set; }
|
||||||
bool ShowThumbnailsAlwaysOnTop { get; set; }
|
bool ShowThumbnailsAlwaysOnTop { get; set; }
|
||||||
bool HideThumbnailsOnLostFocus { get; set; }
|
bool HideThumbnailsOnLostFocus { get; set; }
|
||||||
bool EnablePerClientThumbnailLayouts { get; set; }
|
bool EnablePerClientThumbnailLayouts { get; set; }
|
||||||
|
8
src/Eve-O-Preview/View/Interface/ViewAnimationStyle.cs
Normal file
8
src/Eve-O-Preview/View/Interface/ViewAnimationStyle.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace EveOPreview.View
|
||||||
|
{
|
||||||
|
public enum ViewAnimationStyle
|
||||||
|
{
|
||||||
|
OriginalAnimation,
|
||||||
|
NoAnimation
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user