From 00eb9eb2de39f4269aac4a123fa087a688e7c653 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Fri, 29 Aug 2025 22:32:05 +0200 Subject: [PATCH] feat(configuration): add thumbnail snap range setting --- .../Implementation/ThumbnailConfiguration.cs | 2 + .../Interface/IThumbnailConfiguration.cs | 1 + .../Implementation/MainFormPresenter.cs | 2 + .../View/Implementation/InputDialog.resx | 120 ++++++++++++++++++ .../View/Implementation/MainForm.Designer.cs | 54 ++++++-- .../View/Implementation/MainForm.cs | 5 + .../Implementation/StaticThumbnailView.resx | 120 ++++++++++++++++++ .../View/Interface/IMainFormView.cs | 1 + 8 files changed, 295 insertions(+), 10 deletions(-) create mode 100644 src/Eve-O-Preview/View/Implementation/InputDialog.resx create mode 100644 src/Eve-O-Preview/View/Implementation/StaticThumbnailView.resx diff --git a/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs b/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs index ae7e8e1..0ce2ad2 100644 --- a/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs +++ b/src/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs @@ -93,6 +93,7 @@ namespace EveOPreview.Configuration.Implementation { this.ThumbnailMaximumSize = new Size(960, 540); this.EnableThumbnailSnap = true; + this.ThumbnailSnapRange = 20; this.ThumbnailZoomEnabled = false; this.ThumbnailZoomFactor = 2; @@ -272,6 +273,7 @@ namespace EveOPreview.Configuration.Implementation { public Size ThumbnailMinimumSize { get; set; } public bool EnableThumbnailSnap { get; set; } + public int ThumbnailSnapRange { get; set; } [JsonProperty("EnableThumbnailZoom")] public bool ThumbnailZoomEnabled { diff --git a/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs b/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs index 516c33b..0c44ce3 100644 --- a/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs +++ b/src/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs @@ -53,6 +53,7 @@ namespace EveOPreview.Configuration { Size ThumbnailMaximumSize { get; set; } bool EnableThumbnailSnap { get; set; } + int ThumbnailSnapRange { get; set; } bool ThumbnailZoomEnabled { get; set; } int ThumbnailZoomFactor { get; set; } diff --git a/src/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs b/src/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs index 38bdfbd..6b8d309 100644 --- a/src/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs +++ b/src/Eve-O-Preview/Presenters/Implementation/MainFormPresenter.cs @@ -120,6 +120,7 @@ namespace EveOPreview.Presenters { this.View.ThumbnailSnapToGrid = this._configuration.ThumbnailSnapToGrid; this.View.ThumbnailSnapToGridSizeX = this._configuration.ThumbnailSnapToGridSizeX; this.View.ThumbnailSnapToGridSizeY = this._configuration.ThumbnailSnapToGridSizeY; + this.View.ThumbnailSnapRange = this._configuration.ThumbnailSnapRange; this.View.EnableActiveClientHighlight = this._configuration.EnableActiveClientHighlight; this.View.ActiveClientHighlightColor = this._configuration.ActiveClientHighlightColor; @@ -166,6 +167,7 @@ namespace EveOPreview.Presenters { this._configuration.ThumbnailSnapToGrid = this.View.ThumbnailSnapToGrid; this._configuration.ThumbnailSnapToGridSizeX = this.View.ThumbnailSnapToGridSizeX; this._configuration.ThumbnailSnapToGridSizeY = this.View.ThumbnailSnapToGridSizeY; + this._configuration.ThumbnailSnapRange = this.View.ThumbnailSnapRange; this._configuration.EnableActiveClientHighlight = this.View.EnableActiveClientHighlight; this._configuration.ActiveClientHighlightColor = this.View.ActiveClientHighlightColor; diff --git a/src/Eve-O-Preview/View/Implementation/InputDialog.resx b/src/Eve-O-Preview/View/Implementation/InputDialog.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/src/Eve-O-Preview/View/Implementation/InputDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/Eve-O-Preview/View/Implementation/MainForm.Designer.cs b/src/Eve-O-Preview/View/Implementation/MainForm.Designer.cs index 4d246b5..4528028 100644 --- a/src/Eve-O-Preview/View/Implementation/MainForm.Designer.cs +++ b/src/Eve-O-Preview/View/Implementation/MainForm.Designer.cs @@ -120,6 +120,8 @@ namespace EveOPreview.View { SaveProfileButton = new Button(); DeleteProfileButton = new Button(); ProfileLabel = new Label(); + ThumbnailSnapRangeLabel = new Label(); + ThumbnailSnapRangeNumericEdit = new NumericUpDown(); ThumbnailsList = new CheckedListBox(); VersionLabel = new Label(); DocumentationLink = new LinkLabel(); @@ -159,6 +161,7 @@ namespace EveOPreview.View { ThumbnailSettingsPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)ThumbnailSnapToGridSizeYNumericEdit).BeginInit(); ((System.ComponentModel.ISupportInitialize)ThumbnailSnapToGridSizeXNumericEdit).BeginInit(); + ((System.ComponentModel.ISupportInitialize)ThumbnailSnapRangeNumericEdit).BeginInit(); ((System.ComponentModel.ISupportInitialize)ThumbnailsWidthNumericEdit).BeginInit(); ((System.ComponentModel.ISupportInitialize)ThumbnailsHeightNumericEdit).BeginInit(); ((System.ComponentModel.ISupportInitialize)ThumbnailOpacityTrackBar).BeginInit(); @@ -400,6 +403,8 @@ namespace EveOPreview.View { ThumbnailSettingsPanel.Controls.Add(ProfileComboBox); ThumbnailSettingsPanel.Controls.Add(SaveProfileButton); ThumbnailSettingsPanel.Controls.Add(DeleteProfileButton); + ThumbnailSettingsPanel.Controls.Add(ThumbnailSnapRangeLabel); + ThumbnailSettingsPanel.Controls.Add(ThumbnailSnapRangeNumericEdit); ThumbnailSettingsPanel.Controls.Add(ThumbnailSnapToGridCheckBox); ThumbnailSettingsPanel.Controls.Add(ThumbnailSnapToGridSizeYNumericEdit); ThumbnailSettingsPanel.Controls.Add(SnapYLabel); @@ -422,7 +427,7 @@ namespace EveOPreview.View { // EnableThumbnailRegionSnippingCheckBox // EnableThumbnailRegionSnippingCheckBox.AutoSize = true; - EnableThumbnailRegionSnippingCheckBox.Location = new Point(18, 270); + EnableThumbnailRegionSnippingCheckBox.Location = new Point(18, 310); EnableThumbnailRegionSnippingCheckBox.Margin = new Padding(5, 6, 5, 6); EnableThumbnailRegionSnippingCheckBox.Name = "EnableThumbnailRegionSnippingCheckBox"; EnableThumbnailRegionSnippingCheckBox.Size = new Size(280, 29); @@ -434,7 +439,7 @@ namespace EveOPreview.View { // RegionLeftLabel // RegionLeftLabel.AutoSize = true; - RegionLeftLabel.Location = new Point(13, 310); + RegionLeftLabel.Location = new Point(13, 350); RegionLeftLabel.Margin = new Padding(5, 0, 5, 0); RegionLeftLabel.Name = "RegionLeftLabel"; RegionLeftLabel.Size = new Size(45, 25); @@ -447,7 +452,7 @@ namespace EveOPreview.View { RegionLeftNumericEdit.BorderStyle = BorderStyle.FixedSingle; RegionLeftNumericEdit.CausesValidation = false; RegionLeftNumericEdit.Increment = new decimal(new int[] { 10, 0, 0, 0 }); - RegionLeftNumericEdit.Location = new Point(93, 305); + RegionLeftNumericEdit.Location = new Point(93, 345); RegionLeftNumericEdit.Margin = new Padding(5, 6, 5, 6); RegionLeftNumericEdit.Maximum = new decimal(new int[] { 999999, 0, 0, 0 }); RegionLeftNumericEdit.Name = "RegionLeftNumericEdit"; @@ -458,7 +463,7 @@ namespace EveOPreview.View { // RegionTopLabel // RegionTopLabel.AutoSize = true; - RegionTopLabel.Location = new Point(183, 310); + RegionTopLabel.Location = new Point(183, 350); RegionTopLabel.Margin = new Padding(5, 0, 5, 0); RegionTopLabel.Name = "RegionTopLabel"; RegionTopLabel.Size = new Size(42, 25); @@ -471,7 +476,7 @@ namespace EveOPreview.View { RegionTopNumericEdit.BorderStyle = BorderStyle.FixedSingle; RegionTopNumericEdit.CausesValidation = false; RegionTopNumericEdit.Increment = new decimal(new int[] { 10, 0, 0, 0 }); - RegionTopNumericEdit.Location = new Point(230, 307); + RegionTopNumericEdit.Location = new Point(240, 347); RegionTopNumericEdit.Margin = new Padding(5, 6, 5, 6); RegionTopNumericEdit.Maximum = new decimal(new int[] { 999999, 0, 0, 0 }); RegionTopNumericEdit.Name = "RegionTopNumericEdit"; @@ -482,7 +487,7 @@ namespace EveOPreview.View { // RegionWidthLabel // RegionWidthLabel.AutoSize = true; - RegionWidthLabel.Location = new Point(13, 350); + RegionWidthLabel.Location = new Point(13, 390); RegionWidthLabel.Margin = new Padding(5, 0, 5, 0); RegionWidthLabel.Name = "RegionWidthLabel"; RegionWidthLabel.Size = new Size(65, 25); @@ -495,7 +500,7 @@ namespace EveOPreview.View { RegionWidthNumericEdit.BorderStyle = BorderStyle.FixedSingle; RegionWidthNumericEdit.CausesValidation = false; RegionWidthNumericEdit.Increment = new decimal(new int[] { 10, 0, 0, 0 }); - RegionWidthNumericEdit.Location = new Point(93, 345); + RegionWidthNumericEdit.Location = new Point(93, 385); RegionWidthNumericEdit.Margin = new Padding(5, 6, 5, 6); RegionWidthNumericEdit.Maximum = new decimal(new int[] { 999999, 0, 0, 0 }); RegionWidthNumericEdit.Name = "RegionWidthNumericEdit"; @@ -506,7 +511,7 @@ namespace EveOPreview.View { // RegionHeightLabel // RegionHeightLabel.AutoSize = true; - RegionHeightLabel.Location = new Point(183, 350); + RegionHeightLabel.Location = new Point(183, 390); RegionHeightLabel.Margin = new Padding(5, 0, 5, 0); RegionHeightLabel.Name = "RegionHeightLabel"; RegionHeightLabel.Size = new Size(70, 25); @@ -519,7 +524,7 @@ namespace EveOPreview.View { RegionHeightNumericEdit.BorderStyle = BorderStyle.FixedSingle; RegionHeightNumericEdit.CausesValidation = false; RegionHeightNumericEdit.Increment = new decimal(new int[] { 10, 0, 0, 0 }); - RegionHeightNumericEdit.Location = new Point(230, 347); + RegionHeightNumericEdit.Location = new Point(240, 387); RegionHeightNumericEdit.Margin = new Padding(5, 6, 5, 6); RegionHeightNumericEdit.Maximum = new decimal(new int[] { 999999, 0, 0, 0 }); RegionHeightNumericEdit.Name = "RegionHeightNumericEdit"; @@ -529,7 +534,7 @@ namespace EveOPreview.View { // // PickRegionButton // - PickRegionButton.Location = new Point(330, 305); + PickRegionButton.Location = new Point(93, 425); PickRegionButton.Margin = new Padding(5, 6, 5, 6); PickRegionButton.Name = "PickRegionButton"; PickRegionButton.Size = new Size(120, 35); @@ -642,6 +647,32 @@ namespace EveOPreview.View { SnapXLabel.TabIndex = 28; SnapXLabel.Text = "Snap X"; // + // ThumbnailSnapRangeLabel + // + ThumbnailSnapRangeLabel.AutoSize = true; + ThumbnailSnapRangeLabel.Location = new Point(13, 270); + ThumbnailSnapRangeLabel.Margin = new Padding(5, 0, 5, 0); + ThumbnailSnapRangeLabel.Name = "ThumbnailSnapRangeLabel"; + ThumbnailSnapRangeLabel.Size = new Size(120, 25); + ThumbnailSnapRangeLabel.TabIndex = 54; + ThumbnailSnapRangeLabel.Text = "Snap Range"; + // + // ThumbnailSnapRangeNumericEdit + // + ThumbnailSnapRangeNumericEdit.BackColor = SystemColors.Window; + ThumbnailSnapRangeNumericEdit.BorderStyle = BorderStyle.FixedSingle; + ThumbnailSnapRangeNumericEdit.CausesValidation = false; + ThumbnailSnapRangeNumericEdit.Increment = new decimal(new int[] { 5, 0, 0, 0 }); + ThumbnailSnapRangeNumericEdit.Location = new Point(93, 265); + ThumbnailSnapRangeNumericEdit.Margin = new Padding(5, 6, 5, 6); + ThumbnailSnapRangeNumericEdit.Maximum = new decimal(new int[] { 100, 0, 0, 0 }); + ThumbnailSnapRangeNumericEdit.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); + ThumbnailSnapRangeNumericEdit.Name = "ThumbnailSnapRangeNumericEdit"; + ThumbnailSnapRangeNumericEdit.Size = new Size(80, 31); + ThumbnailSnapRangeNumericEdit.TabIndex = 55; + ThumbnailSnapRangeNumericEdit.Value = new decimal(new int[] { 20, 0, 0, 0 }); + ThumbnailSnapRangeNumericEdit.ValueChanged += OptionChanged_Handler; + // // LockThumbnailLocationCheckbox // LockThumbnailLocationCheckbox.AutoSize = true; @@ -1393,6 +1424,7 @@ namespace EveOPreview.View { ThumbnailSettingsPanel.ResumeLayout(false); ThumbnailSettingsPanel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)ThumbnailSnapToGridSizeYNumericEdit).EndInit(); + ((System.ComponentModel.ISupportInitialize)ThumbnailSnapRangeNumericEdit).EndInit(); ((System.ComponentModel.ISupportInitialize)ThumbnailSnapToGridSizeXNumericEdit).EndInit(); ((System.ComponentModel.ISupportInitialize)ThumbnailsWidthNumericEdit).EndInit(); ((System.ComponentModel.ISupportInitialize)ThumbnailsHeightNumericEdit).EndInit(); @@ -1473,6 +1505,8 @@ namespace EveOPreview.View { private Button SaveProfileButton; private Button DeleteProfileButton; private Label ProfileLabel; + private Label ThumbnailSnapRangeLabel; + private NumericUpDown ThumbnailSnapRangeNumericEdit; private Label label3; private Label label2; private Panel OverlayLabelColorButton; diff --git a/src/Eve-O-Preview/View/Implementation/MainForm.cs b/src/Eve-O-Preview/View/Implementation/MainForm.cs index d045c2b..1ae589d 100644 --- a/src/Eve-O-Preview/View/Implementation/MainForm.cs +++ b/src/Eve-O-Preview/View/Implementation/MainForm.cs @@ -220,6 +220,11 @@ namespace EveOPreview.View { set => ThumbnailSnapToGridSizeYNumericEdit.Value = value; } + public int ThumbnailSnapRange { + get => (int)ThumbnailSnapRangeNumericEdit.Value; + set => ThumbnailSnapRangeNumericEdit.Value = value; + } + public bool EnableActiveClientHighlight { get => this.EnableActiveClientHighlightCheckBox.Checked; set => this.EnableActiveClientHighlightCheckBox.Checked = value; diff --git a/src/Eve-O-Preview/View/Implementation/StaticThumbnailView.resx b/src/Eve-O-Preview/View/Implementation/StaticThumbnailView.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/src/Eve-O-Preview/View/Implementation/StaticThumbnailView.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/Eve-O-Preview/View/Interface/IMainFormView.cs b/src/Eve-O-Preview/View/Interface/IMainFormView.cs index addb5ad..983e93a 100644 --- a/src/Eve-O-Preview/View/Interface/IMainFormView.cs +++ b/src/Eve-O-Preview/View/Interface/IMainFormView.cs @@ -34,6 +34,7 @@ namespace EveOPreview.View { bool ThumbnailSnapToGrid { get; set; } int ThumbnailSnapToGridSizeX { get; set; } int ThumbnailSnapToGridSizeY { get; set; } + int ThumbnailSnapRange { get; set; } bool EnableActiveClientHighlight { get; set; } Color ActiveClientHighlightColor { get; set; }