diff --git a/README.md b/README.md index f7f8f0a..e23bdad 100644 --- a/README.md +++ b/README.md @@ -256,6 +256,24 @@ If a client does not appear in this list, then it will use the global highlight **Hint** For a list of supported colors see: https://docs.microsoft.com/en-us/dotnet/api/system.drawing.color#properties +### Per Client Thumbnail Size +Would you like to have different clients with different thumbnail sizes ? + +EVE-O Preview doesn't provide any GUI to set the these per client overrides as yet. Though, It can be done via editing the configuration file directly. +**Note** Don't forget to make a backup copy of the file before editing it. + +Open the file using any text editor. find the entry **PerClientThumbnailSize**. Most probably it will look like + + "PerClientThumbnailSize": { + "EVE - Example Toon 1": "240, 180", + "EVE - Example Toon 2": "200, 100", + "EVE": "320, 240" + } + +You should modify this entry with a list of each of your clients replacing "Example Toon 1", etc with the name of your character. The values on the right represent the size of the thumbnail. + +If a client does not appear in this list, then it will use the global thumbnail size by default. + ### Compatibility Mode This setting allows to enable an alternate thumbnail render. This render doesn't use advanced DWM API to create live previews. Instead it is a screenshot-based render with the following pros and cons: diff --git a/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs b/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs index 66143e6..ffb60ad 100644 --- a/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs +++ b/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs @@ -41,6 +41,12 @@ namespace EveOPreview.Configuration.Implementation {"EVE - Example Toon 2", Color.Green} }; + this.PerClientThumbnailSize = new Dictionary + { + {"EVE - Example Toon 1", new Size(200, 200)}, + {"EVE - Example Toon 2", new Size(200, 200)} + }; + this.PerClientLayout = new Dictionary>(); this.FlatLayout = new Dictionary(); this.ClientLayout = new Dictionary(); @@ -119,6 +125,9 @@ namespace EveOPreview.Configuration.Implementation [JsonProperty("PerClientActiveClientHighlightColor")] public Dictionary PerClientActiveClientHighlightColor { get; set; } + [JsonProperty("PerClientThumbnailSize")] + public Dictionary PerClientThumbnailSize { get; set; } + public bool MinimizeToTray { get; set; } public int ThumbnailRefreshPeriod { get; set; } @@ -230,6 +239,12 @@ namespace EveOPreview.Configuration.Implementation return this.FlatLayout.TryGetValue(currentClient, out location) ? location : defaultLocation; } + public Size GetThumbnailSize(string currentClient, string activeClient, Size defaultSize) + { + Size sizeOfThumbnail; + return this.PerClientThumbnailSize.TryGetValue(currentClient, out sizeOfThumbnail) ? sizeOfThumbnail : defaultSize; + } + public void SetThumbnailLocation(string currentClient, string activeClient, Point location) { Dictionary layoutSource; diff --git a/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs b/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs index 333a8e1..be35381 100644 --- a/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs +++ b/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs @@ -15,6 +15,7 @@ namespace EveOPreview.Configuration Dictionary CycleGroup2ClientsOrder { get; set; } Dictionary PerClientActiveClientHighlightColor { get; set; } + Dictionary PerClientThumbnailSize { get; set; } bool MinimizeToTray { get; set; } int ThumbnailRefreshPeriod { get; set; } @@ -60,6 +61,7 @@ namespace EveOPreview.Configuration Point LoginThumbnailLocation { get; set; } Point GetThumbnailLocation(string currentClient, string activeClient, Point defaultLocation); + Size GetThumbnailSize(string currentClient, string activeClient, Size defaultSize); void SetThumbnailLocation(string currentClient, string activeClient, Point location); ClientLayout GetClientLayout(string currentClient); diff --git a/src/Eve-O-Preview/Properties/AssemblyInfo.cs b/src/Eve-O-Preview/Properties/AssemblyInfo.cs index 5f8f358..adc43da 100644 --- a/src/Eve-O-Preview/Properties/AssemblyInfo.cs +++ b/src/Eve-O-Preview/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("04f08f8d-9e98-423b-acdb-4effb31c0d35")] -[assembly: AssemblyVersion("8.0.1.1")] -[assembly: AssemblyFileVersion("8.0.1.1")] +[assembly: AssemblyVersion("8.0.1.2")] +[assembly: AssemblyFileVersion("8.0.1.2")] [assembly: CLSCompliant(false)] \ No newline at end of file diff --git a/src/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs b/src/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs index 456a3ac..a51c2ab 100644 --- a/src/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs +++ b/src/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs @@ -207,6 +207,12 @@ namespace EveOPreview.Services foreach (IProcessInfo process in addedProcesses) { + Size initialSize = this._configuration.ThumbnailSize; + if (this._configuration.PerClientThumbnailSize.Any(x => x.Key == process.Title)) + { + initialSize = this._configuration.PerClientThumbnailSize[process.Title]; + } + IThumbnailView view = this._thumbnailViewFactory.Create(process.Handle, process.Title, this._configuration.ThumbnailSize); view.IsOverlayEnabled = this._configuration.ShowThumbnailOverlays; view.SetFrames(this._configuration.ShowThumbnailFrames); @@ -407,6 +413,7 @@ namespace EveOPreview.Services if (this.IsManageableThumbnail(view)) { view.ThumbnailLocation = this._configuration.GetThumbnailLocation(view.Title, this._activeClient.Title, view.ThumbnailLocation); + view.ThumbnailSize = this._configuration.GetThumbnailSize(view.Title, this._activeClient.Title, view.ThumbnailSize); } view.SetOpacity(this._configuration.ThumbnailOpacity);