diff --git a/README.md b/README.md index e23bdad..90c0605 100644 --- a/README.md +++ b/README.md @@ -274,6 +274,24 @@ You should modify this entry with a list of each of your clients replacing "Exam If a client does not appear in this list, then it will use the global thumbnail size by default. +### Per Client Zoom Anchor +Would you like to have different clients with different ZoomAnchor for each thumbnail ? + +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 **PerClientZoomAnchor**. Most probably it will look like + + "PerClientZoomAnchor": { + "EVE - Example Toon 1": 1, + "EVE - Example Toon 2": 2, + "EVE": 3 + } + +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 Zoom Anchor for the thumbnail (which sets the starting point of the thumbnail zoom). +Valid values are 0-8 : 0-NW, 1-North, 2-NE, 3-West, 4-Center, 5-East, 6-SW, 7-South, 8-SE. + +If a client does not appear in this list, then it will use the global Zoom Anchor 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 ed4303e..a94c1c8 100644 --- a/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs +++ b/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs @@ -47,6 +47,12 @@ namespace EveOPreview.Configuration.Implementation {"EVE - Example Toon 2", new Size(200, 200)} }; + this.PerClientZoomAnchor = new Dictionary + { + {"EVE - Example Toon 1", ZoomAnchor.N }, + {"EVE - Example Toon 2", ZoomAnchor.S} + }; + this.PerClientLayout = new Dictionary>(); this.FlatLayout = new Dictionary(); this.ClientLayout = new Dictionary(); @@ -129,6 +135,8 @@ namespace EveOPreview.Configuration.Implementation [JsonProperty("PerClientThumbnailSize")] public Dictionary PerClientThumbnailSize { get; set; } + [JsonProperty("PerClientZoomAnchor")] + public Dictionary PerClientZoomAnchor{ get; set; } public bool MinimizeToTray { get; set; } public int ThumbnailRefreshPeriod { get; set; } public int ThumbnailResizeTimeoutPeriod { get; set; } @@ -246,6 +254,11 @@ namespace EveOPreview.Configuration.Implementation Size sizeOfThumbnail; return this.PerClientThumbnailSize.TryGetValue(currentClient, out sizeOfThumbnail) ? sizeOfThumbnail : defaultSize; } + public ZoomAnchor GetZoomAnchor(string currentClient, ZoomAnchor defaultZoomAnchor) + { + ZoomAnchor zoomAnchor; + return this.PerClientZoomAnchor.TryGetValue(currentClient, out zoomAnchor) ? zoomAnchor : defaultZoomAnchor; + } public void SetThumbnailLocation(string currentClient, string activeClient, Point location) { diff --git a/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs b/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs index 67c0c39..5c375e0 100644 --- a/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs +++ b/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs @@ -62,6 +62,7 @@ namespace EveOPreview.Configuration Point GetThumbnailLocation(string currentClient, string activeClient, Point defaultLocation); Size GetThumbnailSize(string currentClient, string activeClient, Size defaultSize); + ZoomAnchor GetZoomAnchor(string currentClient, ZoomAnchor defaultZoomAnchor); 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 09b3c74..1f63ea6 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.3")] -[assembly: AssemblyFileVersion("8.0.1.3")] +[assembly: AssemblyVersion("8.0.1.4")] +[assembly: AssemblyFileVersion("8.0.1.4")] [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 a51c2ab..7140867 100644 --- a/src/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs +++ b/src/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs @@ -236,7 +236,7 @@ namespace EveOPreview.Services view.RegisterHotkey(this._configuration.GetClientHotkey(view.Title)); - this.ApplyClientLayout(view.Id, view.Title); + this.ApplyClientLayout(view); // TODO Add extension filter here later if (view.Title != ThumbnailManager.DEFAULT_CLIENT_TITLE) @@ -263,7 +263,7 @@ namespace EveOPreview.Services view.RegisterHotkey(this._configuration.GetClientHotkey(process.Title)); - this.ApplyClientLayout(view.Id, view.Title); + this.ApplyClientLayout(view); } } @@ -629,7 +629,7 @@ namespace EveOPreview.Services { this.DisableViewEvents(); - view.ZoomIn(ViewZoomAnchorConverter.Convert(this._configuration.ThumbnailZoomAnchor), this._configuration.ThumbnailZoomFactor); + view.ZoomIn(ViewZoomAnchorConverter.Convert(view.ClientZoomAnchor), this._configuration.ThumbnailZoomFactor); view.Refresh(false); this.EnableViewEvents(); @@ -725,8 +725,11 @@ namespace EveOPreview.Services return (0, 0); } - private void ApplyClientLayout(IntPtr clientHandle, string clientTitle) + private void ApplyClientLayout(IThumbnailView view) { + IntPtr clientHandle = view.Id; + string clientTitle = view.Title; + if (!this._configuration.EnableClientLayoutTracking) { return; @@ -753,6 +756,8 @@ namespace EveOPreview.Services { this._windowManager.MoveWindow(clientHandle, clientLayout.X, clientLayout.Y, clientLayout.Width, clientLayout.Height); } + + view.ClientZoomAnchor = this._configuration.GetZoomAnchor(clientTitle, this._configuration.ThumbnailZoomAnchor); } private void UpdateClientLayouts() diff --git a/src/Eve-O-Preview/View/Implementation/ThumbnailView.cs b/src/Eve-O-Preview/View/Implementation/ThumbnailView.cs index 1cad95a..941dbf0 100644 --- a/src/Eve-O-Preview/View/Implementation/ThumbnailView.cs +++ b/src/Eve-O-Preview/View/Implementation/ThumbnailView.cs @@ -96,7 +96,8 @@ namespace EveOPreview.View public bool IsActive { get; set; } public bool IsOverlayEnabled { get; set; } - + public ZoomAnchor ClientZoomAnchor { get; set; } + public Point ThumbnailLocation { get => this.Location; diff --git a/src/Eve-O-Preview/View/Interface/IThumbnailView.cs b/src/Eve-O-Preview/View/Interface/IThumbnailView.cs index 01553a8..38f7f1a 100644 --- a/src/Eve-O-Preview/View/Interface/IThumbnailView.cs +++ b/src/Eve-O-Preview/View/Interface/IThumbnailView.cs @@ -1,6 +1,7 @@ using System; using System.Drawing; using System.Windows.Forms; +using EveOPreview.Configuration; using EveOPreview.Services; namespace EveOPreview.View @@ -14,7 +15,7 @@ namespace EveOPreview.View Point ThumbnailLocation { get; set; } Size ThumbnailSize { get; set; } bool IsOverlayEnabled { get; set; } - + ZoomAnchor ClientZoomAnchor { get; set; } bool IsKnownHandle(IntPtr handle); void SetSizeLimitations(Size minimumSize, Size maximumSize);