diff --git a/Eve-O-Preview/Configuration/ApplicationConfiguration.cs b/Eve-O-Preview/Configuration/AppConfig.cs similarity index 71% rename from Eve-O-Preview/Configuration/ApplicationConfiguration.cs rename to Eve-O-Preview/Configuration/AppConfig.cs index 7060fc2..f78f891 100644 --- a/Eve-O-Preview/Configuration/ApplicationConfiguration.cs +++ b/Eve-O-Preview/Configuration/AppConfig.cs @@ -5,15 +5,15 @@ using Newtonsoft.Json; namespace EveOPreview.Configuration { - public class ApplicationConfiguration : IApplicationConfiguration + public class AppConfig : IAppConfig { - public ApplicationConfiguration() + public AppConfig() { // Default values this.MinimizeToTray = false; this.ThumbnailRefreshPeriod = 500; - this.ThumbnailsOpacity = 0.5; + this.ThumbnailOpacity = 0.5; this.EnableClientLayoutTracking = false; this.HideActiveClientThumbnail = false; @@ -25,13 +25,16 @@ namespace EveOPreview.Configuration this.ThumbnailMinimumSize = new Size(100, 80); this.ThumbnailMaximumSize = new Size(640, 400); - this.EnableThumbnailZoom = false; + this.ThumbnailZoomEnabled = false; this.ThumbnailZoomFactor = 2; this.ThumbnailZoomAnchor = ZoomAnchor.NW; this.ShowThumbnailOverlays = true; this.ShowThumbnailFrames = true; + this.EnableActiveClientHighlight = false; + this.ActiveClientHighlightColor = Color.Yellow; + this.PerClientLayout = new Dictionary>(); this.FlatLayout = new Dictionary(); this.ClientLayout = new Dictionary(); @@ -41,7 +44,8 @@ namespace EveOPreview.Configuration public bool MinimizeToTray { get; set; } public int ThumbnailRefreshPeriod { get; set; } - public double ThumbnailsOpacity { get; set; } + [JsonProperty("ThumbnailsOpacity")] + public double ThumbnailOpacity { get; set; } public bool EnableClientLayoutTracking { get; set; } public bool HideActiveClientThumbnail { get; set; } @@ -53,13 +57,17 @@ namespace EveOPreview.Configuration public Size ThumbnailMaximumSize { get; set; } public Size ThumbnailMinimumSize { get; set; } - public bool EnableThumbnailZoom { get; set; } + [JsonProperty("EnableThumbnailZoom")] + public bool ThumbnailZoomEnabled { get; set; } public int ThumbnailZoomFactor { get; set; } public ZoomAnchor ThumbnailZoomAnchor { get; set; } public bool ShowThumbnailOverlays { get; set; } public bool ShowThumbnailFrames { get; set; } + public bool EnableActiveClientHighlight { get; set; } + public Color ActiveClientHighlightColor { get; set; } + [JsonProperty] private Dictionary> PerClientLayout { get; set; } [JsonProperty] @@ -149,5 +157,32 @@ namespace EveOPreview.Configuration { this.ClientHotkey[currentClient] = (new KeysConverter()).ConvertToInvariantString(hotkey); } + + /// + /// Applies restrictions to different parameters of the config + /// + public void ApplyRestrictions() + { + this.ThumbnailRefreshPeriod = AppConfig.ApplyRestrictions(this.ThumbnailRefreshPeriod, 300, 1000); + this.ThumbnailSize = new Size(AppConfig.ApplyRestrictions(this.ThumbnailSize.Width, this.ThumbnailMinimumSize.Width, this.ThumbnailMaximumSize.Width), + AppConfig.ApplyRestrictions(this.ThumbnailSize.Height, this.ThumbnailMinimumSize.Height, this.ThumbnailMaximumSize.Height)); + this.ThumbnailOpacity = AppConfig.ApplyRestrictions((int)(this.ThumbnailOpacity * 100.00), 20, 100) / 100.00; + this.ThumbnailZoomFactor = AppConfig.ApplyRestrictions(this.ThumbnailZoomFactor, 2, 10); + } + + private static int ApplyRestrictions(int value, int minimum, int maximum) + { + if (value <= minimum) + { + return minimum; + } + + if (value >= maximum) + { + return maximum; + } + + return value; + } } } \ No newline at end of file diff --git a/Eve-O-Preview/Configuration/ConfigurationStorage.cs b/Eve-O-Preview/Configuration/ConfigurationStorage.cs index e60dbf6..513b73e 100644 --- a/Eve-O-Preview/Configuration/ConfigurationStorage.cs +++ b/Eve-O-Preview/Configuration/ConfigurationStorage.cs @@ -7,9 +7,9 @@ namespace EveOPreview.Configuration { private const string ConfigurationFileName = "EVE-O Preview.json"; - private readonly IApplicationConfiguration _configuration; + private readonly IAppConfig _configuration; - public ConfigurationStorage(IApplicationConfiguration configuration) + public ConfigurationStorage(IAppConfig configuration) { this._configuration = configuration; } @@ -24,6 +24,9 @@ namespace EveOPreview.Configuration string rawData = File.ReadAllText(ConfigurationStorage.ConfigurationFileName); JsonConvert.PopulateObject(rawData, this._configuration); + + // Validate data after loading it + this._configuration.ApplyRestrictions(); } public void Save() diff --git a/Eve-O-Preview/Configuration/IApplicationConfiguration.cs b/Eve-O-Preview/Configuration/IAppConfig.cs similarity index 80% rename from Eve-O-Preview/Configuration/IApplicationConfiguration.cs rename to Eve-O-Preview/Configuration/IAppConfig.cs index 47c75cc..5e2cd81 100644 --- a/Eve-O-Preview/Configuration/IApplicationConfiguration.cs +++ b/Eve-O-Preview/Configuration/IAppConfig.cs @@ -3,12 +3,12 @@ using System.Windows.Forms; namespace EveOPreview.Configuration { - public interface IApplicationConfiguration + public interface IAppConfig { bool MinimizeToTray { get; set; } int ThumbnailRefreshPeriod { get; set; } - double ThumbnailsOpacity { get; set; } + double ThumbnailOpacity { get; set; } bool EnableClientLayoutTracking { get; set; } bool HideActiveClientThumbnail { get; set; } @@ -20,13 +20,16 @@ namespace EveOPreview.Configuration Size ThumbnailMinimumSize { get; set; } Size ThumbnailMaximumSize { get; set; } - bool EnableThumbnailZoom { get; set; } + bool ThumbnailZoomEnabled { get; set; } int ThumbnailZoomFactor { get; set; } ZoomAnchor ThumbnailZoomAnchor { get; set; } bool ShowThumbnailOverlays { get; set; } bool ShowThumbnailFrames { get; set; } + bool EnableActiveClientHighlight { get; set; } + Color ActiveClientHighlightColor { get; set; } + Point GetThumbnailLocation(string currentClient, string activeClient, Point defaultLocation); void SetThumbnailLocation(string currentClient, string activeClient, Point location); @@ -35,5 +38,7 @@ namespace EveOPreview.Configuration Keys GetClientHotkey(string currentClient); void SetClientHotkey(string currentClient, Keys hotkey); + + void ApplyRestrictions(); } } \ No newline at end of file diff --git a/Eve-O-Preview/DwmAPI/DwmApiNativeMethods.cs b/Eve-O-Preview/DwmAPI/WindowManagerNativeMethods.cs similarity index 97% rename from Eve-O-Preview/DwmAPI/DwmApiNativeMethods.cs rename to Eve-O-Preview/DwmAPI/WindowManagerNativeMethods.cs index e3c663f..66899eb 100644 --- a/Eve-O-Preview/DwmAPI/DwmApiNativeMethods.cs +++ b/Eve-O-Preview/DwmAPI/WindowManagerNativeMethods.cs @@ -5,7 +5,7 @@ using System.Drawing; namespace EveOPreview { // Desktop Windows Manager APIs - static class DwmApiNativeMethods + static class WindowManagerNativeMethods { [DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow(); diff --git a/Eve-O-Preview/Eve-O-Preview.csproj b/Eve-O-Preview/Eve-O-Preview.csproj index 82a281f..ca46da0 100644 --- a/Eve-O-Preview/Eve-O-Preview.csproj +++ b/Eve-O-Preview/Eve-O-Preview.csproj @@ -97,7 +97,7 @@ - + @@ -118,7 +118,7 @@ - + @@ -167,7 +167,7 @@ ThumbnailView.cs - + diff --git a/Eve-O-Preview/Presentation/IThumbnailManager.cs b/Eve-O-Preview/Presentation/IThumbnailManager.cs index 24ffea0..4b54235 100644 --- a/Eve-O-Preview/Presentation/IThumbnailManager.cs +++ b/Eve-O-Preview/Presentation/IThumbnailManager.cs @@ -11,7 +11,6 @@ namespace EveOPreview.UI void SetThumbnailState(IntPtr thumbnailId, bool hideAlways); void SetThumbnailsSize(Size size); - void RefreshThumbnails(); void SetupThumbnailFrames(); Action> ThumbnailsAdded { get; set; } diff --git a/Eve-O-Preview/Presentation/MainPresenter.cs b/Eve-O-Preview/Presentation/MainPresenter.cs index d9e4a9e..12dad20 100644 --- a/Eve-O-Preview/Presentation/MainPresenter.cs +++ b/Eve-O-Preview/Presentation/MainPresenter.cs @@ -13,7 +13,7 @@ namespace EveOPreview.UI #endregion #region Private fields - private readonly IApplicationConfiguration _configuration; + private readonly IAppConfig _configuration; private readonly IConfigurationStorage _configurationStorage; private readonly IThumbnailDescriptionViewFactory _thumbnailDescriptionViewFactory; private readonly IDictionary _thumbnailDescriptionViews; @@ -22,7 +22,7 @@ namespace EveOPreview.UI private bool _exitApplication; #endregion - public MainPresenter(IApplicationController controller, IMainView view, IApplicationConfiguration configuration, IConfigurationStorage configurationStorage, + public MainPresenter(IApplicationController controller, IMainView view, IAppConfig configuration, IConfigurationStorage configurationStorage, IThumbnailManager thumbnailManager, IThumbnailDescriptionViewFactory thumbnailDescriptionViewFactory) : base(controller, view) { @@ -98,52 +98,55 @@ namespace EveOPreview.UI this.View.MinimizeToTray = this._configuration.MinimizeToTray; - this.View.ThumbnailsOpacity = this._configuration.ThumbnailsOpacity; + this.View.ThumbnailOpacity = this._configuration.ThumbnailOpacity; this.View.EnableClientLayoutTracking = this._configuration.EnableClientLayoutTracking; this.View.HideActiveClientThumbnail = this._configuration.HideActiveClientThumbnail; this.View.ShowThumbnailsAlwaysOnTop = this._configuration.ShowThumbnailsAlwaysOnTop; this.View.HideThumbnailsOnLostFocus = this._configuration.HideThumbnailsOnLostFocus; - this.View.EnablePerClientThumbnailsLayouts = this._configuration.EnablePerClientThumbnailLayouts; + this.View.EnablePerClientThumbnailLayouts = this._configuration.EnablePerClientThumbnailLayouts; this.View.SetThumbnailSizeLimitations(this._configuration.ThumbnailMinimumSize, this._configuration.ThumbnailMaximumSize); this.View.ThumbnailSize = this._configuration.ThumbnailSize; - this.View.EnableThumbnailZoom = this._configuration.EnableThumbnailZoom; + this.View.EnableThumbnailZoom = this._configuration.ThumbnailZoomEnabled; this.View.ThumbnailZoomFactor = this._configuration.ThumbnailZoomFactor; this.View.ThumbnailZoomAnchor = ViewZoomAnchorConverter.Convert(this._configuration.ThumbnailZoomAnchor); this.View.ShowThumbnailOverlays = this._configuration.ShowThumbnailOverlays; this.View.ShowThumbnailFrames = this._configuration.ShowThumbnailFrames; + this.View.EnableActiveClientHighlight = this._configuration.EnableActiveClientHighlight; + this.View.ActiveClientHighlightColor = this._configuration.ActiveClientHighlightColor; } private void SaveApplicationSettings() { this._configuration.MinimizeToTray = this.View.MinimizeToTray; - this._configuration.ThumbnailsOpacity = (float)this.View.ThumbnailsOpacity; + this._configuration.ThumbnailOpacity = (float)this.View.ThumbnailOpacity; this._configuration.EnableClientLayoutTracking = this.View.EnableClientLayoutTracking; this._configuration.HideActiveClientThumbnail = this.View.HideActiveClientThumbnail; this._configuration.ShowThumbnailsAlwaysOnTop = this.View.ShowThumbnailsAlwaysOnTop; this._configuration.HideThumbnailsOnLostFocus = this.View.HideThumbnailsOnLostFocus; - this._configuration.EnablePerClientThumbnailLayouts = this.View.EnablePerClientThumbnailsLayouts; + this._configuration.EnablePerClientThumbnailLayouts = this.View.EnablePerClientThumbnailLayouts; this._configuration.ThumbnailSize = this.View.ThumbnailSize; - this._configuration.EnableThumbnailZoom = this.View.EnableThumbnailZoom; + this._configuration.ThumbnailZoomEnabled = this.View.EnableThumbnailZoom; this._configuration.ThumbnailZoomFactor = this.View.ThumbnailZoomFactor; this._configuration.ThumbnailZoomAnchor = ViewZoomAnchorConverter.Convert(this.View.ThumbnailZoomAnchor); this._configuration.ShowThumbnailOverlays = this.View.ShowThumbnailOverlays; this._configuration.ShowThumbnailFrames = this.View.ShowThumbnailFrames; + this._configuration.EnableActiveClientHighlight = this.View.EnableActiveClientHighlight; + this._configuration.ActiveClientHighlightColor = this.View.ActiveClientHighlightColor; this._configurationStorage.Save(); this.View.RefreshZoomSettings(); this._thumbnailManager.SetupThumbnailFrames(); - this._thumbnailManager.RefreshThumbnails(); } private void ThumbnailsAdded(IList thumbnails) diff --git a/Eve-O-Preview/Presentation/ThumbnailManager.cs b/Eve-O-Preview/Presentation/ThumbnailManager.cs index 414bb03..0753373 100644 --- a/Eve-O-Preview/Presentation/ThumbnailManager.cs +++ b/Eve-O-Preview/Presentation/ThumbnailManager.cs @@ -11,11 +11,11 @@ namespace EveOPreview.UI { #region Private constants private const string ClientProcessName = "ExeFile"; + private const string DefaultClientTitle = "EVE"; #endregion #region Private fields - private readonly IApplicationConfiguration _configuration; - private readonly IConfigurationStorage _configurationStorage; + private readonly IAppConfig _configuration; private readonly DispatcherTimer _thumbnailUpdateTimer; private readonly IThumbnailViewFactory _thumbnailViewFactory; private readonly Dictionary _thumbnailViews; @@ -27,14 +27,13 @@ namespace EveOPreview.UI private bool _isHoverEffectActive; #endregion - public ThumbnailManager(IApplicationConfiguration configuration, IConfigurationStorage configurationStorage, IThumbnailViewFactory factory) + public ThumbnailManager(IAppConfig configuration, IThumbnailViewFactory factory) { this._configuration = configuration; - this._configurationStorage = configurationStorage; this._thumbnailViewFactory = factory; this._activeClientHandle = (IntPtr)0; - this._activeClientTitle = "EVE"; + this._activeClientTitle = ThumbnailManager.DefaultClientTitle; this.EnableViewEvents(); this._isHoverEffectActive = false; @@ -93,10 +92,10 @@ namespace EveOPreview.UI this.EnableViewEvents(); } - public void RefreshThumbnails() + private void RefreshThumbnails() { - IntPtr foregroundWindowHandle = DwmApiNativeMethods.GetForegroundWindow(); - Boolean hideAllThumbnails = (this._configuration.HideThumbnailsOnLostFocus && this.IsNonClientWindowActive(foregroundWindowHandle)) || !DwmApiNativeMethods.DwmIsCompositionEnabled(); + IntPtr foregroundWindowHandle = WindowManagerNativeMethods.GetForegroundWindow(); + Boolean hideAllThumbnails = (this._configuration.HideThumbnailsOnLostFocus && this.IsNonClientWindowActive(foregroundWindowHandle)) || !WindowManagerNativeMethods.DwmIsCompositionEnabled(); this.DisableViewEvents(); @@ -123,16 +122,23 @@ namespace EveOPreview.UI continue; } + // No need to update Thumbnails while one of them is highlighted if (!this._isHoverEffectActive) { - // No need to move Thumbnails while one of them is highlighted - view.ThumbnailLocation = this._configuration.GetThumbnailLocation(view.Title, this._activeClientTitle, view.ThumbnailLocation); - view.SetOpacity(this._configuration.ThumbnailsOpacity); + // Do not even move thumbnails with default caption + if (view.Title != ThumbnailManager.DefaultClientTitle) + { + view.ThumbnailLocation = this._configuration.GetThumbnailLocation(view.Title, this._activeClientTitle, view.ThumbnailLocation); + } + + view.SetOpacity(this._configuration.ThumbnailOpacity); view.SetTopMost(this._configuration.ShowThumbnailsAlwaysOnTop); } view.IsOverlayEnabled = this._configuration.ShowThumbnailOverlays; + view.SetHighlight(this._configuration.EnableActiveClientHighlight && (view.Id == this._activeClientHandle), this._configuration.ActiveClientHighlightColor); + if (!view.IsActive) { view.Show(); @@ -184,7 +190,7 @@ namespace EveOPreview.UI Process[] clientProcesses = ThumbnailManager.GetClientProcesses(); List processHandles = new List(clientProcesses.Length); - IntPtr foregroundWindowHandle = DwmApiNativeMethods.GetForegroundWindow(); + IntPtr foregroundWindowHandle = WindowManagerNativeMethods.GetForegroundWindow(); List viewsAdded = new List(); List viewsUpdated = new List(); @@ -284,14 +290,33 @@ namespace EveOPreview.UI this._isHoverEffectActive = true; - IThumbnailView view = this._thumbnailViews[id]; + IThumbnailView focusedView = null; - view.SetTopMost(true); - view.SetOpacity(1.0); - - if (this._configuration.EnableThumbnailZoom) + foreach (KeyValuePair valuePair in this._thumbnailViews) { - this.ThumbnailZoomIn(view); + IThumbnailView view = valuePair.Value; + + if (view.Id != id) + { + view.SetTopMost(false); + } + else + { + focusedView = view; + } + } + + if (focusedView == null) + { + return; // This should neve happen! + } + + focusedView.SetTopMost(true); + focusedView.SetOpacity(1.0); + + if (this._configuration.ThumbnailZoomEnabled) + { + this.ThumbnailZoomIn(focusedView); } } @@ -304,30 +329,32 @@ namespace EveOPreview.UI IThumbnailView view = this._thumbnailViews[id]; - if (this._configuration.EnableThumbnailZoom) + if (this._configuration.ThumbnailZoomEnabled) { this.ThumbnailZoomOut(view); } - view.SetOpacity(this._configuration.ThumbnailsOpacity); + view.SetOpacity(this._configuration.ThumbnailOpacity); this._isHoverEffectActive = false; } private void ThumbnailActivated(IntPtr id) { - DwmApiNativeMethods.SetForegroundWindow(id); - - int style = DwmApiNativeMethods.GetWindowLong(id, DwmApiNativeMethods.GWL_STYLE); - // If the window was minimized then its thumbnail should be reset - if ((style & DwmApiNativeMethods.WS_MINIMIZE) == DwmApiNativeMethods.WS_MINIMIZE) + IThumbnailView view; + if (this._thumbnailViews.TryGetValue(id, out view)) { - DwmApiNativeMethods.ShowWindowAsync(id, DwmApiNativeMethods.SW_SHOWNORMAL); - IThumbnailView view; - if (this._thumbnailViews.TryGetValue(id, out view)) - { - view.Refresh(true); - } + this._activeClientHandle = view.Id; + this._activeClientTitle = view.Title; + } + + WindowManagerNativeMethods.SetForegroundWindow(id); + + int style = WindowManagerNativeMethods.GetWindowLong(id, WindowManagerNativeMethods.GWL_STYLE); + // If the window was minimized then its thumbnail should be reset + if ((style & WindowManagerNativeMethods.WS_MINIMIZE) == WindowManagerNativeMethods.WS_MINIMIZE) + { + WindowManagerNativeMethods.ShowWindowAsync(id, WindowManagerNativeMethods.SW_SHOWNORMAL); } if (this._configuration.EnableClientLayoutTracking) @@ -337,7 +364,7 @@ namespace EveOPreview.UI this.RefreshThumbnails(); - this._configurationStorage.Save(); + view?.Refresh(true); } private void ThumbnailViewResized(IntPtr id) @@ -418,7 +445,7 @@ namespace EveOPreview.UI return; } - DwmApiNativeMethods.MoveWindow(clientHandle, clientLayout.X, clientLayout.Y, clientLayout.Width, clientLayout.Height, true); + WindowManagerNativeMethods.MoveWindow(clientHandle, clientLayout.X, clientLayout.Y, clientLayout.Width, clientLayout.Height, true); } private void UpdateClientLayouts() @@ -428,7 +455,7 @@ namespace EveOPreview.UI foreach (Process process in clientProcesses) { RECT rect; - DwmApiNativeMethods.GetWindowRect(process.MainWindowHandle, out rect); + WindowManagerNativeMethods.GetWindowRect(process.MainWindowHandle, out rect); int left = Math.Abs(rect.Left); int right = Math.Abs(rect.Right); diff --git a/Eve-O-Preview/Program.cs b/Eve-O-Preview/Program.cs index cf7d7e8..da22a50 100644 --- a/Eve-O-Preview/Program.cs +++ b/Eve-O-Preview/Program.cs @@ -29,7 +29,7 @@ namespace EveOPreview .RegisterService() .RegisterService() .RegisterService() - .RegisterInstance(new ApplicationConfiguration()); + .RegisterInstance(new AppConfig()); controller.Run(); } diff --git a/Eve-O-Preview/Properties/AssemblyInfo.cs b/Eve-O-Preview/Properties/AssemblyInfo.cs index e3ef10c..b479f9f 100644 --- a/Eve-O-Preview/Properties/AssemblyInfo.cs +++ b/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("2.0.1.0")] -[assembly: AssemblyFileVersion("2.0.1.0")] +[assembly: AssemblyVersion("2.1.0.0")] +[assembly: AssemblyFileVersion("2.1.0.0")] [assembly: CLSCompliant(true)] \ No newline at end of file diff --git a/Eve-O-Preview/UI/Implementation/MainForm.Designer.cs b/Eve-O-Preview/UI/Implementation/MainForm.Designer.cs index 179deda..bbf116b 100644 --- a/Eve-O-Preview/UI/Implementation/MainForm.Designer.cs +++ b/Eve-O-Preview/UI/Implementation/MainForm.Designer.cs @@ -34,21 +34,21 @@ namespace EveOPreview.UI System.Windows.Forms.Label OpacityLabel; System.Windows.Forms.ToolStripMenuItem RestoreWindowMenuItem; System.Windows.Forms.ToolStripMenuItem ExitMenuItem; - System.Windows.Forms.FlowLayoutPanel ContentFlowLayoutPanel; - System.Windows.Forms.Panel OpacityPanel; - System.Windows.Forms.Panel ResizeOptionsPanel; + System.Windows.Forms.Panel MainOptionsPanel; + System.Windows.Forms.Panel ThumbnailSizePanel; System.Windows.Forms.Label HeigthLabel; System.Windows.Forms.Label WidthLabel; System.Windows.Forms.Panel ZoomOptionsPanel; System.Windows.Forms.Label ZoomFactorLabel; System.Windows.Forms.Label ZoomAnchorLabel; - System.Windows.Forms.Panel ThumbnailsListPanel; + System.Windows.Forms.Panel ThumbnailListPanel; System.Windows.Forms.Label ThumbnailsListLabel; System.Windows.Forms.ToolStripMenuItem TitleMenuItem; System.Windows.Forms.ToolStripSeparator SeparatorMenuItem; + System.Windows.Forms.Panel OverlayOptionsPanel; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.ThumbnailOpacityTrackBar = new System.Windows.Forms.TrackBar(); this.MinimizeToTrayCheckBox = new System.Windows.Forms.CheckBox(); - this.ThumbnailsOpacityScrollBar = new System.Windows.Forms.HScrollBar(); this.EnableClientLayoutTrackingCheckBox = new System.Windows.Forms.CheckBox(); this.HideActiveClientThumbnailCheckBox = new System.Windows.Forms.CheckBox(); this.ShowThumbnailsAlwaysOnTopCheckBox = new System.Windows.Forms.CheckBox(); @@ -68,43 +68,47 @@ namespace EveOPreview.UI this.ZoomAanchorSWRadioButton = new System.Windows.Forms.RadioButton(); this.EnableThumbnailZoomCheckBox = new System.Windows.Forms.CheckBox(); this.ThumbnailZoomFactorNumericEdit = new System.Windows.Forms.NumericUpDown(); + this.ThumbnailsList = new System.Windows.Forms.CheckedListBox(); + this.HighlightColorLabel = new System.Windows.Forms.Label(); + this.ActiveClientHighlightColorButton = new System.Windows.Forms.Panel(); + this.EnableActiveClientHighlightCheckBox = new System.Windows.Forms.CheckBox(); this.ShowThumbnailOverlaysCheckBox = new System.Windows.Forms.CheckBox(); this.ShowThumbnailFramesCheckBox = new System.Windows.Forms.CheckBox(); - this.ThumbnailsList = new System.Windows.Forms.CheckedListBox(); this.ForumLinkLabel = new System.Windows.Forms.LinkLabel(); this.NotifyIcon = new System.Windows.Forms.NotifyIcon(this.components); this.TrayMenu = new System.Windows.Forms.ContextMenuStrip(this.components); OpacityLabel = new System.Windows.Forms.Label(); RestoreWindowMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - ContentFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel(); - OpacityPanel = new System.Windows.Forms.Panel(); - ResizeOptionsPanel = new System.Windows.Forms.Panel(); + MainOptionsPanel = new System.Windows.Forms.Panel(); + ThumbnailSizePanel = new System.Windows.Forms.Panel(); HeigthLabel = new System.Windows.Forms.Label(); WidthLabel = new System.Windows.Forms.Label(); ZoomOptionsPanel = new System.Windows.Forms.Panel(); ZoomFactorLabel = new System.Windows.Forms.Label(); ZoomAnchorLabel = new System.Windows.Forms.Label(); - ThumbnailsListPanel = new System.Windows.Forms.Panel(); + ThumbnailListPanel = new System.Windows.Forms.Panel(); ThumbnailsListLabel = new System.Windows.Forms.Label(); TitleMenuItem = new System.Windows.Forms.ToolStripMenuItem(); SeparatorMenuItem = new System.Windows.Forms.ToolStripSeparator(); - ContentFlowLayoutPanel.SuspendLayout(); - OpacityPanel.SuspendLayout(); - ResizeOptionsPanel.SuspendLayout(); + OverlayOptionsPanel = new System.Windows.Forms.Panel(); + MainOptionsPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ThumbnailOpacityTrackBar)).BeginInit(); + ThumbnailSizePanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ThumbnailsWidthNumericEdit)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ThumbnailsHeightNumericEdit)).BeginInit(); ZoomOptionsPanel.SuspendLayout(); this.ZoomAnchorPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ThumbnailZoomFactorNumericEdit)).BeginInit(); - ThumbnailsListPanel.SuspendLayout(); + ThumbnailListPanel.SuspendLayout(); + OverlayOptionsPanel.SuspendLayout(); this.TrayMenu.SuspendLayout(); this.SuspendLayout(); // // OpacityLabel // OpacityLabel.AutoSize = true; - OpacityLabel.Location = new System.Drawing.Point(2, 5); + OpacityLabel.Location = new System.Drawing.Point(0, 23); OpacityLabel.Name = "OpacityLabel"; OpacityLabel.Size = new System.Drawing.Size(43, 13); OpacityLabel.TabIndex = 0; @@ -124,27 +128,37 @@ namespace EveOPreview.UI ExitMenuItem.Text = "Exit"; ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItemClick_Handler); // - // ContentFlowLayoutPanel + // MainOptionsPanel // - ContentFlowLayoutPanel.BackColor = System.Drawing.SystemColors.Control; - ContentFlowLayoutPanel.Controls.Add(this.MinimizeToTrayCheckBox); - ContentFlowLayoutPanel.Controls.Add(OpacityPanel); - ContentFlowLayoutPanel.Controls.Add(this.EnableClientLayoutTrackingCheckBox); - ContentFlowLayoutPanel.Controls.Add(this.HideActiveClientThumbnailCheckBox); - ContentFlowLayoutPanel.Controls.Add(this.ShowThumbnailsAlwaysOnTopCheckBox); - ContentFlowLayoutPanel.Controls.Add(this.HideThumbnailsOnLostFocusCheckBox); - ContentFlowLayoutPanel.Controls.Add(this.EnablePerClientThumbnailsLayoutsCheckBox); - ContentFlowLayoutPanel.Controls.Add(ResizeOptionsPanel); - ContentFlowLayoutPanel.Controls.Add(ZoomOptionsPanel); - ContentFlowLayoutPanel.Controls.Add(this.ShowThumbnailOverlaysCheckBox); - ContentFlowLayoutPanel.Controls.Add(this.ShowThumbnailFramesCheckBox); - ContentFlowLayoutPanel.Controls.Add(ThumbnailsListPanel); - ContentFlowLayoutPanel.Controls.Add(this.ForumLinkLabel); - ContentFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - ContentFlowLayoutPanel.Location = new System.Drawing.Point(0, 0); - ContentFlowLayoutPanel.Name = "ContentFlowLayoutPanel"; - ContentFlowLayoutPanel.Size = new System.Drawing.Size(252, 481); - ContentFlowLayoutPanel.TabIndex = 25; + MainOptionsPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + MainOptionsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + MainOptionsPanel.Controls.Add(this.ThumbnailOpacityTrackBar); + MainOptionsPanel.Controls.Add(this.MinimizeToTrayCheckBox); + MainOptionsPanel.Controls.Add(this.EnableClientLayoutTrackingCheckBox); + MainOptionsPanel.Controls.Add(this.HideActiveClientThumbnailCheckBox); + MainOptionsPanel.Controls.Add(this.ShowThumbnailsAlwaysOnTopCheckBox); + MainOptionsPanel.Controls.Add(this.HideThumbnailsOnLostFocusCheckBox); + MainOptionsPanel.Controls.Add(this.EnablePerClientThumbnailsLayoutsCheckBox); + MainOptionsPanel.Controls.Add(OpacityLabel); + MainOptionsPanel.Location = new System.Drawing.Point(3, 3); + MainOptionsPanel.Name = "MainOptionsPanel"; + MainOptionsPanel.Size = new System.Drawing.Size(264, 164); + MainOptionsPanel.TabIndex = 0; + // + // ThumbnailOpacityTrackBar + // + this.ThumbnailOpacityTrackBar.AutoSize = false; + this.ThumbnailOpacityTrackBar.LargeChange = 10; + this.ThumbnailOpacityTrackBar.Location = new System.Drawing.Point(51, 22); + this.ThumbnailOpacityTrackBar.Maximum = 100; + this.ThumbnailOpacityTrackBar.Minimum = 20; + this.ThumbnailOpacityTrackBar.Name = "ThumbnailOpacityTrackBar"; + this.ThumbnailOpacityTrackBar.Size = new System.Drawing.Size(208, 22); + this.ThumbnailOpacityTrackBar.TabIndex = 1; + this.ThumbnailOpacityTrackBar.TickFrequency = 10; + this.ThumbnailOpacityTrackBar.Value = 20; + this.ThumbnailOpacityTrackBar.ValueChanged += new System.EventHandler(this.OptionChanged_Handler); // // MinimizeToTrayCheckBox // @@ -152,37 +166,18 @@ namespace EveOPreview.UI this.MinimizeToTrayCheckBox.Location = new System.Drawing.Point(3, 3); this.MinimizeToTrayCheckBox.Name = "MinimizeToTrayCheckBox"; this.MinimizeToTrayCheckBox.Size = new System.Drawing.Size(139, 17); - this.MinimizeToTrayCheckBox.TabIndex = 34; + this.MinimizeToTrayCheckBox.TabIndex = 0; this.MinimizeToTrayCheckBox.Text = "Minimize to System Tray"; this.MinimizeToTrayCheckBox.UseVisualStyleBackColor = true; this.MinimizeToTrayCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); // - // OpacityPanel - // - OpacityPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - OpacityPanel.Controls.Add(this.ThumbnailsOpacityScrollBar); - OpacityPanel.Controls.Add(OpacityLabel); - OpacityPanel.Location = new System.Drawing.Point(3, 26); - OpacityPanel.Name = "OpacityPanel"; - OpacityPanel.Size = new System.Drawing.Size(246, 26); - OpacityPanel.TabIndex = 33; - // - // ThumbnailsOpacityScrollBar - // - this.ThumbnailsOpacityScrollBar.Location = new System.Drawing.Point(48, 1); - this.ThumbnailsOpacityScrollBar.Maximum = 120; - this.ThumbnailsOpacityScrollBar.Name = "ThumbnailsOpacityScrollBar"; - this.ThumbnailsOpacityScrollBar.Size = new System.Drawing.Size(195, 23); - this.ThumbnailsOpacityScrollBar.TabIndex = 1; - this.ThumbnailsOpacityScrollBar.Scroll += new System.Windows.Forms.ScrollEventHandler(this.OptionChanged_Handler); - // // EnableClientLayoutTrackingCheckBox // this.EnableClientLayoutTrackingCheckBox.AutoSize = true; - this.EnableClientLayoutTrackingCheckBox.Location = new System.Drawing.Point(3, 58); + this.EnableClientLayoutTrackingCheckBox.Location = new System.Drawing.Point(3, 50); this.EnableClientLayoutTrackingCheckBox.Name = "EnableClientLayoutTrackingCheckBox"; this.EnableClientLayoutTrackingCheckBox.Size = new System.Drawing.Size(127, 17); - this.EnableClientLayoutTrackingCheckBox.TabIndex = 32; + this.EnableClientLayoutTrackingCheckBox.TabIndex = 2; this.EnableClientLayoutTrackingCheckBox.Text = "Track client locations"; this.EnableClientLayoutTrackingCheckBox.UseVisualStyleBackColor = true; this.EnableClientLayoutTrackingCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -192,10 +187,10 @@ namespace EveOPreview.UI this.HideActiveClientThumbnailCheckBox.AutoSize = true; this.HideActiveClientThumbnailCheckBox.Checked = true; this.HideActiveClientThumbnailCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.HideActiveClientThumbnailCheckBox.Location = new System.Drawing.Point(3, 81); + this.HideActiveClientThumbnailCheckBox.Location = new System.Drawing.Point(3, 73); this.HideActiveClientThumbnailCheckBox.Name = "HideActiveClientThumbnailCheckBox"; this.HideActiveClientThumbnailCheckBox.Size = new System.Drawing.Size(184, 17); - this.HideActiveClientThumbnailCheckBox.TabIndex = 1; + this.HideActiveClientThumbnailCheckBox.TabIndex = 3; this.HideActiveClientThumbnailCheckBox.Text = "Hide preview of active EVE client"; this.HideActiveClientThumbnailCheckBox.UseVisualStyleBackColor = true; this.HideActiveClientThumbnailCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -205,11 +200,11 @@ namespace EveOPreview.UI this.ShowThumbnailsAlwaysOnTopCheckBox.AutoSize = true; this.ShowThumbnailsAlwaysOnTopCheckBox.Checked = true; this.ShowThumbnailsAlwaysOnTopCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.ShowThumbnailsAlwaysOnTopCheckBox.Location = new System.Drawing.Point(3, 104); + this.ShowThumbnailsAlwaysOnTopCheckBox.Location = new System.Drawing.Point(3, 96); this.ShowThumbnailsAlwaysOnTopCheckBox.Name = "ShowThumbnailsAlwaysOnTopCheckBox"; this.ShowThumbnailsAlwaysOnTopCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No; this.ShowThumbnailsAlwaysOnTopCheckBox.Size = new System.Drawing.Size(137, 17); - this.ShowThumbnailsAlwaysOnTopCheckBox.TabIndex = 8; + this.ShowThumbnailsAlwaysOnTopCheckBox.TabIndex = 4; this.ShowThumbnailsAlwaysOnTopCheckBox.Text = "Previews always on top"; this.ShowThumbnailsAlwaysOnTopCheckBox.UseVisualStyleBackColor = true; this.ShowThumbnailsAlwaysOnTopCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -219,10 +214,10 @@ namespace EveOPreview.UI this.HideThumbnailsOnLostFocusCheckBox.AutoSize = true; this.HideThumbnailsOnLostFocusCheckBox.Checked = true; this.HideThumbnailsOnLostFocusCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.HideThumbnailsOnLostFocusCheckBox.Location = new System.Drawing.Point(3, 127); + this.HideThumbnailsOnLostFocusCheckBox.Location = new System.Drawing.Point(3, 119); this.HideThumbnailsOnLostFocusCheckBox.Name = "HideThumbnailsOnLostFocusCheckBox"; this.HideThumbnailsOnLostFocusCheckBox.Size = new System.Drawing.Size(234, 17); - this.HideThumbnailsOnLostFocusCheckBox.TabIndex = 2; + this.HideThumbnailsOnLostFocusCheckBox.TabIndex = 5; this.HideThumbnailsOnLostFocusCheckBox.Text = "Hide previews when EVE client is not active"; this.HideThumbnailsOnLostFocusCheckBox.UseVisualStyleBackColor = true; this.HideThumbnailsOnLostFocusCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -232,30 +227,32 @@ namespace EveOPreview.UI this.EnablePerClientThumbnailsLayoutsCheckBox.AutoSize = true; this.EnablePerClientThumbnailsLayoutsCheckBox.Checked = true; this.EnablePerClientThumbnailsLayoutsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.EnablePerClientThumbnailsLayoutsCheckBox.Location = new System.Drawing.Point(3, 150); + this.EnablePerClientThumbnailsLayoutsCheckBox.Location = new System.Drawing.Point(3, 142); this.EnablePerClientThumbnailsLayoutsCheckBox.Name = "EnablePerClientThumbnailsLayoutsCheckBox"; this.EnablePerClientThumbnailsLayoutsCheckBox.Size = new System.Drawing.Size(185, 17); - this.EnablePerClientThumbnailsLayoutsCheckBox.TabIndex = 3; + this.EnablePerClientThumbnailsLayoutsCheckBox.TabIndex = 6; this.EnablePerClientThumbnailsLayoutsCheckBox.Text = "Unique layout for each EVE client"; this.EnablePerClientThumbnailsLayoutsCheckBox.UseVisualStyleBackColor = true; this.EnablePerClientThumbnailsLayoutsCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); // - // ResizeOptionsPanel + // ThumbnailSizePanel // - ResizeOptionsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - ResizeOptionsPanel.Controls.Add(HeigthLabel); - ResizeOptionsPanel.Controls.Add(WidthLabel); - ResizeOptionsPanel.Controls.Add(this.ThumbnailsWidthNumericEdit); - ResizeOptionsPanel.Controls.Add(this.ThumbnailsHeightNumericEdit); - ResizeOptionsPanel.Location = new System.Drawing.Point(3, 173); - ResizeOptionsPanel.Name = "ResizeOptionsPanel"; - ResizeOptionsPanel.Size = new System.Drawing.Size(246, 28); - ResizeOptionsPanel.TabIndex = 26; + ThumbnailSizePanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + ThumbnailSizePanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + ThumbnailSizePanel.Controls.Add(HeigthLabel); + ThumbnailSizePanel.Controls.Add(WidthLabel); + ThumbnailSizePanel.Controls.Add(this.ThumbnailsWidthNumericEdit); + ThumbnailSizePanel.Controls.Add(this.ThumbnailsHeightNumericEdit); + ThumbnailSizePanel.Location = new System.Drawing.Point(3, 173); + ThumbnailSizePanel.Name = "ThumbnailSizePanel"; + ThumbnailSizePanel.Size = new System.Drawing.Size(264, 28); + ThumbnailSizePanel.TabIndex = 1; // // HeigthLabel // HeigthLabel.AutoSize = true; - HeigthLabel.Location = new System.Drawing.Point(152, 5); + HeigthLabel.Location = new System.Drawing.Point(150, 5); HeigthLabel.Name = "HeigthLabel"; HeigthLabel.Size = new System.Drawing.Size(38, 13); HeigthLabel.TabIndex = 14; @@ -264,7 +261,7 @@ namespace EveOPreview.UI // WidthLabel // WidthLabel.AutoSize = true; - WidthLabel.Location = new System.Drawing.Point(2, 5); + WidthLabel.Location = new System.Drawing.Point(0, 5); WidthLabel.Name = "WidthLabel"; WidthLabel.Size = new System.Drawing.Size(87, 13); WidthLabel.TabIndex = 13; @@ -276,24 +273,24 @@ namespace EveOPreview.UI this.ThumbnailsWidthNumericEdit.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.ThumbnailsWidthNumericEdit.CausesValidation = false; this.ThumbnailsWidthNumericEdit.Increment = new decimal(new int[] { - 10, - 0, - 0, - 0}); - this.ThumbnailsWidthNumericEdit.Location = new System.Drawing.Point(95, 3); + 10, + 0, + 0, + 0}); + this.ThumbnailsWidthNumericEdit.Location = new System.Drawing.Point(92, 3); this.ThumbnailsWidthNumericEdit.Maximum = new decimal(new int[] { - 999999, - 0, - 0, - 0}); + 999999, + 0, + 0, + 0}); this.ThumbnailsWidthNumericEdit.Name = "ThumbnailsWidthNumericEdit"; this.ThumbnailsWidthNumericEdit.Size = new System.Drawing.Size(48, 20); - this.ThumbnailsWidthNumericEdit.TabIndex = 11; + this.ThumbnailsWidthNumericEdit.TabIndex = 0; this.ThumbnailsWidthNumericEdit.Value = new decimal(new int[] { - 100, - 0, - 0, - 0}); + 100, + 0, + 0, + 0}); this.ThumbnailsWidthNumericEdit.ValueChanged += new System.EventHandler(this.ThumbnailSizeChanged_Handler); // // ThumbnailsHeightNumericEdit @@ -302,28 +299,30 @@ namespace EveOPreview.UI this.ThumbnailsHeightNumericEdit.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.ThumbnailsHeightNumericEdit.CausesValidation = false; this.ThumbnailsHeightNumericEdit.Increment = new decimal(new int[] { - 10, - 0, - 0, - 0}); - this.ThumbnailsHeightNumericEdit.Location = new System.Drawing.Point(196, 3); + 10, + 0, + 0, + 0}); + this.ThumbnailsHeightNumericEdit.Location = new System.Drawing.Point(217, 3); this.ThumbnailsHeightNumericEdit.Maximum = new decimal(new int[] { - 99999999, - 0, - 0, - 0}); + 99999999, + 0, + 0, + 0}); this.ThumbnailsHeightNumericEdit.Name = "ThumbnailsHeightNumericEdit"; this.ThumbnailsHeightNumericEdit.Size = new System.Drawing.Size(42, 20); - this.ThumbnailsHeightNumericEdit.TabIndex = 12; + this.ThumbnailsHeightNumericEdit.TabIndex = 1; this.ThumbnailsHeightNumericEdit.Value = new decimal(new int[] { - 70, - 0, - 0, - 0}); + 70, + 0, + 0, + 0}); this.ThumbnailsHeightNumericEdit.ValueChanged += new System.EventHandler(this.ThumbnailSizeChanged_Handler); // // ZoomOptionsPanel // + ZoomOptionsPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); ZoomOptionsPanel.BackColor = System.Drawing.SystemColors.Control; ZoomOptionsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; ZoomOptionsPanel.Controls.Add(ZoomFactorLabel); @@ -333,13 +332,13 @@ namespace EveOPreview.UI ZoomOptionsPanel.Controls.Add(this.ThumbnailZoomFactorNumericEdit); ZoomOptionsPanel.Location = new System.Drawing.Point(3, 207); ZoomOptionsPanel.Name = "ZoomOptionsPanel"; - ZoomOptionsPanel.Size = new System.Drawing.Size(246, 82); - ZoomOptionsPanel.TabIndex = 27; + ZoomOptionsPanel.Size = new System.Drawing.Size(264, 82); + ZoomOptionsPanel.TabIndex = 2; // // ZoomFactorLabel // ZoomFactorLabel.AutoSize = true; - ZoomFactorLabel.Location = new System.Drawing.Point(8, 43); + ZoomFactorLabel.Location = new System.Drawing.Point(0, 43); ZoomFactorLabel.Name = "ZoomFactorLabel"; ZoomFactorLabel.Size = new System.Drawing.Size(67, 13); ZoomFactorLabel.TabIndex = 29; @@ -356,10 +355,10 @@ namespace EveOPreview.UI this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorSRadioButton); this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorERadioButton); this.ZoomAnchorPanel.Controls.Add(this.ZoomAanchorSWRadioButton); - this.ZoomAnchorPanel.Location = new System.Drawing.Point(182, 21); + this.ZoomAnchorPanel.Location = new System.Drawing.Point(199, 20); this.ZoomAnchorPanel.Name = "ZoomAnchorPanel"; this.ZoomAnchorPanel.Size = new System.Drawing.Size(60, 57); - this.ZoomAnchorPanel.TabIndex = 28; + this.ZoomAnchorPanel.TabIndex = 2; // // ZoomAanchorNWRadioButton // @@ -367,7 +366,7 @@ namespace EveOPreview.UI this.ZoomAanchorNWRadioButton.Location = new System.Drawing.Point(3, 3); this.ZoomAanchorNWRadioButton.Name = "ZoomAanchorNWRadioButton"; this.ZoomAanchorNWRadioButton.Size = new System.Drawing.Size(14, 13); - this.ZoomAanchorNWRadioButton.TabIndex = 15; + this.ZoomAanchorNWRadioButton.TabIndex = 0; this.ZoomAanchorNWRadioButton.TabStop = true; this.ZoomAanchorNWRadioButton.UseVisualStyleBackColor = true; this.ZoomAanchorNWRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -378,7 +377,7 @@ namespace EveOPreview.UI this.ZoomAanchorNRadioButton.Location = new System.Drawing.Point(23, 3); this.ZoomAanchorNRadioButton.Name = "ZoomAanchorNRadioButton"; this.ZoomAanchorNRadioButton.Size = new System.Drawing.Size(14, 13); - this.ZoomAanchorNRadioButton.TabIndex = 16; + this.ZoomAanchorNRadioButton.TabIndex = 1; this.ZoomAanchorNRadioButton.TabStop = true; this.ZoomAanchorNRadioButton.UseVisualStyleBackColor = true; this.ZoomAanchorNRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -389,7 +388,7 @@ namespace EveOPreview.UI this.ZoomAanchorNERadioButton.Location = new System.Drawing.Point(43, 3); this.ZoomAanchorNERadioButton.Name = "ZoomAanchorNERadioButton"; this.ZoomAanchorNERadioButton.Size = new System.Drawing.Size(14, 13); - this.ZoomAanchorNERadioButton.TabIndex = 17; + this.ZoomAanchorNERadioButton.TabIndex = 2; this.ZoomAanchorNERadioButton.TabStop = true; this.ZoomAanchorNERadioButton.UseVisualStyleBackColor = true; this.ZoomAanchorNERadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -400,7 +399,7 @@ namespace EveOPreview.UI this.ZoomAanchorWRadioButton.Location = new System.Drawing.Point(3, 22); this.ZoomAanchorWRadioButton.Name = "ZoomAanchorWRadioButton"; this.ZoomAanchorWRadioButton.Size = new System.Drawing.Size(14, 13); - this.ZoomAanchorWRadioButton.TabIndex = 18; + this.ZoomAanchorWRadioButton.TabIndex = 3; this.ZoomAanchorWRadioButton.TabStop = true; this.ZoomAanchorWRadioButton.UseVisualStyleBackColor = true; this.ZoomAanchorWRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -411,7 +410,7 @@ namespace EveOPreview.UI this.ZoomAanchorSERadioButton.Location = new System.Drawing.Point(43, 41); this.ZoomAanchorSERadioButton.Name = "ZoomAanchorSERadioButton"; this.ZoomAanchorSERadioButton.Size = new System.Drawing.Size(14, 13); - this.ZoomAanchorSERadioButton.TabIndex = 23; + this.ZoomAanchorSERadioButton.TabIndex = 8; this.ZoomAanchorSERadioButton.TabStop = true; this.ZoomAanchorSERadioButton.UseVisualStyleBackColor = true; this.ZoomAanchorSERadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -422,7 +421,7 @@ namespace EveOPreview.UI this.ZoomAanchorCRadioButton.Location = new System.Drawing.Point(23, 22); this.ZoomAanchorCRadioButton.Name = "ZoomAanchorCRadioButton"; this.ZoomAanchorCRadioButton.Size = new System.Drawing.Size(14, 13); - this.ZoomAanchorCRadioButton.TabIndex = 19; + this.ZoomAanchorCRadioButton.TabIndex = 4; this.ZoomAanchorCRadioButton.TabStop = true; this.ZoomAanchorCRadioButton.UseVisualStyleBackColor = true; this.ZoomAanchorCRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -433,7 +432,7 @@ namespace EveOPreview.UI this.ZoomAanchorSRadioButton.Location = new System.Drawing.Point(23, 41); this.ZoomAanchorSRadioButton.Name = "ZoomAanchorSRadioButton"; this.ZoomAanchorSRadioButton.Size = new System.Drawing.Size(14, 13); - this.ZoomAanchorSRadioButton.TabIndex = 22; + this.ZoomAanchorSRadioButton.TabIndex = 7; this.ZoomAanchorSRadioButton.TabStop = true; this.ZoomAanchorSRadioButton.UseVisualStyleBackColor = true; this.ZoomAanchorSRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -444,7 +443,7 @@ namespace EveOPreview.UI this.ZoomAanchorERadioButton.Location = new System.Drawing.Point(43, 22); this.ZoomAanchorERadioButton.Name = "ZoomAanchorERadioButton"; this.ZoomAanchorERadioButton.Size = new System.Drawing.Size(14, 13); - this.ZoomAanchorERadioButton.TabIndex = 20; + this.ZoomAanchorERadioButton.TabIndex = 5; this.ZoomAanchorERadioButton.TabStop = true; this.ZoomAanchorERadioButton.UseVisualStyleBackColor = true; this.ZoomAanchorERadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -455,7 +454,7 @@ namespace EveOPreview.UI this.ZoomAanchorSWRadioButton.Location = new System.Drawing.Point(3, 41); this.ZoomAanchorSWRadioButton.Name = "ZoomAanchorSWRadioButton"; this.ZoomAanchorSWRadioButton.Size = new System.Drawing.Size(14, 13); - this.ZoomAanchorSWRadioButton.TabIndex = 21; + this.ZoomAanchorSWRadioButton.TabIndex = 6; this.ZoomAanchorSWRadioButton.TabStop = true; this.ZoomAanchorSWRadioButton.UseVisualStyleBackColor = true; this.ZoomAanchorSWRadioButton.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -463,7 +462,7 @@ namespace EveOPreview.UI // ZoomAnchorLabel // ZoomAnchorLabel.AutoSize = true; - ZoomAnchorLabel.Location = new System.Drawing.Point(138, 43); + ZoomAnchorLabel.Location = new System.Drawing.Point(150, 43); ZoomAnchorLabel.Name = "ZoomAnchorLabel"; ZoomAnchorLabel.Size = new System.Drawing.Size(41, 13); ZoomAnchorLabel.TabIndex = 30; @@ -474,11 +473,11 @@ namespace EveOPreview.UI this.EnableThumbnailZoomCheckBox.AutoSize = true; this.EnableThumbnailZoomCheckBox.Checked = true; this.EnableThumbnailZoomCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.EnableThumbnailZoomCheckBox.Location = new System.Drawing.Point(1, 5); + this.EnableThumbnailZoomCheckBox.Location = new System.Drawing.Point(3, 5); this.EnableThumbnailZoomCheckBox.Name = "EnableThumbnailZoomCheckBox"; this.EnableThumbnailZoomCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No; this.EnableThumbnailZoomCheckBox.Size = new System.Drawing.Size(98, 17); - this.EnableThumbnailZoomCheckBox.TabIndex = 13; + this.EnableThumbnailZoomCheckBox.TabIndex = 0; this.EnableThumbnailZoomCheckBox.Text = "Zoom on hover"; this.EnableThumbnailZoomCheckBox.UseVisualStyleBackColor = true; this.EnableThumbnailZoomCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); @@ -487,98 +486,64 @@ namespace EveOPreview.UI // this.ThumbnailZoomFactorNumericEdit.BackColor = System.Drawing.SystemColors.Window; this.ThumbnailZoomFactorNumericEdit.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.ThumbnailZoomFactorNumericEdit.Location = new System.Drawing.Point(81, 41); + this.ThumbnailZoomFactorNumericEdit.Location = new System.Drawing.Point(94, 41); this.ThumbnailZoomFactorNumericEdit.Maximum = new decimal(new int[] { - 10, - 0, - 0, - 0}); + 10, + 0, + 0, + 0}); this.ThumbnailZoomFactorNumericEdit.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); + 2, + 0, + 0, + 0}); this.ThumbnailZoomFactorNumericEdit.Name = "ThumbnailZoomFactorNumericEdit"; - this.ThumbnailZoomFactorNumericEdit.Size = new System.Drawing.Size(34, 20); - this.ThumbnailZoomFactorNumericEdit.TabIndex = 24; + this.ThumbnailZoomFactorNumericEdit.Size = new System.Drawing.Size(38, 20); + this.ThumbnailZoomFactorNumericEdit.TabIndex = 1; this.ThumbnailZoomFactorNumericEdit.Value = new decimal(new int[] { - 1, - 0, - 0, - 0}); + 2, + 0, + 0, + 0}); this.ThumbnailZoomFactorNumericEdit.ValueChanged += new System.EventHandler(this.OptionChanged_Handler); // - // ShowThumbnailOverlaysCheckBox + // ThumbnailListPanel // - this.ShowThumbnailOverlaysCheckBox.AutoSize = true; - this.ShowThumbnailOverlaysCheckBox.Checked = true; - this.ShowThumbnailOverlaysCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.ShowThumbnailOverlaysCheckBox.Location = new System.Drawing.Point(3, 295); - this.ShowThumbnailOverlaysCheckBox.Name = "ShowThumbnailOverlaysCheckBox"; - this.ShowThumbnailOverlaysCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.ShowThumbnailOverlaysCheckBox.Size = new System.Drawing.Size(90, 17); - this.ShowThumbnailOverlaysCheckBox.TabIndex = 14; - this.ShowThumbnailOverlaysCheckBox.Text = "Show overlay"; - this.ShowThumbnailOverlaysCheckBox.UseVisualStyleBackColor = true; - this.ShowThumbnailOverlaysCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); - // - // ShowThumbnailFramesCheckBox - // - this.ShowThumbnailFramesCheckBox.AutoSize = true; - this.ShowThumbnailFramesCheckBox.Checked = true; - this.ShowThumbnailFramesCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.ShowThumbnailFramesCheckBox.Location = new System.Drawing.Point(99, 295); - this.ShowThumbnailFramesCheckBox.Name = "ShowThumbnailFramesCheckBox"; - this.ShowThumbnailFramesCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.ShowThumbnailFramesCheckBox.Size = new System.Drawing.Size(127, 17); - this.ShowThumbnailFramesCheckBox.TabIndex = 9; - this.ShowThumbnailFramesCheckBox.Text = "Show preview frames"; - this.ShowThumbnailFramesCheckBox.UseVisualStyleBackColor = true; - this.ShowThumbnailFramesCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); - // - // ThumbnailsListPanel - // - ThumbnailsListPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - ThumbnailsListPanel.Controls.Add(this.ThumbnailsList); - ThumbnailsListPanel.Controls.Add(ThumbnailsListLabel); - ThumbnailsListPanel.Location = new System.Drawing.Point(3, 318); - ThumbnailsListPanel.Name = "ThumbnailsListPanel"; - ThumbnailsListPanel.Size = new System.Drawing.Size(246, 125); - ThumbnailsListPanel.TabIndex = 31; + ThumbnailListPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + ThumbnailListPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + ThumbnailListPanel.Controls.Add(this.ThumbnailsList); + ThumbnailListPanel.Controls.Add(ThumbnailsListLabel); + ThumbnailListPanel.Location = new System.Drawing.Point(3, 350); + ThumbnailListPanel.Name = "ThumbnailListPanel"; + ThumbnailListPanel.Size = new System.Drawing.Size(264, 125); + ThumbnailListPanel.TabIndex = 5; // // ThumbnailsList // + this.ThumbnailsList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.ThumbnailsList.BackColor = System.Drawing.SystemColors.Window; this.ThumbnailsList.BorderStyle = System.Windows.Forms.BorderStyle.None; this.ThumbnailsList.FormattingEnabled = true; this.ThumbnailsList.IntegralHeight = false; this.ThumbnailsList.Location = new System.Drawing.Point(3, 18); this.ThumbnailsList.Name = "ThumbnailsList"; - this.ThumbnailsList.Size = new System.Drawing.Size(240, 100); - this.ThumbnailsList.TabIndex = 28; + this.ThumbnailsList.Size = new System.Drawing.Size(256, 100); + this.ThumbnailsList.TabIndex = 0; this.ThumbnailsList.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.ThumbnailsList_ItemCheck_Handler); // // ThumbnailsListLabel // ThumbnailsListLabel.AutoSize = true; - ThumbnailsListLabel.Location = new System.Drawing.Point(3, 0); + ThumbnailsListLabel.Location = new System.Drawing.Point(0, 0); ThumbnailsListLabel.Name = "ThumbnailsListLabel"; ThumbnailsListLabel.Size = new System.Drawing.Size(162, 13); ThumbnailsListLabel.TabIndex = 29; ThumbnailsListLabel.Text = "Thumbnails (check to force hide)"; // - // ForumLinkLabel - // - this.ForumLinkLabel.AutoSize = true; - this.ForumLinkLabel.Location = new System.Drawing.Point(3, 446); - this.ForumLinkLabel.Name = "ForumLinkLabel"; - this.ForumLinkLabel.Size = new System.Drawing.Size(241, 26); - this.ForumLinkLabel.TabIndex = 10; - this.ForumLinkLabel.TabStop = true; - this.ForumLinkLabel.Text = "to be set from prresenter to be set from prresenter to be set from prresenter to " + - "be set from prresenter"; - this.ForumLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.ForumLinkLabelClicked_Handler); - // // TitleMenuItem // TitleMenuItem.Enabled = false; @@ -591,6 +556,94 @@ namespace EveOPreview.UI SeparatorMenuItem.Name = "SeparatorMenuItem"; SeparatorMenuItem.Size = new System.Drawing.Size(148, 6); // + // OverlayOptionsPanel + // + OverlayOptionsPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + OverlayOptionsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + OverlayOptionsPanel.Controls.Add(this.HighlightColorLabel); + OverlayOptionsPanel.Controls.Add(this.ActiveClientHighlightColorButton); + OverlayOptionsPanel.Controls.Add(this.EnableActiveClientHighlightCheckBox); + OverlayOptionsPanel.Controls.Add(this.ShowThumbnailOverlaysCheckBox); + OverlayOptionsPanel.Controls.Add(this.ShowThumbnailFramesCheckBox); + OverlayOptionsPanel.Location = new System.Drawing.Point(3, 295); + OverlayOptionsPanel.Name = "OverlayOptionsPanel"; + OverlayOptionsPanel.Size = new System.Drawing.Size(264, 49); + OverlayOptionsPanel.TabIndex = 3; + // + // HighlightColorLabel + // + this.HighlightColorLabel.AutoSize = true; + this.HighlightColorLabel.Location = new System.Drawing.Point(150, 28); + this.HighlightColorLabel.Name = "HighlightColorLabel"; + this.HighlightColorLabel.Size = new System.Drawing.Size(31, 13); + this.HighlightColorLabel.TabIndex = 19; + this.HighlightColorLabel.Text = "Color"; + // + // ActiveClientHighlightColorButton + // + this.ActiveClientHighlightColorButton.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ActiveClientHighlightColorButton.Location = new System.Drawing.Point(199, 27); + this.ActiveClientHighlightColorButton.Name = "ActiveClientHighlightColorButton"; + this.ActiveClientHighlightColorButton.Size = new System.Drawing.Size(60, 17); + this.ActiveClientHighlightColorButton.TabIndex = 3; + this.ActiveClientHighlightColorButton.Click += new System.EventHandler(this.ActiveClientHighlightColorButton_Click); + // + // EnableActiveClientHighlightCheckBox + // + this.EnableActiveClientHighlightCheckBox.AutoSize = true; + this.EnableActiveClientHighlightCheckBox.Checked = true; + this.EnableActiveClientHighlightCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.EnableActiveClientHighlightCheckBox.Location = new System.Drawing.Point(3, 27); + this.EnableActiveClientHighlightCheckBox.Name = "EnableActiveClientHighlightCheckBox"; + this.EnableActiveClientHighlightCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.EnableActiveClientHighlightCheckBox.Size = new System.Drawing.Size(127, 17); + this.EnableActiveClientHighlightCheckBox.TabIndex = 2; + this.EnableActiveClientHighlightCheckBox.Text = "Highlight active client"; + this.EnableActiveClientHighlightCheckBox.UseVisualStyleBackColor = true; + this.EnableActiveClientHighlightCheckBox.CheckStateChanged += new System.EventHandler(this.OptionChanged_Handler); + // + // ShowThumbnailOverlaysCheckBox + // + this.ShowThumbnailOverlaysCheckBox.AutoSize = true; + this.ShowThumbnailOverlaysCheckBox.Checked = true; + this.ShowThumbnailOverlaysCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.ShowThumbnailOverlaysCheckBox.Location = new System.Drawing.Point(3, 4); + this.ShowThumbnailOverlaysCheckBox.Name = "ShowThumbnailOverlaysCheckBox"; + this.ShowThumbnailOverlaysCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.ShowThumbnailOverlaysCheckBox.Size = new System.Drawing.Size(90, 17); + this.ShowThumbnailOverlaysCheckBox.TabIndex = 0; + this.ShowThumbnailOverlaysCheckBox.Text = "Show overlay"; + this.ShowThumbnailOverlaysCheckBox.UseVisualStyleBackColor = true; + this.ShowThumbnailOverlaysCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); + // + // ShowThumbnailFramesCheckBox + // + this.ShowThumbnailFramesCheckBox.AutoSize = true; + this.ShowThumbnailFramesCheckBox.Checked = true; + this.ShowThumbnailFramesCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.ShowThumbnailFramesCheckBox.Location = new System.Drawing.Point(153, 4); + this.ShowThumbnailFramesCheckBox.Name = "ShowThumbnailFramesCheckBox"; + this.ShowThumbnailFramesCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.ShowThumbnailFramesCheckBox.Size = new System.Drawing.Size(87, 17); + this.ShowThumbnailFramesCheckBox.TabIndex = 1; + this.ShowThumbnailFramesCheckBox.Text = "Show frames"; + this.ShowThumbnailFramesCheckBox.UseVisualStyleBackColor = true; + this.ShowThumbnailFramesCheckBox.CheckedChanged += new System.EventHandler(this.OptionChanged_Handler); + // + // ForumLinkLabel + // + this.ForumLinkLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.ForumLinkLabel.Location = new System.Drawing.Point(4, 478); + this.ForumLinkLabel.Name = "ForumLinkLabel"; + this.ForumLinkLabel.Size = new System.Drawing.Size(264, 33); + this.ForumLinkLabel.TabIndex = 0; + this.ForumLinkLabel.TabStop = true; + this.ForumLinkLabel.Text = "to be set from prresenter to be set from prresenter to be set from prresenter to " + + "be set from prresenter"; + this.ForumLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.ForumLinkLabelClicked_Handler); + // // NotifyIcon // this.NotifyIcon.ContextMenuStrip = this.TrayMenu; @@ -602,10 +655,10 @@ namespace EveOPreview.UI // TrayMenu // this.TrayMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - TitleMenuItem, - RestoreWindowMenuItem, - SeparatorMenuItem, - ExitMenuItem}); + TitleMenuItem, + RestoreWindowMenuItem, + SeparatorMenuItem, + ExitMenuItem}); this.TrayMenu.Name = "contextMenuStrip1"; this.TrayMenu.Size = new System.Drawing.Size(152, 76); // @@ -613,9 +666,14 @@ namespace EveOPreview.UI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.ControlDarkDark; - this.ClientSize = new System.Drawing.Size(252, 481); - this.Controls.Add(ContentFlowLayoutPanel); + this.BackColor = System.Drawing.SystemColors.Control; + this.ClientSize = new System.Drawing.Size(270, 511); + this.Controls.Add(OverlayOptionsPanel); + this.Controls.Add(MainOptionsPanel); + this.Controls.Add(ThumbnailSizePanel); + this.Controls.Add(ZoomOptionsPanel); + this.Controls.Add(ThumbnailListPanel); + this.Controls.Add(this.ForumLinkLabel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Margin = new System.Windows.Forms.Padding(0); @@ -626,12 +684,11 @@ namespace EveOPreview.UI this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainFormClosing_Handler); this.Load += new System.EventHandler(this.MainFormResize_Handler); this.Resize += new System.EventHandler(this.MainFormResize_Handler); - ContentFlowLayoutPanel.ResumeLayout(false); - ContentFlowLayoutPanel.PerformLayout(); - OpacityPanel.ResumeLayout(false); - OpacityPanel.PerformLayout(); - ResizeOptionsPanel.ResumeLayout(false); - ResizeOptionsPanel.PerformLayout(); + MainOptionsPanel.ResumeLayout(false); + MainOptionsPanel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ThumbnailOpacityTrackBar)).EndInit(); + ThumbnailSizePanel.ResumeLayout(false); + ThumbnailSizePanel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.ThumbnailsWidthNumericEdit)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ThumbnailsHeightNumericEdit)).EndInit(); ZoomOptionsPanel.ResumeLayout(false); @@ -639,25 +696,20 @@ namespace EveOPreview.UI this.ZoomAnchorPanel.ResumeLayout(false); this.ZoomAnchorPanel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.ThumbnailZoomFactorNumericEdit)).EndInit(); - ThumbnailsListPanel.ResumeLayout(false); - ThumbnailsListPanel.PerformLayout(); + ThumbnailListPanel.ResumeLayout(false); + ThumbnailListPanel.PerformLayout(); + OverlayOptionsPanel.ResumeLayout(false); + OverlayOptionsPanel.PerformLayout(); this.TrayMenu.ResumeLayout(false); this.ResumeLayout(false); } #endregion - - private CheckBox HideActiveClientThumbnailCheckBox; - private CheckBox HideThumbnailsOnLostFocusCheckBox; - private CheckBox EnablePerClientThumbnailsLayoutsCheckBox; - private CheckBox ShowThumbnailsAlwaysOnTopCheckBox; - private CheckBox ShowThumbnailFramesCheckBox; private LinkLabel ForumLinkLabel; private NumericUpDown ThumbnailsWidthNumericEdit; private NumericUpDown ThumbnailsHeightNumericEdit; private CheckBox EnableThumbnailZoomCheckBox; - private CheckBox ShowThumbnailOverlaysCheckBox; private RadioButton ZoomAanchorNWRadioButton; private RadioButton ZoomAanchorNRadioButton; private RadioButton ZoomAanchorNERadioButton; @@ -670,10 +722,19 @@ namespace EveOPreview.UI private NumericUpDown ThumbnailZoomFactorNumericEdit; private Panel ZoomAnchorPanel; private CheckedListBox ThumbnailsList; - private CheckBox EnableClientLayoutTrackingCheckBox; - private HScrollBar ThumbnailsOpacityScrollBar; - private CheckBox MinimizeToTrayCheckBox; private NotifyIcon NotifyIcon; private ContextMenuStrip TrayMenu; + private CheckBox EnableClientLayoutTrackingCheckBox; + private CheckBox HideActiveClientThumbnailCheckBox; + private CheckBox ShowThumbnailsAlwaysOnTopCheckBox; + private CheckBox HideThumbnailsOnLostFocusCheckBox; + private CheckBox EnablePerClientThumbnailsLayoutsCheckBox; + private CheckBox ShowThumbnailOverlaysCheckBox; + private CheckBox ShowThumbnailFramesCheckBox; + private CheckBox MinimizeToTrayCheckBox; + private TrackBar ThumbnailOpacityTrackBar; + private CheckBox EnableActiveClientHighlightCheckBox; + private Label HighlightColorLabel; + private Panel ActiveClientHighlightColorButton; } } \ No newline at end of file diff --git a/Eve-O-Preview/UI/Implementation/MainForm.cs b/Eve-O-Preview/UI/Implementation/MainForm.cs index 85c793f..da802cd 100644 --- a/Eve-O-Preview/UI/Implementation/MainForm.cs +++ b/Eve-O-Preview/UI/Implementation/MainForm.cs @@ -44,15 +44,25 @@ namespace EveOPreview.UI } } - public double ThumbnailsOpacity + public double ThumbnailOpacity { get { - return Math.Min(this.ThumbnailsOpacityScrollBar.Value / 100.00, 1.00); + return Math.Min(this.ThumbnailOpacityTrackBar.Value / 100.00, 1.00); } set { - this.ThumbnailsOpacityScrollBar.Value = Math.Min(100, (int)(100.0 * value)); + int barValue = (int)(100.0 * value); + if (barValue > 100) + { + barValue = 100; + } + else if (barValue < 10) + { + barValue = 10; + } + + this.ThumbnailOpacityTrackBar.Value = barValue; } } @@ -104,7 +114,7 @@ namespace EveOPreview.UI } } - public bool EnablePerClientThumbnailsLayouts + public bool EnablePerClientThumbnailLayouts { get { @@ -208,6 +218,32 @@ namespace EveOPreview.UI } } + public bool EnableActiveClientHighlight + { + get + { + return this.EnableActiveClientHighlightCheckBox.Checked; + } + set + { + this.EnableActiveClientHighlightCheckBox.Checked = value; + } + } + + public Color ActiveClientHighlightColor + { + get + { + return this._activeClientHighlightColor; + } + set + { + this._activeClientHighlightColor = value; + this.ActiveClientHighlightColorButton.BackColor = value; + } + } + private Color _activeClientHighlightColor; + public new void Show() { // Registers the current instance as the application's Main Form @@ -331,6 +367,23 @@ namespace EveOPreview.UI this.ThumbnailsSizeChanged?.Invoke(); } + private void ActiveClientHighlightColorButton_Click(object sender, EventArgs e) + { + using (ColorDialog dialog = new ColorDialog()) + { + dialog.Color = this.ActiveClientHighlightColor; + + if (dialog.ShowDialog() != DialogResult.OK) + { + return; + } + + this.ActiveClientHighlightColor = dialog.Color; + } + + this.OptionChanged_Handler(sender, e); + } + private void ThumbnailsList_ItemCheck_Handler(object sender, ItemCheckEventArgs e) { IThumbnailDescriptionView selectedItem = this.ThumbnailsList.Items[e.Index] as IThumbnailDescriptionView; diff --git a/Eve-O-Preview/UI/Implementation/MainForm.resx b/Eve-O-Preview/UI/Implementation/MainForm.resx index 4f505d6..f470749 100644 --- a/Eve-O-Preview/UI/Implementation/MainForm.resx +++ b/Eve-O-Preview/UI/Implementation/MainForm.resx @@ -129,24 +129,18 @@ False - + False - + + True + + True True - - False - - - True - - - True - True @@ -162,10 +156,10 @@ True - + False - + True @@ -240,16 +234,10 @@ True - - True - - - True - - + False - + True @@ -261,15 +249,36 @@ True - - True - False False + + False + + + True + + + True + + + True + + + True + + + True + + + True + + + True + 17, 17 @@ -860,7 +869,7 @@ True - 86 + 36 diff --git a/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.Designer.cs b/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.Designer.cs index 5336b35..47bb2f6 100644 --- a/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.Designer.cs +++ b/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.Designer.cs @@ -50,10 +50,9 @@ // OverlayLabel // this.OverlayLabel.AutoSize = true; - this.OverlayLabel.Dock = System.Windows.Forms.DockStyle.Top; this.OverlayLabel.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.OverlayLabel.ForeColor = System.Drawing.Color.DarkGray; - this.OverlayLabel.Location = new System.Drawing.Point(0, 0); + this.OverlayLabel.Location = new System.Drawing.Point(8, 8); this.OverlayLabel.Name = "OverlayLabel"; this.OverlayLabel.Size = new System.Drawing.Size(25, 13); this.OverlayLabel.TabIndex = 1; diff --git a/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs b/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs index d02a926..16b3f3d 100644 --- a/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs +++ b/Eve-O-Preview/UI/Implementation/ThumbnailOverlay.cs @@ -1,4 +1,5 @@ using System; +using System.Drawing; using System.Windows.Forms; namespace EveOPreview.UI @@ -7,6 +8,8 @@ namespace EveOPreview.UI { #region Private fields private readonly Action _areaClickAction; + private bool _highlightEnabled; + private Color _highlightColor; #endregion public ThumbnailOverlay(Form owner, Action areaClickAction) @@ -14,6 +17,9 @@ namespace EveOPreview.UI this.Owner = owner; this._areaClickAction = areaClickAction; + this._highlightEnabled = false; + this._highlightColor = Color.Red; + InitializeComponent(); } @@ -27,14 +33,46 @@ namespace EveOPreview.UI this.OverlayLabel.Text = label; } + public void EnableOverlayLabel(bool enable) + { + this.OverlayLabel.Visible = enable; + } + + public void EnableHighlight(bool enabled, Color color) + { + if (enabled == this._highlightEnabled) + { + // Nothing to do here + return; + } + + this._highlightEnabled = enabled; + this._highlightColor = color; + this.Refresh(); + } + protected override CreateParams CreateParams { get { var Params = base.CreateParams; - Params.ExStyle |= (int)DwmApiNativeMethods.WS_EX_TOOLWINDOW; + Params.ExStyle |= (int)WindowManagerNativeMethods.WS_EX_TOOLWINDOW; return Params; } } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + if (this._highlightEnabled) + { + ControlPaint.DrawBorder(e.Graphics, this.ClientRectangle, + this._highlightColor, 4, ButtonBorderStyle.Solid, + this._highlightColor, 4, ButtonBorderStyle.Solid, + this._highlightColor, 4, ButtonBorderStyle.Solid, + this._highlightColor, 4, ButtonBorderStyle.Solid); + } + } } } diff --git a/Eve-O-Preview/UI/Implementation/ThumbnailView.Designer.cs b/Eve-O-Preview/UI/Implementation/ThumbnailView.Designer.cs index c8680f3..71e6fc9 100644 --- a/Eve-O-Preview/UI/Implementation/ThumbnailView.Designer.cs +++ b/Eve-O-Preview/UI/Implementation/ThumbnailView.Designer.cs @@ -33,9 +33,11 @@ namespace EveOPreview.UI this.ShowInTaskbar = false; this.Text = "Preview"; this.TopMost = true; - this.MouseLeave += new System.EventHandler(this.LostFocus_Handler); - this.MouseHover += new System.EventHandler(this.Focused_Handler); - this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ThumbnailActivated_Handler); + this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.MouseDown_Handler); + this.MouseEnter += new System.EventHandler(this.MouseEnter_Handler); + this.MouseLeave += new System.EventHandler(this.MouseLeave_Handler); + this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.MouseMove_Handler); + this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.MouseUp_Handler); this.Move += new System.EventHandler(this.Move_Handler); this.Resize += new System.EventHandler(this.Resize_Handler); this.ResumeLayout(false); diff --git a/Eve-O-Preview/UI/Implementation/ThumbnailView.cs b/Eve-O-Preview/UI/Implementation/ThumbnailView.cs index 5a99a01..1dc3da9 100644 --- a/Eve-O-Preview/UI/Implementation/ThumbnailView.cs +++ b/Eve-O-Preview/UI/Implementation/ThumbnailView.cs @@ -8,21 +8,24 @@ namespace EveOPreview.UI public partial class ThumbnailView : Form, IThumbnailView { #region Private fields - - //private readonly IThumbnailManager _manager; private readonly ThumbnailOverlay _overlay; - // This is pure brainless View - // Just somewhat more complex than usual + // Part of the logic (namely current size / position management) + // was moved to the view due to the performance reasons private bool _isThumbnailSetUp; private bool _isOverlayVisible; + private bool _isTopMost; private bool _isPositionChanged; private bool _isSizeChanged; + private bool _isCustomMouseModeActive; private DateTime _suppressResizeEventsTimestamp; private DWM_THUMBNAIL_PROPERTIES _thumbnail; private IntPtr _thumbnailHandle; - private Size _baseSize; - private Point _baseLocation; + private Size _baseZoomSize; + private Point _baseZoomLocation; + private Point _baseMousePosition; + private Size _baseZoomMaximumSize; + private HotkeyHandler _hotkeyHandler; #endregion @@ -34,15 +37,17 @@ namespace EveOPreview.UI this.IsOverlayEnabled = false; this._isThumbnailSetUp = false; this._isOverlayVisible = false; + this._isTopMost = false; this._isPositionChanged = true; this._isSizeChanged = true; + this._isCustomMouseModeActive = false; this._suppressResizeEventsTimestamp = DateTime.UtcNow; InitializeComponent(); - this._overlay = new ThumbnailOverlay(this, this.ThumbnailActivated_Handler); + this._overlay = new ThumbnailOverlay(this, this.MouseDown_Handler); } public IntPtr Id { get; set; } @@ -108,7 +113,11 @@ namespace EveOPreview.UI { base.Show(); - // Thumbnail will be registered during the Refresh cycle + this._isPositionChanged = true; + this._isSizeChanged = true; + this._isOverlayVisible = false; + + // Thumbnail will be properly registered during the Manager's Refresh cycle this.Refresh(); this.IsActive = true; @@ -147,14 +156,28 @@ namespace EveOPreview.UI public void SetOpacity(double opacity) { this.Opacity = opacity; + + // Overlay opacity settings + // Of the thumbnail's opacity is almost full then set the overlay's one to + // full. Otherwise set it to half of the thumnail opacity + // Opacity value is stored even if the overlay is not displayed atm + this._overlay.Opacity = this.Opacity > 0.9 ? 1.0 : 1.0 - (1.0 - this.Opacity) / 2; } public void SetFrames(bool enable) { + FormBorderStyle style = enable ? FormBorderStyle.SizableToolWindow : FormBorderStyle.None; + + // No need to change the borders style if it is ALREADY correct + if (this.FormBorderStyle == style) + { + return; + } + // Fix for WinForms issue with the Resize event being fired with inconsistent ClientSize value // Any Resize events fired before this timestamp will be ignored this._suppressResizeEventsTimestamp = DateTime.UtcNow.AddMilliseconds(450); - this.FormBorderStyle = enable ? FormBorderStyle.SizableToolWindow : FormBorderStyle.None; + this.FormBorderStyle = style; // Notify about possible contents position change this._isSizeChanged = true; @@ -162,17 +185,27 @@ namespace EveOPreview.UI public void SetTopMost(bool enableTopmost) { + // IMO WinForms could check this too + if (this._isTopMost == enableTopmost) + { + return; + } + this.TopMost = enableTopmost; this._overlay.TopMost = enableTopmost; + + this._isTopMost = enableTopmost; + } + + public void SetHighlight(bool enabled, Color color) + { + this._overlay.EnableHighlight(enabled, color); } public void ZoomIn(ViewZoomAnchor anchor, int zoomFactor) { - this._baseSize = this.Size; - this._baseLocation = this.Location; - - int oldWidth = this._baseSize.Width; - int oldHeight = this._baseSize.Height; + int oldWidth = this._baseZoomSize.Width; + int oldHeight = this._baseZoomSize.Height; int locationX = this.Location.X; int locationY = this.Location.Y; @@ -183,6 +216,7 @@ namespace EveOPreview.UI // First change size, THEN move the window // Otherwise there is a chance to fail in a loop // Zoom requied -> Moved the windows 1st -> Focus is lost -> Window is moved back -> Focus is back on -> Zoom required -> ... + this.MaximumSize = new Size(0, 0); this.Size = new Size(newWidth, newHeight); switch (anchor) @@ -207,7 +241,7 @@ namespace EveOPreview.UI break; case ViewZoomAnchor.SW: - this.Location = new Point(locationX, locationY - newHeight + this._baseSize.Height); + this.Location = new Point(locationX, locationY - newHeight + this._baseZoomSize.Height); break; case ViewZoomAnchor.S: this.Location = new Point(locationX - newWidth / 2 + oldWidth / 2, locationY - newHeight + oldHeight); @@ -220,8 +254,7 @@ namespace EveOPreview.UI public void ZoomOut() { - this.Size = this._baseSize; - this.Location = this._baseLocation; + this.RestoreWindowSizeAndLocation(); } public void RegisterHotkey(Keys hotkey) @@ -247,7 +280,6 @@ namespace EveOPreview.UI // There can be a lot of possible exception reasons here // In case of any of them the hotkey setting is silently ignored } - } public void UnregisterHotkey() @@ -281,7 +313,7 @@ namespace EveOPreview.UI this._thumbnail.rcDestination = new RECT(0, 0, this.ClientSize.Width, this.ClientSize.Height); try { - DwmApiNativeMethods.DwmUpdateThumbnailProperties(this._thumbnailHandle, this._thumbnail); + WindowManagerNativeMethods.DwmUpdateThumbnailProperties(this._thumbnailHandle, this._thumbnail); } catch (ArgumentException) { @@ -295,40 +327,34 @@ namespace EveOPreview.UI this.UnregisterThumbnail(obsoleteThumbnailHanlde); } - if (!this.IsOverlayEnabled) - { - if (this._isOverlayVisible) - { - this._overlay.Hide(); - this._isOverlayVisible = false; - } - - return; - } + this._overlay.EnableOverlayLabel(this.IsOverlayEnabled); if (!this._isOverlayVisible) { + // One-time action to show the Overlay before it is set up + // Otherwise its position won't be set this._overlay.Show(); this._isOverlayVisible = true; } - else if (!(sizeChanged || locationChanged)) + else { - // No need to adjust in the overlay location if it is already visible and properly set - return; + if (!(sizeChanged || locationChanged)) + { + // No need to adjust in the overlay location if it is already visible and properly set + return; + } } Size overlaySize = this.ClientSize; - overlaySize.Width -= 2 * 5; - overlaySize.Height -= 2 * 5; - Point overlayLocation = this.Location; - overlayLocation.X += 5 + (this.Size.Width - this.ClientSize.Width) / 2; - overlayLocation.Y += 5 + (this.Size.Height - this.ClientSize.Height) - (this.Size.Width - this.ClientSize.Width) / 2; + overlayLocation.X += (this.Size.Width - this.ClientSize.Width) / 2; + overlayLocation.Y += (this.Size.Height - this.ClientSize.Height) - (this.Size.Width - this.ClientSize.Width) / 2; this._isPositionChanged = false; this._overlay.Size = overlaySize; this._overlay.Location = overlayLocation; + this._overlay.Refresh(); } #region GUI events @@ -337,7 +363,7 @@ namespace EveOPreview.UI get { var Params = base.CreateParams; - Params.ExStyle |= (int)DwmApiNativeMethods.WS_EX_TOOLWINDOW; + Params.ExStyle |= (int)WindowManagerNativeMethods.WS_EX_TOOLWINDOW; return Params; } } @@ -360,34 +386,46 @@ namespace EveOPreview.UI this.ThumbnailResized?.Invoke(this.Id); } - private void Focused_Handler(object sender, EventArgs e) + private void MouseEnter_Handler(object sender, EventArgs e) { + this.ExitCustomMouseMode(); + this.SaveWindowSizeAndLocation(); + this.ThumbnailFocused?.Invoke(this.Id); } - private void LostFocus_Handler(object sender, EventArgs e) + private void MouseLeave_Handler(object sender, EventArgs e) { this.ThumbnailLostFocus?.Invoke(this.Id); } - private void ThumbnailActivated_Handler(object sender, MouseEventArgs e) + private void MouseDown_Handler(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { this.ThumbnailActivated?.Invoke(this.Id); } - //if (e.Button == MouseButtons.Right) - //{ - // // do smth cool? - //} + if ((e.Button == MouseButtons.Right) || (e.Button == (MouseButtons.Left | MouseButtons.Right))) + { + this.EnterCustomMouseMode(); + } + } - //if (e.Button == MouseButtons.Middle) - //{ - //// Trigger full thumbnail refresh - //this.UnregisterThumbnail(); - //this.Refresh(); - //} + private void MouseMove_Handler(object sender, MouseEventArgs e) + { + if (this._isCustomMouseModeActive) + { + this.ProcessCustomMouseMode(e.Button.HasFlag(MouseButtons.Left), e.Button.HasFlag(MouseButtons.Right)); + } + } + + private void MouseUp_Handler(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Right) + { + this.ExitCustomMouseMode(); + } } private void HotkeyPressed_Handler(object sender, HandledEventArgs e) @@ -398,9 +436,10 @@ namespace EveOPreview.UI } #endregion + #region Thumbnail management private void RegisterThumbnail() { - this._thumbnailHandle = DwmApiNativeMethods.DwmRegisterThumbnail(this.Handle, this.Id); + this._thumbnailHandle = WindowManagerNativeMethods.DwmRegisterThumbnail(this.Handle, this.Id); this._thumbnail = new DWM_THUMBNAIL_PROPERTIES(); this._thumbnail.dwFlags = DWM_TNP_CONSTANTS.DWM_TNP_VISIBLE @@ -418,11 +457,68 @@ namespace EveOPreview.UI { try { - DwmApiNativeMethods.DwmUnregisterThumbnail(thumbnailHandle); + WindowManagerNativeMethods.DwmUnregisterThumbnail(thumbnailHandle); } catch (ArgumentException) { } } + #endregion + + #region Custom Mouse mode + // This pair of methods saves/restores certain window propeties + // Methods are used to remove the 'Zoom' effect (if any) when the + // custom resize/move mode is activated + // Methods are kept on this level because moving to the presenter + // the code that responds to the mouse events like movement + // seems like a huge overkill + private void SaveWindowSizeAndLocation() + { + this._baseZoomSize = this.Size; + this._baseZoomLocation = this.Location; + this._baseZoomMaximumSize = this.MaximumSize; + } + + private void RestoreWindowSizeAndLocation() + { + this.Size = this._baseZoomSize; + this.MaximumSize = this._baseZoomMaximumSize; + this.Location = this._baseZoomLocation; + } + + private void EnterCustomMouseMode() + { + this.RestoreWindowSizeAndLocation(); + + this._isCustomMouseModeActive = true; + this._baseMousePosition = Control.MousePosition; + } + + private void ProcessCustomMouseMode(bool leftButton, bool rightButton) + { + Point mousePosition = Control.MousePosition; + int offsetX = mousePosition.X - this._baseMousePosition.X; + int offsetY = mousePosition.Y - this._baseMousePosition.Y; + this._baseMousePosition = mousePosition; + + // Left + Right buttons trigger thumbnail resize + // Right button only trigger thumbnail movement + if (leftButton && rightButton) + { + this.Size = new Size(this.Size.Width + offsetX, this.Size.Height + offsetY); + this._baseZoomSize = this.Size; + } + else + { + this.Location = new Point(this.Location.X + offsetX, this.Location.Y + offsetY); + this._baseZoomLocation = this.Location; + } + } + + private void ExitCustomMouseMode() + { + this._isCustomMouseModeActive = false; + } + #endregion } } \ No newline at end of file diff --git a/Eve-O-Preview/UI/Interface/IMainView.cs b/Eve-O-Preview/UI/Interface/IMainView.cs index 3a2b7b1..b6193ad 100644 --- a/Eve-O-Preview/UI/Interface/IMainView.cs +++ b/Eve-O-Preview/UI/Interface/IMainView.cs @@ -12,13 +12,13 @@ namespace EveOPreview.UI { bool MinimizeToTray { get; set; } - double ThumbnailsOpacity { get; set; } + double ThumbnailOpacity { get; set; } bool EnableClientLayoutTracking { get; set; } bool HideActiveClientThumbnail { get; set; } bool ShowThumbnailsAlwaysOnTop { get; set; } bool HideThumbnailsOnLostFocus { get; set; } - bool EnablePerClientThumbnailsLayouts { get; set; } + bool EnablePerClientThumbnailLayouts { get; set; } Size ThumbnailSize { get; set; } @@ -29,6 +29,9 @@ namespace EveOPreview.UI bool ShowThumbnailOverlays { get; set; } bool ShowThumbnailFrames { get; set; } + bool EnableActiveClientHighlight { get; set; } + Color ActiveClientHighlightColor { get; set; } + void SetForumUrl(string url); void SetThumbnailSizeLimitations(Size minimumSize, Size maximumSize); diff --git a/Eve-O-Preview/UI/Interface/IThumbnailView.cs b/Eve-O-Preview/UI/Interface/IThumbnailView.cs index 1034160..21b5cfd 100644 --- a/Eve-O-Preview/UI/Interface/IThumbnailView.cs +++ b/Eve-O-Preview/UI/Interface/IThumbnailView.cs @@ -21,6 +21,7 @@ namespace EveOPreview.UI void SetOpacity(double opacity); void SetFrames(bool enable); void SetTopMost(bool enableTopmost); + void SetHighlight(bool enabled, Color color); void ZoomIn(ViewZoomAnchor anchor, int zoomFactor); void ZoomOut();