Some EVE clients should not be minimized even if the 'Minimize inactive clients' option is enabled

This commit is contained in:
Anton Kasyanov
2018-03-29 01:34:49 +03:00
parent a810539a19
commit fda4d9f0a9
3 changed files with 11 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ namespace EveOPreview.Configuration.Omplementation
this.ClientLayout = new Dictionary<string, ClientLayout>();
this.ClientHotkey = new Dictionary<string, string>();
this.DisableThumbnail = new Dictionary<string, bool>();
this.PriorityClients = new List<string>();
this.MinimizeToTray = false;
this.ThumbnailRefreshPeriod = 500;
@@ -119,6 +120,8 @@ namespace EveOPreview.Configuration.Omplementation
private Dictionary<string, string> ClientHotkey { get; set; }
[JsonProperty]
private Dictionary<string, bool> DisableThumbnail { get; set; }
[JsonProperty]
private List<string> PriorityClients { get; set; }
public Point GetDefaultThumbnailLocation()
{
@@ -208,6 +211,11 @@ namespace EveOPreview.Configuration.Omplementation
this.ClientHotkey[currentClient] = (new KeysConverter()).ConvertToInvariantString(hotkey);
}
public bool IsPriorityClient(string currentClient)
{
return this.PriorityClients.Contains(currentClient);
}
public bool IsThumbnailDisabled(string currentClient)
{
return this.DisableThumbnail.TryGetValue(currentClient, out bool isDisabled) && isDisabled;

View File

@@ -44,6 +44,8 @@ namespace EveOPreview.Configuration
Keys GetClientHotkey(string currentClient);
void SetClientHotkey(string currentClient, Keys hotkey);
bool IsPriorityClient(string currentClient);
bool IsThumbnailDisabled(string currentClient);
void ToggleThumbnail(string currentClient, bool isDisabled);

View File

@@ -334,7 +334,7 @@ namespace EveOPreview.Services
}
// Minimize the currently active client if needed
if (this._configuration.MinimizeInactiveClients)
if (this._configuration.MinimizeInactiveClients && !this._configuration.IsPriorityClient(this._activeClient.Title))
{
this._windowManager.MinimizeWindow(this._activeClient.Handle, false);
}