PerClientZoomAnchor option

This commit is contained in:
Izakbar
2024-11-27 00:23:13 +00:00
parent 1a98888bbd
commit b7f9c71f5b
7 changed files with 47 additions and 8 deletions

View File

@@ -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:

View File

@@ -47,6 +47,12 @@ namespace EveOPreview.Configuration.Implementation
{"EVE - Example Toon 2", new Size(200, 200)}
};
this.PerClientZoomAnchor = new Dictionary<string, ZoomAnchor>
{
{"EVE - Example Toon 1", ZoomAnchor.N },
{"EVE - Example Toon 2", ZoomAnchor.S}
};
this.PerClientLayout = new Dictionary<string, Dictionary<string, Point>>();
this.FlatLayout = new Dictionary<string, Point>();
this.ClientLayout = new Dictionary<string, ClientLayout>();
@@ -129,6 +135,8 @@ namespace EveOPreview.Configuration.Implementation
[JsonProperty("PerClientThumbnailSize")]
public Dictionary<string, Size> PerClientThumbnailSize { get; set; }
[JsonProperty("PerClientZoomAnchor")]
public Dictionary<string, ZoomAnchor> 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)
{

View File

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

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.3")]
[assembly: AssemblyFileVersion("8.0.1.3")]
[assembly: AssemblyVersion("8.0.1.4")]
[assembly: AssemblyFileVersion("8.0.1.4")]
[assembly: CLSCompliant(false)]

View File

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

View File

@@ -96,6 +96,7 @@ namespace EveOPreview.View
public bool IsActive { get; set; }
public bool IsOverlayEnabled { get; set; }
public ZoomAnchor ClientZoomAnchor { get; set; }
public Point ThumbnailLocation
{

View File

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