feat(Eve-O-Preview): add hotkey to toggle all thumbnails and update target framework

This commit is contained in:
2025-08-29 23:35:58 +02:00
parent 368e5e88c1
commit dbee1a03d3
4 changed files with 30 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows8.0</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<RootNamespace>EveOMock</RootNamespace>
<AssemblyName>ExeFile</AssemblyName>

View File

@@ -124,6 +124,8 @@ namespace EveOPreview.Configuration.Implementation {
this.IconName = "";
this.LoginThumbnailLocation = new Point(5, 5);
this.ToggleAllThumbnailsHotkey = "Alt+F12";
this.ThumbnailsManuallyHidden = false;
}
[JsonProperty("ConfigVersion")]
@@ -318,6 +320,16 @@ namespace EveOPreview.Configuration.Implementation {
get; set;
}
[JsonProperty("ToggleAllThumbnailsHotkey")]
public string ToggleAllThumbnailsHotkey {
get; set;
}
[JsonProperty("ThumbnailsManuallyHidden")]
public bool ThumbnailsManuallyHidden {
get; set;
}
[JsonProperty]
private Dictionary<string, Dictionary<string, Point>> PerClientLayout {
get; set;

View File

@@ -25,6 +25,8 @@ namespace EveOPreview.Configuration {
Dictionary<string, int> CycleGroup5ClientsOrder { get; set; }
string ToggleTrackingHotkey { get; set; }
string ToggleAllThumbnailsHotkey { get; set; }
bool ThumbnailsManuallyHidden { get; set; }
Dictionary<string, Color> PerClientActiveClientHighlightColor { get; set; }
Dictionary<string, Size> PerClientThumbnailSize { get; set; }

View File

@@ -52,6 +52,7 @@ namespace EveOPreview.Services {
private List<HotkeyHandler> _cycleClientHotkeyHandlers = new List<HotkeyHandler>();
private HotkeyHandler _toggleTrackingHotkey;
private HotkeyHandler _toggleAllThumbnailsHotkey;
#endregion
public ThumbnailManager(IMediator mediator, IThumbnailConfiguration configuration,
@@ -167,6 +168,18 @@ namespace EveOPreview.Services {
};
registered = toggleSingleProcessHotkey.Register();
System.Diagnostics.Debug.WriteLine($"Single process hotkey registration result: {registered}");
// Setup toggle all thumbnails hotkey
var toggleAllThumbnailsKey = this._configuration.StringToKey(this._configuration.ToggleAllThumbnailsHotkey);
this._toggleAllThumbnailsHotkey = new HotkeyHandler(mainHandle, toggleAllThumbnailsKey);
this._toggleAllThumbnailsHotkey.Pressed += (object s, HandledEventArgs e) => {
this._configuration.ThumbnailsManuallyHidden = !this._configuration.ThumbnailsManuallyHidden;
System.Diagnostics.Debug.WriteLine(
$"Toggled all thumbnails: {(this._configuration.ThumbnailsManuallyHidden ? "Hidden" : "Visible")}");
e.Handled = true;
};
registered = this._toggleAllThumbnailsHotkey.Register();
System.Diagnostics.Debug.WriteLine($"Toggle all thumbnails hotkey registration result: {registered}");
}
public IThumbnailView GetClientByTitle(string title) {
@@ -439,7 +452,8 @@ namespace EveOPreview.Services {
}
bool hideAllThumbnails =
this._configuration.HideThumbnailsOnLostFocus && !(isClientWindow || isMainWindowActive);
this._configuration.HideThumbnailsOnLostFocus && !(isClientWindow || isMainWindowActive) ||
this._configuration.ThumbnailsManuallyHidden;
// Wait for some time before hiding all previews
if (hideAllThumbnails) {