#7 Ability for PerClientThumbnailSize added to configuration

This commit is contained in:
Izakbar
2024-11-11 23:24:40 +00:00
parent b76ab65894
commit d3a0894f46
5 changed files with 44 additions and 2 deletions

View File

@@ -41,6 +41,12 @@ namespace EveOPreview.Configuration.Implementation
{"EVE - Example Toon 2", Color.Green}
};
this.PerClientThumbnailSize = new Dictionary<string, Size>
{
{"EVE - Example Toon 1", new Size(200, 200)},
{"EVE - Example Toon 2", new Size(200, 200)}
};
this.PerClientLayout = new Dictionary<string, Dictionary<string, Point>>();
this.FlatLayout = new Dictionary<string, Point>();
this.ClientLayout = new Dictionary<string, ClientLayout>();
@@ -119,6 +125,9 @@ namespace EveOPreview.Configuration.Implementation
[JsonProperty("PerClientActiveClientHighlightColor")]
public Dictionary<string, Color> PerClientActiveClientHighlightColor { get; set; }
[JsonProperty("PerClientThumbnailSize")]
public Dictionary<string, Size> 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<string, Point> layoutSource;

View File

@@ -15,6 +15,7 @@ namespace EveOPreview.Configuration
Dictionary<string, int> CycleGroup2ClientsOrder { get; set; }
Dictionary<string, Color> PerClientActiveClientHighlightColor { get; set; }
Dictionary<string, Size> 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);

View File

@@ -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)]

View File

@@ -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);