diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2020-09-12 18:12:35 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2020-09-12 18:12:35 +0300 |
commit | 24cbb40e03f2d7e1e9f22d7de3458471a0fdd490 (patch) | |
tree | de297e7c404a8056cf3e8e6842f4ab7ef9e1d44d /UVtools.GUI | |
parent | cdade9ba222982c7424b6f7026b10969fa24fec3 (diff) |
GUI improvements
* (Add) Layer status bar: Button with ROI - Click to zoom in region
* (Add) Setting: Allow the layer overlay tooltips for select issues, ROI, and edit pixel mode to be hidden.
* (Change) Layer status bar: Bounds text to button - Click to zoom in region
* (Change) Layer status bar: Pixel picker text to button - Click to center in point
* (Change) Layer status bar: Resolution text to button - Click to zoom to fit
* (Change) Customized cursor for Pixel Edit mode (#51)
* (Fix) Misc. text cleanup (#52)
Diffstat (limited to 'UVtools.GUI')
-rw-r--r-- | UVtools.GUI/Forms/FrmSettings.Designer.cs | 43 | ||||
-rw-r--r-- | UVtools.GUI/Forms/FrmSettings.cs | 4 | ||||
-rw-r--r-- | UVtools.GUI/FrmMain.Designer.cs | 99 | ||||
-rw-r--r-- | UVtools.GUI/FrmMain.cs | 77 | ||||
-rw-r--r-- | UVtools.GUI/FrmMain.resx | 64 | ||||
-rw-r--r-- | UVtools.GUI/Properties/AssemblyInfo.cs | 4 | ||||
-rw-r--r-- | UVtools.GUI/Properties/Settings.Designer.cs | 8 | ||||
-rw-r--r-- | UVtools.GUI/UVtools.GUI.csproj | 2 |
8 files changed, 195 insertions, 106 deletions
diff --git a/UVtools.GUI/Forms/FrmSettings.Designer.cs b/UVtools.GUI/Forms/FrmSettings.Designer.cs index 6f477fc..50e1ad9 100644 --- a/UVtools.GUI/Forms/FrmSettings.Designer.cs +++ b/UVtools.GUI/Forms/FrmSettings.Designer.cs @@ -143,10 +143,12 @@ this.label39 = new System.Windows.Forms.Label(); this.nmCrosshairLineMargin = new System.Windows.Forms.NumericUpDown(); this.groupBox9 = new System.Windows.Forms.GroupBox(); + this.cbShowLayerTooltipsOverlay = new System.Windows.Forms.CheckBox(); this.cbLayerAutoRotateBestView = new System.Windows.Forms.CheckBox(); this.cbLayerZoomToFit = new System.Windows.Forms.CheckBox(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage4 = new System.Windows.Forms.TabPage(); + this.cbCloseEditOnApply = new System.Windows.Forms.CheckBox(); this.groupBox10 = new System.Windows.Forms.GroupBox(); this.btnPixelEditorDrainHoleColor = new System.Windows.Forms.Button(); this.btnPixelEditorDrainHoleHLColor = new System.Windows.Forms.Button(); @@ -173,8 +175,6 @@ this.cbLayerRepairLayersIslands = new System.Windows.Forms.CheckBox(); this.panel1 = new System.Windows.Forms.Panel(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); - this.cbCloseEditOnApply = new System.Windows.Forms.CheckBox(); - this.cbHidePLTooltips = new System.Windows.Forms.CheckBox(); this.groupBox3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nmResinTrapBinaryThreshold)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nmResinTrapMaximumPixelBrightnessToDrain)).BeginInit(); @@ -1654,7 +1654,7 @@ // // groupBox9 // - this.groupBox9.Controls.Add(this.cbHidePLTooltips); + this.groupBox9.Controls.Add(this.cbShowLayerTooltipsOverlay); this.groupBox9.Controls.Add(this.cbLayerAutoRotateBestView); this.groupBox9.Controls.Add(this.cbLayerZoomToFit); this.groupBox9.Location = new System.Drawing.Point(5, 483); @@ -1664,6 +1664,17 @@ this.groupBox9.TabStop = false; this.groupBox9.Text = "Miscellaneous"; // + // cbShowLayerTooltipsOverlay + // + this.cbShowLayerTooltipsOverlay.AutoSize = true; + this.cbShowLayerTooltipsOverlay.Location = new System.Drawing.Point(393, 27); + this.cbShowLayerTooltipsOverlay.Name = "cbShowLayerTooltipsOverlay"; + this.cbShowLayerTooltipsOverlay.Size = new System.Drawing.Size(206, 22); + this.cbShowLayerTooltipsOverlay.TabIndex = 4; + this.cbShowLayerTooltipsOverlay.Text = "Show preview layer tooltips"; + this.toolTip.SetToolTip(this.cbShowLayerTooltipsOverlay, "Show or hide layer preview tooltips for select, ROI, and pixel edit modes."); + this.cbShowLayerTooltipsOverlay.UseVisualStyleBackColor = true; + // // cbLayerAutoRotateBestView // this.cbLayerAutoRotateBestView.AutoSize = true; @@ -1678,7 +1689,7 @@ // cbLayerZoomToFit // this.cbLayerZoomToFit.AutoSize = true; - this.cbLayerZoomToFit.Location = new System.Drawing.Point(217, 27); + this.cbLayerZoomToFit.Location = new System.Drawing.Point(208, 27); this.cbLayerZoomToFit.Name = "cbLayerZoomToFit"; this.cbLayerZoomToFit.Size = new System.Drawing.Size(152, 22); this.cbLayerZoomToFit.TabIndex = 3; @@ -2070,28 +2081,6 @@ this.toolTip.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info; this.toolTip.ToolTipTitle = "Information"; // - // cbCloseEditOnApply - // - this.cbCloseEditOnApply.AutoSize = true; - this.cbCloseEditOnApply.Location = new System.Drawing.Point(11, 213); - this.cbCloseEditOnApply.Name = "cbCloseEditOnApply"; - this.cbCloseEditOnApply.Size = new System.Drawing.Size(322, 22); - this.cbCloseEditOnApply.TabIndex = 25; - this.cbCloseEditOnApply.Text = "Close pixel editor after operations are applied"; - this.toolTip.SetToolTip(this.cbCloseEditOnApply, "Automatically close pixel editor after applying changes"); - this.cbCloseEditOnApply.UseVisualStyleBackColor = true; - // - // cbHidePLTooltips - // - this.cbHidePLTooltips.AutoSize = true; - this.cbHidePLTooltips.Location = new System.Drawing.Point(404, 27); - this.cbHidePLTooltips.Name = "cbHidePLTooltips"; - this.cbHidePLTooltips.Size = new System.Drawing.Size(198, 22); - this.cbHidePLTooltips.TabIndex = 4; - this.cbHidePLTooltips.Text = "Hide preview layer tooltips"; - this.toolTip.SetToolTip(this.cbHidePLTooltips, "Show or hide layer preview tooltips for select, ROI, and pixel edit modes."); - this.cbHidePLTooltips.UseVisualStyleBackColor = true; - // // FrmSettings // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); @@ -2304,6 +2293,6 @@ private System.Windows.Forms.Button btnPixelEditorAddPixelColor; private System.Windows.Forms.Button btnPixelEditorAddPixelHLColor; private System.Windows.Forms.CheckBox cbCloseEditOnApply; - private System.Windows.Forms.CheckBox cbHidePLTooltips; + private System.Windows.Forms.CheckBox cbShowLayerTooltipsOverlay; } } diff --git a/UVtools.GUI/Forms/FrmSettings.cs b/UVtools.GUI/Forms/FrmSettings.cs index 24dd870..5bebf38 100644 --- a/UVtools.GUI/Forms/FrmSettings.cs +++ b/UVtools.GUI/Forms/FrmSettings.cs @@ -74,7 +74,7 @@ namespace UVtools.GUI.Forms cbLayerAutoRotateBestView.Checked = Settings.Default.LayerAutoRotateBestView; cbLayerZoomToFit.Checked = Settings.Default.LayerZoomToFit; - cbHidePLTooltips.Checked = Settings.Default.HidePLTooltips; + cbShowLayerTooltipsOverlay.Checked = Settings.Default.ShowLayerTooltipsOverlay; cbZoomToFit.SelectedIndex = Settings.Default.ZoomToFitPrintVolumeBounds == true ? 0 : 1; cbZoomIssues.Checked = Settings.Default.ZoomIssues; @@ -257,7 +257,7 @@ namespace UVtools.GUI.Forms Settings.Default.LayerAutoRotateBestView = cbLayerAutoRotateBestView.Checked; Settings.Default.LayerZoomToFit = cbLayerZoomToFit.Checked; - Settings.Default.HidePLTooltips = cbHidePLTooltips.Checked; + Settings.Default.ShowLayerTooltipsOverlay = cbShowLayerTooltipsOverlay.Checked; Settings.Default.ZoomToFitPrintVolumeBounds = cbZoomToFit.SelectedIndex == 0 ? true : false; Settings.Default.ZoomIssues = cbZoomIssues.Checked; Settings.Default.ZoomLockLevel = (byte)cbZoomLockLevel.SelectedIndex; diff --git a/UVtools.GUI/FrmMain.Designer.cs b/UVtools.GUI/FrmMain.Designer.cs index 627849f..75a5239 100644 --- a/UVtools.GUI/FrmMain.Designer.cs +++ b/UVtools.GUI/FrmMain.Designer.cs @@ -87,17 +87,19 @@ namespace UVtools.GUI this.tsLayerInfo = new System.Windows.Forms.ToolStrip(); this.tsLayerPreviewTime = new System.Windows.Forms.ToolStripLabel(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); - this.tsLayerResolution = new System.Windows.Forms.ToolStripLabel(); + this.btnLayerResolution = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator(); this.tsLayerImageZoomLock = new System.Windows.Forms.ToolStripLabel(); this.tsLayerImageZoom = new System.Windows.Forms.ToolStripLabel(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); this.tsLayerImagePanLocation = new System.Windows.Forms.ToolStripLabel(); this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator(); - this.tsLayerImageMouseLocation = new System.Windows.Forms.ToolStripLabel(); this.tsLayerImagePixelCount = new System.Windows.Forms.ToolStripLabel(); this.toolStripSeparator17 = new System.Windows.Forms.ToolStripSeparator(); - this.tsLayerBounds = new System.Windows.Forms.ToolStripLabel(); + this.btnLayerBounds = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator27 = new System.Windows.Forms.ToolStripSeparator(); + this.btnLayerROI = new System.Windows.Forms.ToolStripButton(); + this.btnLayerMouseLocation = new System.Windows.Forms.ToolStripButton(); this.tabControlLeft = new System.Windows.Forms.TabControl(); this.tbpThumbnailsAndInfo = new System.Windows.Forms.TabPage(); this.scLeft = new System.Windows.Forms.SplitContainer(); @@ -630,6 +632,7 @@ namespace UVtools.GUI this.pbLayer.ShowPixelGrid = true; this.pbLayer.Size = new System.Drawing.Size(1176, 705); this.pbLayer.TabIndex = 7; + this.pbLayer.SelectionRegionChanged += new System.EventHandler(this.pbLayer_SelectionRegionChanged); this.pbLayer.Zoomed += new System.EventHandler<Cyotek.Windows.Forms.ImageBoxZoomEventArgs>(this.pbLayer_Zoomed); this.pbLayer.KeyUp += new System.Windows.Forms.KeyEventHandler(this.EventKeyUp); this.pbLayer.MouseClick += new System.Windows.Forms.MouseEventHandler(this.EventMouseClick); @@ -849,17 +852,19 @@ namespace UVtools.GUI this.tsLayerInfo.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tsLayerPreviewTime, this.toolStripSeparator6, - this.tsLayerResolution, + this.btnLayerResolution, this.toolStripSeparator11, this.tsLayerImageZoomLock, this.tsLayerImageZoom, this.toolStripSeparator8, this.tsLayerImagePanLocation, this.toolStripSeparator16, - this.tsLayerImageMouseLocation, this.tsLayerImagePixelCount, this.toolStripSeparator17, - this.tsLayerBounds}); + this.btnLayerBounds, + this.toolStripSeparator27, + this.btnLayerROI, + this.btnLayerMouseLocation}); this.tsLayerInfo.Location = new System.Drawing.Point(0, 0); this.tsLayerInfo.Name = "tsLayerInfo"; this.tsLayerInfo.Size = new System.Drawing.Size(1176, 25); @@ -880,14 +885,16 @@ namespace UVtools.GUI this.toolStripSeparator6.Name = "toolStripSeparator6"; this.toolStripSeparator6.Size = new System.Drawing.Size(6, 25); // - // tsLayerResolution + // btnLayerResolution // - this.tsLayerResolution.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.tsLayerResolution.Image = global::UVtools.GUI.Properties.Resources.expand_16x16; - this.tsLayerResolution.Name = "tsLayerResolution"; - this.tsLayerResolution.Size = new System.Drawing.Size(79, 22); - this.tsLayerResolution.Text = "Resolution"; - this.tsLayerResolution.ToolTipText = "Layer Resolution"; + this.btnLayerResolution.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.btnLayerResolution.Image = global::UVtools.GUI.Properties.Resources.expand_16x16; + this.btnLayerResolution.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnLayerResolution.Name = "btnLayerResolution"; + this.btnLayerResolution.Size = new System.Drawing.Size(86, 22); + this.btnLayerResolution.Text = "Resolution:"; + this.btnLayerResolution.ToolTipText = "Layer Resolution"; + this.btnLayerResolution.Click += new System.EventHandler(this.EventClick); // // toolStripSeparator11 // @@ -926,7 +933,7 @@ namespace UVtools.GUI // tsLayerImagePanLocation // this.tsLayerImagePanLocation.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.tsLayerImagePanLocation.Image = global::UVtools.GUI.Properties.Resources.map_marker_16x16; + this.tsLayerImagePanLocation.Image = global::UVtools.GUI.Properties.Resources.move_16x16; this.tsLayerImagePanLocation.Name = "tsLayerImagePanLocation"; this.tsLayerImagePanLocation.Size = new System.Drawing.Size(79, 22); this.tsLayerImagePanLocation.Text = "{X=0, Y=0}"; @@ -939,16 +946,6 @@ namespace UVtools.GUI this.toolStripSeparator16.Name = "toolStripSeparator16"; this.toolStripSeparator16.Size = new System.Drawing.Size(6, 25); // - // tsLayerImageMouseLocation - // - this.tsLayerImageMouseLocation.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.tsLayerImageMouseLocation.Image = global::UVtools.GUI.Properties.Resources.map_marker_16x16; - this.tsLayerImageMouseLocation.Name = "tsLayerImageMouseLocation"; - this.tsLayerImageMouseLocation.Size = new System.Drawing.Size(79, 22); - this.tsLayerImageMouseLocation.Text = "{X=0, Y=0}"; - this.tsLayerImageMouseLocation.ToolTipText = "Mouse over pixel location and pixel brightness\r\nUse SHIFT while move mouse hover " + - "pixels"; - // // tsLayerImagePixelCount // this.tsLayerImagePixelCount.Image = global::UVtools.GUI.Properties.Resources.pixel_16x16; @@ -963,13 +960,45 @@ namespace UVtools.GUI this.toolStripSeparator17.Name = "toolStripSeparator17"; this.toolStripSeparator17.Size = new System.Drawing.Size(6, 25); // - // tsLayerBounds - // - this.tsLayerBounds.Image = global::UVtools.GUI.Properties.Resources.expand_16x16; - this.tsLayerBounds.Name = "tsLayerBounds"; - this.tsLayerBounds.Size = new System.Drawing.Size(66, 22); - this.tsLayerBounds.Text = "Bounds:"; - this.tsLayerBounds.ToolTipText = "Image bounds for this layer only, position and size"; + // btnLayerBounds + // + this.btnLayerBounds.Image = global::UVtools.GUI.Properties.Resources.expand_16x16; + this.btnLayerBounds.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnLayerBounds.Name = "btnLayerBounds"; + this.btnLayerBounds.Size = new System.Drawing.Size(70, 22); + this.btnLayerBounds.Text = "Bounds:"; + this.btnLayerBounds.ToolTipText = "Object volume bounds for current layer, position and size\r\nClick: go to region"; + this.btnLayerBounds.Click += new System.EventHandler(this.EventClick); + // + // toolStripSeparator27 + // + this.toolStripSeparator27.Name = "toolStripSeparator27"; + this.toolStripSeparator27.Size = new System.Drawing.Size(6, 25); + // + // btnLayerROI + // + this.btnLayerROI.Enabled = false; + this.btnLayerROI.Image = global::UVtools.GUI.Properties.Resources.object_group_16x16; + this.btnLayerROI.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnLayerROI.Name = "btnLayerROI"; + this.btnLayerROI.Size = new System.Drawing.Size(67, 22); + this.btnLayerROI.Text = "ROI: NS"; + this.btnLayerROI.ToolTipText = "Region of interest selection over layer. (NS): Not selected\r\nClick: go to region" + + ""; + this.btnLayerROI.Click += new System.EventHandler(this.EventClick); + // + // btnLayerMouseLocation + // + this.btnLayerMouseLocation.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.btnLayerMouseLocation.Enabled = false; + this.btnLayerMouseLocation.Image = global::UVtools.GUI.Properties.Resources.map_marker_16x16; + this.btnLayerMouseLocation.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnLayerMouseLocation.Name = "btnLayerMouseLocation"; + this.btnLayerMouseLocation.Size = new System.Drawing.Size(83, 22); + this.btnLayerMouseLocation.Text = "{X=0, Y=0}"; + this.btnLayerMouseLocation.ToolTipText = "Pixel picker: Use CONTROL and over a pixel to get his position and brightness\r\nCl" + + "ick: Center at position"; + this.btnLayerMouseLocation.Click += new System.EventHandler(this.EventClick); // // tabControlLeft // @@ -3157,16 +3186,13 @@ namespace UVtools.GUI private System.Windows.Forms.ToolStrip tsLayerInfo; private System.Windows.Forms.ToolStripLabel tsLayerPreviewTime; private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; - private System.Windows.Forms.ToolStripLabel tsLayerResolution; private System.Windows.Forms.ToolStripSeparator toolStripSeparator11; private System.Windows.Forms.ToolStripLabel tsLayerImageZoom; private System.Windows.Forms.ToolStripSeparator toolStripSeparator8; private System.Windows.Forms.ToolStripLabel tsLayerImagePanLocation; private System.Windows.Forms.ToolStripSeparator toolStripSeparator16; - private System.Windows.Forms.ToolStripLabel tsLayerImageMouseLocation; private System.Windows.Forms.ToolStripLabel tsLayerImagePixelCount; private System.Windows.Forms.ToolStripSeparator toolStripSeparator17; - private System.Windows.Forms.ToolStripLabel tsLayerBounds; private System.Windows.Forms.ToolStripMenuItem menuHelpBenchmark; private System.Windows.Forms.ToolStripSeparator toolStripSeparator24; private System.Windows.Forms.ToolStripLabel tsLayerImageZoomLock; @@ -3180,6 +3206,11 @@ namespace UVtools.GUI private System.Windows.Forms.ToolStripButton btnLogVerbose; private System.Windows.Forms.Label lbLayerImageOverlay; public Cyotek.Windows.Forms.ImageBox pbLayer; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator27; + private System.Windows.Forms.ToolStripButton btnLayerROI; + private System.Windows.Forms.ToolStripButton btnLayerBounds; + private System.Windows.Forms.ToolStripButton btnLayerMouseLocation; + private System.Windows.Forms.ToolStripButton btnLayerResolution; } } diff --git a/UVtools.GUI/FrmMain.cs b/UVtools.GUI/FrmMain.cs index 488042c..c75ac46 100644 --- a/UVtools.GUI/FrmMain.cs +++ b/UVtools.GUI/FrmMain.cs @@ -15,7 +15,6 @@ using System.IO; using System.Linq; using System.Net; using System.Reflection; -using System.Runtime.Remoting.Messaging; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; @@ -1454,6 +1453,36 @@ namespace UVtools.GUI return; } + + if (ReferenceEquals(sender, btnLayerBounds)) + { + CenterLayerAt(GetTransposedRectangle(SlicerFile[ActualLayer].BoundingRectangle), 0, true); + return; + } + + if (ReferenceEquals(sender, btnLayerROI)) + { + var roi = pbLayer.SelectionRegion; + if (roi.IsEmpty) return; + + CenterLayerAt(roi, 0, true); + return; + } + + if (ReferenceEquals(sender, btnLayerMouseLocation)) + { + if (btnLayerMouseLocation.Tag is Point point) + { + CenterLayerAt(point); + } + return; + } + + if (ReferenceEquals(sender, btnLayerResolution)) + { + pbLayer.ZoomToFit(); + return; + } } private void ValueChanged(object sender, EventArgs e) @@ -1610,8 +1639,10 @@ namespace UVtools.GUI if ((ModifierKeys & Keys.Control) != 0) { Point realLocation = GetTransposedPoint(location); - tsLayerImageMouseLocation.Text = + btnLayerMouseLocation.Text = $"{{X={realLocation.X}, Y={realLocation.Y}, B={ActualLayerImage.GetByte(realLocation)}}}"; + btnLayerMouseLocation.Tag = location; + btnLayerMouseLocation.Enabled = true; } if ((ModifierKeys & Keys.Shift) == 0) return; @@ -1794,12 +1825,13 @@ namespace UVtools.GUI } tsLayerImagePixelCount.Text = "Pixels: 0"; - tsLayerBounds.Text = "Bounds:"; - tsLayerImageMouseLocation.Text = "{X=0, Y=0}"; + btnLayerBounds.Text = "Bounds: (Unloaded)"; + btnLayerROI.Text = "ROI: (NA)"; + btnLayerMouseLocation.Text = "{X=0, Y=0}"; tsThumbnailsResolution.Text = tsLayerPreviewTime.Text = - tsLayerResolution.Text = + btnLayerResolution.Text = tsPropertiesLabelCount.Text = tsPropertiesLabelGroups.Text = string.Empty; @@ -1998,6 +2030,9 @@ namespace UVtools.GUI foreach (ToolStripItem item in tsLayerInfo.Items) { + if(ReferenceEquals(item, btnLayerROI) || + ReferenceEquals(item, btnLayerMouseLocation) + ) continue; item.Enabled = true; } @@ -2034,7 +2069,7 @@ namespace UVtools.GUI tabControlLeft.SelectedIndex = 0; - tsLayerResolution.Text = $"{{Width={SlicerFile.ResolutionX}, Height={SlicerFile.ResolutionY}}}"; + btnLayerResolution.Text = $"{{Width={SlicerFile.ResolutionX}, Height={SlicerFile.ResolutionY}}}"; UpdateLayerLimits(); ShowLayer(Math.Min(actualLayer, SlicerFile.LayerCount - 1)); @@ -2138,7 +2173,7 @@ namespace UVtools.GUI AddStatusBarItem(nameof(SlicerFile.MaterialName), SlicerFile.MaterialName); AddStatusBarItem(nameof(SlicerFile.MachineName), SlicerFile.MachineName); - tsLayerResolution.Text = ActualLayerImage.Size.ToString(); + btnLayerResolution.Text = ActualLayerImage.Size.ToString(); } private void UpdateGCode() @@ -2660,9 +2695,9 @@ namespace UVtools.GUI (float) Math.Round( layer.NonZeroPixelCount * 100f / (SlicerFile.ResolutionX * SlicerFile.ResolutionY), 2); tsLayerImagePixelCount.Text = $"Pixels: {layer.NonZeroPixelCount} ({pixelPercent}%)"; - tsLayerBounds.Text = $"Bounds: {layer.BoundingRectangle}"; + btnLayerBounds.Text = $"Bounds: {layer.BoundingRectangle}"; tsLayerImagePixelCount.Invalidate(); - tsLayerBounds.Invalidate(); + btnLayerBounds.Invalidate(); tsLayerInfo.Update(); tsLayerInfo.Refresh(); @@ -2821,8 +2856,7 @@ namespace UVtools.GUI "Press Esc to clear the ROI"; } - if (!Settings.Default.HidePLTooltips) - lbLayerImageOverlay.Visible = true; + lbLayerImageOverlay.Visible = Settings.Default.ShowLayerTooltipsOverlay; return; } @@ -2833,8 +2867,8 @@ namespace UVtools.GUI lbLayerImageOverlay.Text = "Issue selection mode:\n" + "» Click over a issue to select it"; - if (!Settings.Default.HidePLTooltips) - lbLayerImageOverlay.Visible = true; + lbLayerImageOverlay.Visible = Settings.Default.ShowLayerTooltipsOverlay; + return; } } @@ -3662,6 +3696,16 @@ namespace UVtools.GUI } /// <summary> + /// Centers layer view on a middle of a given rectangle + /// </summary> + /// <param name="rectangle">Rectangle holding coordinates and bounds</param> + /// <param name="zoomLevel">Zoom level to set, 0 to ignore or negative value to get current locked zoom level</param> + /// <param name="zoomToRegion">Auto zoom to a region and ensure that region area stays all visible when possible, when true this will overwrite zoomLevel</param></param> + public void CenterLayerAt(RectangleF rectangle, int zoomLevel = 0, bool zoomToRegion = false) => + CenterLayerAt(Rectangle.Round(rectangle), zoomLevel, zoomToRegion); + + + /// <summary> /// Centers layer view on a <see cref="Point"/> /// </summary> /// <param name="point">Point holding X and Y coordinates</param> @@ -4267,5 +4311,12 @@ namespace UVtools.GUI return true; } + + private void pbLayer_SelectionRegionChanged(object sender, EventArgs e) + { + var roi = ROI; + btnLayerROI.Text = roi.IsEmpty ? "ROI: (NS)" : $"ROI: {roi}"; + btnLayerROI.Enabled = !roi.IsEmpty; + } } } diff --git a/UVtools.GUI/FrmMain.resx b/UVtools.GUI/FrmMain.resx index c0d3023..25d6c29 100644 --- a/UVtools.GUI/FrmMain.resx +++ b/UVtools.GUI/FrmMain.resx @@ -129,12 +129,6 @@ <metadata name="tsLayerInfo.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>1773, 17</value> </metadata> - <metadata name="tsThumbnails.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>297, 17</value> - </metadata> - <metadata name="tsProperties.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>695, 17</value> - </metadata> <metadata name="tsGCode.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>1040, 17</value> </metadata> @@ -150,22 +144,6 @@ <metadata name="tsLog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>1587, 17</value> </metadata> - <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> - <data name="btnLogVerbose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value> - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== -</value> - </data> <metadata name="imageList16x16.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>811, 17</value> </metadata> @@ -174,7 +152,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABk - FAAAAk1TRnQBSQFMAgEBBgEAATgBCwE4AQsBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA + FAAAAk1TRnQBSQFMAgEBBgEAAZABCwGQAQsBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA AwABIAMAAQEBAAEgBgABIC4AAxgBIgMwAUsDMAFMAzIBUDMAAQEDJAE2AysBQqwAAyIBMQNWAbkDXQHi AwAB/wMAAf8BKgEtASgB/gNTAawDTQGVAwABARgAAwkBDAMzAVIDUAGdA1cB6AMAAf4DKwH8Ay8BSqQA AyEBMANZAewBKwEuASkB+gNRAfcDUgH0A1MB8QNIAfYDQQH5AwAB/wNPAZsDAAEBCAADFQEdAz8BbgNV @@ -264,6 +242,43 @@ AfwBPws= </value> </data> + <metadata name="tsThumbnails.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>297, 17</value> + </metadata> + <metadata name="tsProperties.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>695, 17</value> + </metadata> + <metadata name="tsGCode.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>1040, 17</value> + </metadata> + <metadata name="tsIssuesLv.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>1668, 17</value> + </metadata> + <metadata name="tsIssues.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>947, 17</value> + </metadata> + <metadata name="tsPixelEditorHistory.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>1430, 17</value> + </metadata> + <metadata name="tsLog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>1587, 17</value> + </metadata> + <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="btnLogVerbose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== +</value> + </data> <metadata name="toolTipInformation.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>1138, 17</value> </metadata> @@ -273,6 +288,9 @@ <metadata name="issueScrollTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>158, 17</value> </metadata> + <metadata name="toolTipInformation.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>1138, 17</value> + </metadata> <metadata name="layerScrollTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>1292, 17</value> </metadata> diff --git a/UVtools.GUI/Properties/AssemblyInfo.cs b/UVtools.GUI/Properties/AssemblyInfo.cs index 7d72103..9a0397f 100644 --- a/UVtools.GUI/Properties/AssemblyInfo.cs +++ b/UVtools.GUI/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.8.1.0")] -[assembly: AssemblyFileVersion("0.8.1.0")] +[assembly: AssemblyVersion("0.8.1.1")] +[assembly: AssemblyFileVersion("0.8.1.1")] diff --git a/UVtools.GUI/Properties/Settings.Designer.cs b/UVtools.GUI/Properties/Settings.Designer.cs index abcac97..1ca57ae 100644 --- a/UVtools.GUI/Properties/Settings.Designer.cs +++ b/UVtools.GUI/Properties/Settings.Designer.cs @@ -205,13 +205,13 @@ namespace UVtools.GUI.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool HidePLTooltips { + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool ShowLayerTooltipsOverlay { get { - return ((bool)(this["HidePLTooltips"])); + return ((bool)(this["ShowLayerTooltipsOverlay"])); } set { - this["HidePLTooltips"] = value; + this["ShowLayerTooltipsOverlay"] = value; } } diff --git a/UVtools.GUI/UVtools.GUI.csproj b/UVtools.GUI/UVtools.GUI.csproj index 6b26009..36123d7 100644 --- a/UVtools.GUI/UVtools.GUI.csproj +++ b/UVtools.GUI/UVtools.GUI.csproj @@ -500,7 +500,7 @@ <None Include="Images\minus_16x16.png" /> <None Include="Images\sync-16x16.png" /> <None Include="Images\object-group-16x16.png" /> - <None Include="Resources\aero_pen.cur" /> + <Content Include="Resources\pixel_edit.cur" /> <Content Include="UVtools.ico" /> <None Include="UVtools.png" /> <None Include="Images\Exit-16x16.png" /> |