diff --git a/src/Eve-O-Mock/Eve-O-Mock.csproj b/src/Eve-O-Mock/Eve-O-Mock.csproj index 85f03b0..3fccb8b 100644 --- a/src/Eve-O-Mock/Eve-O-Mock.csproj +++ b/src/Eve-O-Mock/Eve-O-Mock.csproj @@ -1,6 +1,6 @@  - net8.0-windows8.0 + net6.0-windows WinExe EveOMock ExeFile diff --git a/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs b/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs index 0ce2ad2..c52a8d1 100644 --- a/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs +++ b/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs @@ -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> PerClientLayout { get; set; diff --git a/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs b/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs index 0c44ce3..8c378ae 100644 --- a/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs +++ b/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs @@ -25,6 +25,8 @@ namespace EveOPreview.Configuration { Dictionary CycleGroup5ClientsOrder { get; set; } string ToggleTrackingHotkey { get; set; } + string ToggleAllThumbnailsHotkey { get; set; } + bool ThumbnailsManuallyHidden { get; set; } Dictionary PerClientActiveClientHighlightColor { get; set; } Dictionary PerClientThumbnailSize { get; set; } diff --git a/src/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs b/src/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs index 181029e..4df6c3a 100644 --- a/src/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs +++ b/src/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs @@ -52,6 +52,7 @@ namespace EveOPreview.Services { private List _cycleClientHotkeyHandlers = new List(); 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) {