Merge pull request #5088 from Jaex/master

fixed #5059: Added screen color picker info text option
This commit is contained in:
Jaex 2020-10-01 02:19:51 +03:00 committed by GitHub
commit e9e2385aaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 1730 additions and 1253 deletions

View file

@ -239,8 +239,7 @@ private void UpdateControls(MyColor color, ColorType type)
txtDecimal.Text = ColorHelpers.ColorToDecimal(color).ToString(); txtDecimal.Text = ColorHelpers.ColorToDecimal(color).ToString();
} }
Color knownColor = ColorHelpers.FindClosestKnownColor(color); lblNameValue.Text = ColorHelpers.GetColorName(color);
lblNameValue.Text = Helpers.GetProperName(knownColor.Name);
controlChangingColor = false; controlChangingColor = false;
} }

View file

@ -456,5 +456,11 @@ public static Color FindClosestKnownColor(Color color)
List<Color> colors = GetKnownColors(); List<Color> colors = GetKnownColors();
return colors.Aggregate(Color.Black, (accu, curr) => ColorDifference(color, curr) < ColorDifference(color, accu) ? curr : accu); return colors.Aggregate(Color.Black, (accu, curr) => ColorDifference(color, curr) < ColorDifference(color, accu) ? curr : accu);
} }
public static string GetColorName(Color color)
{
Color knownColor = FindClosestKnownColor(color);
return Helpers.GetProperName(knownColor.Name);
}
} }
} }

View file

@ -46,6 +46,7 @@ public class CodeMenuEntryPixelInfo : CodeMenuEntry
public static readonly CodeMenuEntryPixelInfo b1 = new CodeMenuEntryPixelInfo("b1", "Blue color (0-1). Specify decimal precision with {n}, defaults to 3."); public static readonly CodeMenuEntryPixelInfo b1 = new CodeMenuEntryPixelInfo("b1", "Blue color (0-1). Specify decimal precision with {n}, defaults to 3.");
public static readonly CodeMenuEntryPixelInfo hex = new CodeMenuEntryPixelInfo("hex", "Hex color value (Lowercase)"); public static readonly CodeMenuEntryPixelInfo hex = new CodeMenuEntryPixelInfo("hex", "Hex color value (Lowercase)");
public static readonly CodeMenuEntryPixelInfo HEX = new CodeMenuEntryPixelInfo("HEX", "Hex color value (Uppercase)"); public static readonly CodeMenuEntryPixelInfo HEX = new CodeMenuEntryPixelInfo("HEX", "Hex color value (Uppercase)");
public static readonly CodeMenuEntryPixelInfo name = new CodeMenuEntryPixelInfo("name", "Color name");
public static readonly CodeMenuEntryPixelInfo x = new CodeMenuEntryPixelInfo("x", "X position"); public static readonly CodeMenuEntryPixelInfo x = new CodeMenuEntryPixelInfo("x", "X position");
public static readonly CodeMenuEntryPixelInfo y = new CodeMenuEntryPixelInfo("y", "Y position"); public static readonly CodeMenuEntryPixelInfo y = new CodeMenuEntryPixelInfo("y", "Y position");
public static readonly CodeMenuEntryPixelInfo n = new CodeMenuEntryPixelInfo("n", "New line"); public static readonly CodeMenuEntryPixelInfo n = new CodeMenuEntryPixelInfo("n", "New line");
@ -61,6 +62,7 @@ public static string Parse(string input, Color color, Point position)
Replace(b255.ToPrefixString(), color.B.ToString(), StringComparison.InvariantCultureIgnoreCase). Replace(b255.ToPrefixString(), color.B.ToString(), StringComparison.InvariantCultureIgnoreCase).
Replace(HEX.ToPrefixString(), ColorHelpers.ColorToHex(color), StringComparison.InvariantCulture). Replace(HEX.ToPrefixString(), ColorHelpers.ColorToHex(color), StringComparison.InvariantCulture).
Replace(hex.ToPrefixString(), ColorHelpers.ColorToHex(color).ToLowerInvariant(), StringComparison.InvariantCultureIgnoreCase). Replace(hex.ToPrefixString(), ColorHelpers.ColorToHex(color).ToLowerInvariant(), StringComparison.InvariantCultureIgnoreCase).
Replace(name.ToPrefixString(), ColorHelpers.GetColorName(color), StringComparison.InvariantCultureIgnoreCase).
Replace(x.ToPrefixString(), position.X.ToString(), StringComparison.InvariantCultureIgnoreCase). Replace(x.ToPrefixString(), position.X.ToString(), StringComparison.InvariantCultureIgnoreCase).
Replace(y.ToPrefixString(), position.Y.ToString(), StringComparison.InvariantCultureIgnoreCase). Replace(y.ToPrefixString(), position.Y.ToString(), StringComparison.InvariantCultureIgnoreCase).
Replace(n.ToPrefixString(), Environment.NewLine, StringComparison.InvariantCultureIgnoreCase); Replace(n.ToPrefixString(), Environment.NewLine, StringComparison.InvariantCultureIgnoreCase);

View file

@ -1080,7 +1080,14 @@ private string GetInfoText()
{ {
Color color = ShapeManager.GetCurrentColor(); Color color = ShapeManager.GetCurrentColor();
if (Mode != RegionCaptureMode.ScreenColorPicker && !string.IsNullOrEmpty(Options.CustomInfoText)) if (Mode == RegionCaptureMode.ScreenColorPicker)
{
if (!string.IsNullOrEmpty(Options.ScreenColorPickerInfoText))
{
return CodeMenuEntryPixelInfo.Parse(Options.ScreenColorPickerInfoText, color, CurrentPosition);
}
}
else if (!string.IsNullOrEmpty(Options.CustomInfoText))
{ {
return CodeMenuEntryPixelInfo.Parse(Options.CustomInfoText, color, CurrentPosition); return CodeMenuEntryPixelInfo.Parse(Options.CustomInfoText, color, CurrentPosition);
} }

View file

@ -98,5 +98,8 @@ public class RegionCaptureOptions
public Color EditorCanvasColor = Color.Transparent; public Color EditorCanvasColor = Color.Transparent;
public List<ImageEffectPreset> ImageEffectPresets = new List<ImageEffectPreset>(); public List<ImageEffectPreset> ImageEffectPresets = new List<ImageEffectPreset>();
public int SelectedImageEffectPreset = 0; public int SelectedImageEffectPreset = 0;
// Screen color picker
public string ScreenColorPickerInfoText = "";
} }
} }

View file

@ -207,7 +207,8 @@ private static RegionCaptureOptions GetRegionCaptureOptions(RegionCaptureOptions
MagnifierPixelCount = options.MagnifierPixelCount, MagnifierPixelCount = options.MagnifierPixelCount,
MagnifierPixelSize = options.MagnifierPixelSize, MagnifierPixelSize = options.MagnifierPixelSize,
ShowCrosshair = options.ShowCrosshair, ShowCrosshair = options.ShowCrosshair,
AnnotationOptions = options.AnnotationOptions AnnotationOptions = options.AnnotationOptions,
ScreenColorPickerInfoText = options.ScreenColorPickerInfoText
}; };
} }
} }

View file

@ -47,16 +47,12 @@ private void InitializeComponent()
this.chkOverrideCustomUploader = new System.Windows.Forms.CheckBox(); this.chkOverrideCustomUploader = new System.Windows.Forms.CheckBox();
this.chkOverrideFTP = new System.Windows.Forms.CheckBox(); this.chkOverrideFTP = new System.Windows.Forms.CheckBox();
this.cboFTPaccounts = new System.Windows.Forms.ComboBox(); this.cboFTPaccounts = new System.Windows.Forms.ComboBox();
this.btnAfterCapture = new ShareX.HelpersLib.MenuButton();
this.btnAfterUpload = new ShareX.HelpersLib.MenuButton();
this.btnDestinations = new ShareX.HelpersLib.MenuButton();
this.cmsDestinations = new System.Windows.Forms.ContextMenuStrip(this.components); this.cmsDestinations = new System.Windows.Forms.ContextMenuStrip(this.components);
this.tsmiImageUploaders = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiImageUploaders = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiTextUploaders = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiTextUploaders = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiFileUploaders = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiFileUploaders = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiURLShorteners = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiURLShorteners = new System.Windows.Forms.ToolStripMenuItem();
this.tsmiURLSharingServices = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiURLSharingServices = new System.Windows.Forms.ToolStripMenuItem();
this.btnTask = new ShareX.HelpersLib.MenuButton();
this.tpGeneral = new System.Windows.Forms.TabPage(); this.tpGeneral = new System.Windows.Forms.TabPage();
this.pGeneral = new System.Windows.Forms.Panel(); this.pGeneral = new System.Windows.Forms.Panel();
this.lblAfterTaskNotification = new System.Windows.Forms.Label(); this.lblAfterTaskNotification = new System.Windows.Forms.Label();
@ -190,6 +186,11 @@ private void InitializeComponent()
this.tpUploadMain = new System.Windows.Forms.TabPage(); this.tpUploadMain = new System.Windows.Forms.TabPage();
this.chkOverrideUploadSettings = new System.Windows.Forms.CheckBox(); this.chkOverrideUploadSettings = new System.Windows.Forms.CheckBox();
this.tpFileNaming = new System.Windows.Forms.TabPage(); this.tpFileNaming = new System.Windows.Forms.TabPage();
this.txtURLRegexReplaceReplacement = new System.Windows.Forms.TextBox();
this.lblURLRegexReplaceReplacement = new System.Windows.Forms.Label();
this.txtURLRegexReplacePattern = new System.Windows.Forms.TextBox();
this.lblURLRegexReplacePattern = new System.Windows.Forms.Label();
this.cbURLRegexReplace = new System.Windows.Forms.CheckBox();
this.btnAutoIncrementNumber = new System.Windows.Forms.Button(); this.btnAutoIncrementNumber = new System.Windows.Forms.Button();
this.lblAutoIncrementNumber = new System.Windows.Forms.Label(); this.lblAutoIncrementNumber = new System.Windows.Forms.Label();
this.nudAutoIncrementNumber = new System.Windows.Forms.NumericUpDown(); this.nudAutoIncrementNumber = new System.Windows.Forms.NumericUpDown();
@ -210,9 +211,6 @@ private void InitializeComponent()
this.cbClipboardUploadAutoIndexFolder = new System.Windows.Forms.CheckBox(); this.cbClipboardUploadAutoIndexFolder = new System.Windows.Forms.CheckBox();
this.cbClipboardUploadShortenURL = new System.Windows.Forms.CheckBox(); this.cbClipboardUploadShortenURL = new System.Windows.Forms.CheckBox();
this.tpUploaderFilters = new System.Windows.Forms.TabPage(); this.tpUploaderFilters = new System.Windows.Forms.TabPage();
this.lvUploaderFiltersList = new ShareX.HelpersLib.MyListView();
this.chUploaderFiltersName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chUploaderFiltersExtension = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.btnUploaderFiltersRemove = new System.Windows.Forms.Button(); this.btnUploaderFiltersRemove = new System.Windows.Forms.Button();
this.btnUploaderFiltersUpdate = new System.Windows.Forms.Button(); this.btnUploaderFiltersUpdate = new System.Windows.Forms.Button();
this.btnUploaderFiltersAdd = new System.Windows.Forms.Button(); this.btnUploaderFiltersAdd = new System.Windows.Forms.Button();
@ -226,11 +224,6 @@ private void InitializeComponent()
this.lblActionsNote = new System.Windows.Forms.Label(); this.lblActionsNote = new System.Windows.Forms.Label();
this.btnActionsDuplicate = new System.Windows.Forms.Button(); this.btnActionsDuplicate = new System.Windows.Forms.Button();
this.btnActionsAdd = new System.Windows.Forms.Button(); this.btnActionsAdd = new System.Windows.Forms.Button();
this.lvActions = new ShareX.HelpersLib.MyListView();
this.chActionsName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chActionsPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chActionsArgs = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chActionsExtensions = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.btnActionsEdit = new System.Windows.Forms.Button(); this.btnActionsEdit = new System.Windows.Forms.Button();
this.btnActionsRemove = new System.Windows.Forms.Button(); this.btnActionsRemove = new System.Windows.Forms.Button();
this.chkOverrideActions = new System.Windows.Forms.CheckBox(); this.chkOverrideActions = new System.Windows.Forms.CheckBox();
@ -251,12 +244,21 @@ private void InitializeComponent()
this.tpAdvanced = new System.Windows.Forms.TabPage(); this.tpAdvanced = new System.Windows.Forms.TabPage();
this.pgTaskSettings = new System.Windows.Forms.PropertyGrid(); this.pgTaskSettings = new System.Windows.Forms.PropertyGrid();
this.chkOverrideAdvancedSettings = new System.Windows.Forms.CheckBox(); this.chkOverrideAdvancedSettings = new System.Windows.Forms.CheckBox();
this.btnAfterCapture = new ShareX.HelpersLib.MenuButton();
this.btnAfterUpload = new ShareX.HelpersLib.MenuButton();
this.btnDestinations = new ShareX.HelpersLib.MenuButton();
this.btnTask = new ShareX.HelpersLib.MenuButton();
this.lvUploaderFiltersList = new ShareX.HelpersLib.MyListView();
this.chUploaderFiltersName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chUploaderFiltersExtension = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.lvActions = new ShareX.HelpersLib.MyListView();
this.chActionsName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chActionsPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chActionsArgs = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.chActionsExtensions = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tttvMain = new ShareX.HelpersLib.TabToTreeView(); this.tttvMain = new ShareX.HelpersLib.TabToTreeView();
this.cbURLRegexReplace = new System.Windows.Forms.CheckBox(); this.lblToolsScreenColorPickerInfoText = new System.Windows.Forms.Label();
this.lblURLRegexReplacePattern = new System.Windows.Forms.Label(); this.txtToolsScreenColorPickerInfoText = new System.Windows.Forms.TextBox();
this.txtURLRegexReplacePattern = new System.Windows.Forms.TextBox();
this.lblURLRegexReplaceReplacement = new System.Windows.Forms.Label();
this.txtURLRegexReplaceReplacement = new System.Windows.Forms.TextBox();
this.tcTaskSettings.SuspendLayout(); this.tcTaskSettings.SuspendLayout();
this.tpTask.SuspendLayout(); this.tpTask.SuspendLayout();
this.cmsDestinations.SuspendLayout(); this.cmsDestinations.SuspendLayout();
@ -446,30 +448,6 @@ private void InitializeComponent()
this.cboFTPaccounts.Name = "cboFTPaccounts"; this.cboFTPaccounts.Name = "cboFTPaccounts";
this.cboFTPaccounts.SelectedIndexChanged += new System.EventHandler(this.cboFTPaccounts_SelectedIndexChanged); this.cboFTPaccounts.SelectedIndexChanged += new System.EventHandler(this.cboFTPaccounts_SelectedIndexChanged);
// //
// btnAfterCapture
//
resources.ApplyResources(this.btnAfterCapture, "btnAfterCapture");
this.btnAfterCapture.Menu = this.cmsAfterCapture;
this.btnAfterCapture.Name = "btnAfterCapture";
this.btnAfterCapture.UseMnemonic = false;
this.btnAfterCapture.UseVisualStyleBackColor = true;
//
// btnAfterUpload
//
resources.ApplyResources(this.btnAfterUpload, "btnAfterUpload");
this.btnAfterUpload.Menu = this.cmsAfterUpload;
this.btnAfterUpload.Name = "btnAfterUpload";
this.btnAfterUpload.UseMnemonic = false;
this.btnAfterUpload.UseVisualStyleBackColor = true;
//
// btnDestinations
//
resources.ApplyResources(this.btnDestinations, "btnDestinations");
this.btnDestinations.Menu = this.cmsDestinations;
this.btnDestinations.Name = "btnDestinations";
this.btnDestinations.UseMnemonic = false;
this.btnDestinations.UseVisualStyleBackColor = true;
//
// cmsDestinations // cmsDestinations
// //
this.cmsDestinations.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cmsDestinations.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -511,14 +489,6 @@ private void InitializeComponent()
this.tsmiURLSharingServices.Name = "tsmiURLSharingServices"; this.tsmiURLSharingServices.Name = "tsmiURLSharingServices";
resources.ApplyResources(this.tsmiURLSharingServices, "tsmiURLSharingServices"); resources.ApplyResources(this.tsmiURLSharingServices, "tsmiURLSharingServices");
// //
// btnTask
//
resources.ApplyResources(this.btnTask, "btnTask");
this.btnTask.Menu = this.cmsTask;
this.btnTask.Name = "btnTask";
this.btnTask.UseMnemonic = false;
this.btnTask.UseVisualStyleBackColor = true;
//
// tpGeneral // tpGeneral
// //
this.tpGeneral.BackColor = System.Drawing.SystemColors.Window; this.tpGeneral.BackColor = System.Drawing.SystemColors.Window;
@ -1718,6 +1688,35 @@ private void InitializeComponent()
resources.ApplyResources(this.tpFileNaming, "tpFileNaming"); resources.ApplyResources(this.tpFileNaming, "tpFileNaming");
this.tpFileNaming.Name = "tpFileNaming"; this.tpFileNaming.Name = "tpFileNaming";
// //
// txtURLRegexReplaceReplacement
//
resources.ApplyResources(this.txtURLRegexReplaceReplacement, "txtURLRegexReplaceReplacement");
this.txtURLRegexReplaceReplacement.Name = "txtURLRegexReplaceReplacement";
this.txtURLRegexReplaceReplacement.TextChanged += new System.EventHandler(this.txtURLRegexReplaceReplacement_TextChanged);
//
// lblURLRegexReplaceReplacement
//
resources.ApplyResources(this.lblURLRegexReplaceReplacement, "lblURLRegexReplaceReplacement");
this.lblURLRegexReplaceReplacement.Name = "lblURLRegexReplaceReplacement";
//
// txtURLRegexReplacePattern
//
resources.ApplyResources(this.txtURLRegexReplacePattern, "txtURLRegexReplacePattern");
this.txtURLRegexReplacePattern.Name = "txtURLRegexReplacePattern";
this.txtURLRegexReplacePattern.TextChanged += new System.EventHandler(this.txtURLRegexReplacePattern_TextChanged);
//
// lblURLRegexReplacePattern
//
resources.ApplyResources(this.lblURLRegexReplacePattern, "lblURLRegexReplacePattern");
this.lblURLRegexReplacePattern.Name = "lblURLRegexReplacePattern";
//
// cbURLRegexReplace
//
resources.ApplyResources(this.cbURLRegexReplace, "cbURLRegexReplace");
this.cbURLRegexReplace.Name = "cbURLRegexReplace";
this.cbURLRegexReplace.UseVisualStyleBackColor = true;
this.cbURLRegexReplace.CheckedChanged += new System.EventHandler(this.cbURLRegexReplace_CheckedChanged);
//
// btnAutoIncrementNumber // btnAutoIncrementNumber
// //
resources.ApplyResources(this.btnAutoIncrementNumber, "btnAutoIncrementNumber"); resources.ApplyResources(this.btnAutoIncrementNumber, "btnAutoIncrementNumber");
@ -1861,28 +1860,6 @@ private void InitializeComponent()
resources.ApplyResources(this.tpUploaderFilters, "tpUploaderFilters"); resources.ApplyResources(this.tpUploaderFilters, "tpUploaderFilters");
this.tpUploaderFilters.Name = "tpUploaderFilters"; this.tpUploaderFilters.Name = "tpUploaderFilters";
// //
// lvUploaderFiltersList
//
resources.ApplyResources(this.lvUploaderFiltersList, "lvUploaderFiltersList");
this.lvUploaderFiltersList.AutoFillColumn = true;
this.lvUploaderFiltersList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.chUploaderFiltersName,
this.chUploaderFiltersExtension});
this.lvUploaderFiltersList.FullRowSelect = true;
this.lvUploaderFiltersList.HideSelection = false;
this.lvUploaderFiltersList.Name = "lvUploaderFiltersList";
this.lvUploaderFiltersList.UseCompatibleStateImageBehavior = false;
this.lvUploaderFiltersList.View = System.Windows.Forms.View.Details;
this.lvUploaderFiltersList.SelectedIndexChanged += new System.EventHandler(this.lvUploaderFiltersList_SelectedIndexChanged);
//
// chUploaderFiltersName
//
resources.ApplyResources(this.chUploaderFiltersName, "chUploaderFiltersName");
//
// chUploaderFiltersExtension
//
resources.ApplyResources(this.chUploaderFiltersExtension, "chUploaderFiltersExtension");
//
// btnUploaderFiltersRemove // btnUploaderFiltersRemove
// //
resources.ApplyResources(this.btnUploaderFiltersRemove, "btnUploaderFiltersRemove"); resources.ApplyResources(this.btnUploaderFiltersRemove, "btnUploaderFiltersRemove");
@ -1969,44 +1946,6 @@ private void InitializeComponent()
this.btnActionsAdd.UseVisualStyleBackColor = true; this.btnActionsAdd.UseVisualStyleBackColor = true;
this.btnActionsAdd.Click += new System.EventHandler(this.btnActionsAdd_Click); this.btnActionsAdd.Click += new System.EventHandler(this.btnActionsAdd_Click);
// //
// lvActions
//
this.lvActions.AllowDrop = true;
this.lvActions.AllowItemDrag = true;
resources.ApplyResources(this.lvActions, "lvActions");
this.lvActions.AutoFillColumn = true;
this.lvActions.CheckBoxes = true;
this.lvActions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.chActionsName,
this.chActionsPath,
this.chActionsArgs,
this.chActionsExtensions});
this.lvActions.FullRowSelect = true;
this.lvActions.HideSelection = false;
this.lvActions.MultiSelect = false;
this.lvActions.Name = "lvActions";
this.lvActions.UseCompatibleStateImageBehavior = false;
this.lvActions.View = System.Windows.Forms.View.Details;
this.lvActions.ItemMoved += new ShareX.HelpersLib.MyListView.ListViewItemMovedEventHandler(this.lvActions_ItemMoved);
this.lvActions.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvActions_ItemChecked);
this.lvActions.SelectedIndexChanged += new System.EventHandler(this.lvActions_SelectedIndexChanged);
//
// chActionsName
//
resources.ApplyResources(this.chActionsName, "chActionsName");
//
// chActionsPath
//
resources.ApplyResources(this.chActionsPath, "chActionsPath");
//
// chActionsArgs
//
resources.ApplyResources(this.chActionsArgs, "chActionsArgs");
//
// chActionsExtensions
//
resources.ApplyResources(this.chActionsExtensions, "chActionsExtensions");
//
// btnActionsEdit // btnActionsEdit
// //
resources.ApplyResources(this.btnActionsEdit, "btnActionsEdit"); resources.ApplyResources(this.btnActionsEdit, "btnActionsEdit");
@ -2105,6 +2044,8 @@ private void InitializeComponent()
// //
// pTools // pTools
// //
this.pTools.Controls.Add(this.txtToolsScreenColorPickerInfoText);
this.pTools.Controls.Add(this.lblToolsScreenColorPickerInfoText);
this.pTools.Controls.Add(this.txtToolsScreenColorPickerFormat); this.pTools.Controls.Add(this.txtToolsScreenColorPickerFormat);
this.pTools.Controls.Add(this.lblToolsScreenColorPickerFormat); this.pTools.Controls.Add(this.lblToolsScreenColorPickerFormat);
resources.ApplyResources(this.pTools, "pTools"); resources.ApplyResources(this.pTools, "pTools");
@ -2154,6 +2095,98 @@ private void InitializeComponent()
this.chkOverrideAdvancedSettings.UseVisualStyleBackColor = true; this.chkOverrideAdvancedSettings.UseVisualStyleBackColor = true;
this.chkOverrideAdvancedSettings.CheckedChanged += new System.EventHandler(this.chkUseDefaultAdvancedSettings_CheckedChanged); this.chkOverrideAdvancedSettings.CheckedChanged += new System.EventHandler(this.chkUseDefaultAdvancedSettings_CheckedChanged);
// //
// btnAfterCapture
//
resources.ApplyResources(this.btnAfterCapture, "btnAfterCapture");
this.btnAfterCapture.Menu = this.cmsAfterCapture;
this.btnAfterCapture.Name = "btnAfterCapture";
this.btnAfterCapture.UseMnemonic = false;
this.btnAfterCapture.UseVisualStyleBackColor = true;
//
// btnAfterUpload
//
resources.ApplyResources(this.btnAfterUpload, "btnAfterUpload");
this.btnAfterUpload.Menu = this.cmsAfterUpload;
this.btnAfterUpload.Name = "btnAfterUpload";
this.btnAfterUpload.UseMnemonic = false;
this.btnAfterUpload.UseVisualStyleBackColor = true;
//
// btnDestinations
//
resources.ApplyResources(this.btnDestinations, "btnDestinations");
this.btnDestinations.Menu = this.cmsDestinations;
this.btnDestinations.Name = "btnDestinations";
this.btnDestinations.UseMnemonic = false;
this.btnDestinations.UseVisualStyleBackColor = true;
//
// btnTask
//
resources.ApplyResources(this.btnTask, "btnTask");
this.btnTask.Menu = this.cmsTask;
this.btnTask.Name = "btnTask";
this.btnTask.UseMnemonic = false;
this.btnTask.UseVisualStyleBackColor = true;
//
// lvUploaderFiltersList
//
resources.ApplyResources(this.lvUploaderFiltersList, "lvUploaderFiltersList");
this.lvUploaderFiltersList.AutoFillColumn = true;
this.lvUploaderFiltersList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.chUploaderFiltersName,
this.chUploaderFiltersExtension});
this.lvUploaderFiltersList.FullRowSelect = true;
this.lvUploaderFiltersList.HideSelection = false;
this.lvUploaderFiltersList.Name = "lvUploaderFiltersList";
this.lvUploaderFiltersList.UseCompatibleStateImageBehavior = false;
this.lvUploaderFiltersList.View = System.Windows.Forms.View.Details;
this.lvUploaderFiltersList.SelectedIndexChanged += new System.EventHandler(this.lvUploaderFiltersList_SelectedIndexChanged);
//
// chUploaderFiltersName
//
resources.ApplyResources(this.chUploaderFiltersName, "chUploaderFiltersName");
//
// chUploaderFiltersExtension
//
resources.ApplyResources(this.chUploaderFiltersExtension, "chUploaderFiltersExtension");
//
// lvActions
//
this.lvActions.AllowDrop = true;
this.lvActions.AllowItemDrag = true;
resources.ApplyResources(this.lvActions, "lvActions");
this.lvActions.AutoFillColumn = true;
this.lvActions.CheckBoxes = true;
this.lvActions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.chActionsName,
this.chActionsPath,
this.chActionsArgs,
this.chActionsExtensions});
this.lvActions.FullRowSelect = true;
this.lvActions.HideSelection = false;
this.lvActions.MultiSelect = false;
this.lvActions.Name = "lvActions";
this.lvActions.UseCompatibleStateImageBehavior = false;
this.lvActions.View = System.Windows.Forms.View.Details;
this.lvActions.ItemMoved += new ShareX.HelpersLib.MyListView.ListViewItemMovedEventHandler(this.lvActions_ItemMoved);
this.lvActions.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvActions_ItemChecked);
this.lvActions.SelectedIndexChanged += new System.EventHandler(this.lvActions_SelectedIndexChanged);
//
// chActionsName
//
resources.ApplyResources(this.chActionsName, "chActionsName");
//
// chActionsPath
//
resources.ApplyResources(this.chActionsPath, "chActionsPath");
//
// chActionsArgs
//
resources.ApplyResources(this.chActionsArgs, "chActionsArgs");
//
// chActionsExtensions
//
resources.ApplyResources(this.chActionsExtensions, "chActionsExtensions");
//
// tttvMain // tttvMain
// //
resources.ApplyResources(this.tttvMain, "tttvMain"); resources.ApplyResources(this.tttvMain, "tttvMain");
@ -2164,34 +2197,16 @@ private void InitializeComponent()
this.tttvMain.TreeViewSize = 190; this.tttvMain.TreeViewSize = 190;
this.tttvMain.TabChanged += new ShareX.HelpersLib.TabToTreeView.TabChangedEventHandler(this.tttvMain_TabChanged); this.tttvMain.TabChanged += new ShareX.HelpersLib.TabToTreeView.TabChangedEventHandler(this.tttvMain_TabChanged);
// //
// cbURLRegexReplace // lblToolsScreenColorPickerInfoText
// //
resources.ApplyResources(this.cbURLRegexReplace, "cbURLRegexReplace"); resources.ApplyResources(this.lblToolsScreenColorPickerInfoText, "lblToolsScreenColorPickerInfoText");
this.cbURLRegexReplace.Name = "cbURLRegexReplace"; this.lblToolsScreenColorPickerInfoText.Name = "lblToolsScreenColorPickerInfoText";
this.cbURLRegexReplace.UseVisualStyleBackColor = true;
this.cbURLRegexReplace.CheckedChanged += new System.EventHandler(this.cbURLRegexReplace_CheckedChanged);
// //
// lblURLRegexReplacePattern // txtToolsScreenColorPickerInfoText
// //
resources.ApplyResources(this.lblURLRegexReplacePattern, "lblURLRegexReplacePattern"); resources.ApplyResources(this.txtToolsScreenColorPickerInfoText, "txtToolsScreenColorPickerInfoText");
this.lblURLRegexReplacePattern.Name = "lblURLRegexReplacePattern"; this.txtToolsScreenColorPickerInfoText.Name = "txtToolsScreenColorPickerInfoText";
// this.txtToolsScreenColorPickerInfoText.TextChanged += new System.EventHandler(this.txtToolsScreenColorPickerInfoText_TextChanged);
// txtURLRegexReplacePattern
//
resources.ApplyResources(this.txtURLRegexReplacePattern, "txtURLRegexReplacePattern");
this.txtURLRegexReplacePattern.Name = "txtURLRegexReplacePattern";
this.txtURLRegexReplacePattern.TextChanged += new System.EventHandler(this.txtURLRegexReplacePattern_TextChanged);
//
// lblURLRegexReplaceReplacement
//
resources.ApplyResources(this.lblURLRegexReplaceReplacement, "lblURLRegexReplaceReplacement");
this.lblURLRegexReplaceReplacement.Name = "lblURLRegexReplaceReplacement";
//
// txtURLRegexReplaceReplacement
//
resources.ApplyResources(this.txtURLRegexReplaceReplacement, "txtURLRegexReplaceReplacement");
this.txtURLRegexReplaceReplacement.Name = "txtURLRegexReplaceReplacement";
this.txtURLRegexReplaceReplacement.TextChanged += new System.EventHandler(this.txtURLRegexReplaceReplacement_TextChanged);
// //
// TaskSettingsForm // TaskSettingsForm
// //
@ -2513,5 +2528,7 @@ private void InitializeComponent()
private System.Windows.Forms.Label lblURLRegexReplaceReplacement; private System.Windows.Forms.Label lblURLRegexReplaceReplacement;
private System.Windows.Forms.TextBox txtURLRegexReplacePattern; private System.Windows.Forms.TextBox txtURLRegexReplacePattern;
private System.Windows.Forms.TextBox txtURLRegexReplaceReplacement; private System.Windows.Forms.TextBox txtURLRegexReplaceReplacement;
private System.Windows.Forms.TextBox txtToolsScreenColorPickerInfoText;
private System.Windows.Forms.Label lblToolsScreenColorPickerInfoText;
} }
} }

View file

@ -411,6 +411,8 @@ public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
CodeMenu.Create<CodeMenuEntryPixelInfo>(txtToolsScreenColorPickerFormat); CodeMenu.Create<CodeMenuEntryPixelInfo>(txtToolsScreenColorPickerFormat);
txtToolsScreenColorPickerFormat.Text = TaskSettings.ToolsSettings.ScreenColorPickerFormat; txtToolsScreenColorPickerFormat.Text = TaskSettings.ToolsSettings.ScreenColorPickerFormat;
CodeMenu.Create<CodeMenuEntryPixelInfo>(txtToolsScreenColorPickerInfoText);
txtToolsScreenColorPickerInfoText.Text = TaskSettings.ToolsSettings.ScreenColorPickerInfoText;
#endregion Tools #endregion Tools
@ -1592,6 +1594,11 @@ private void txtToolsScreenColorPickerFormat_TextChanged(object sender, EventArg
TaskSettings.ToolsSettings.ScreenColorPickerFormat = txtToolsScreenColorPickerFormat.Text; TaskSettings.ToolsSettings.ScreenColorPickerFormat = txtToolsScreenColorPickerFormat.Text;
} }
private void txtToolsScreenColorPickerInfoText_TextChanged(object sender, EventArgs e)
{
TaskSettings.ToolsSettings.ScreenColorPickerInfoText = txtToolsScreenColorPickerInfoText.Text;
}
#endregion Tools #endregion Tools
#region Advanced #region Advanced

File diff suppressed because it is too large Load diff

View file

@ -798,6 +798,7 @@ public static void OpenDebugLog()
public static void ShowScreenColorPickerDialog(TaskSettings taskSettings = null) public static void ShowScreenColorPickerDialog(TaskSettings taskSettings = null)
{ {
if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings(); if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();
taskSettings.CaptureSettings.SurfaceOptions.ScreenColorPickerInfoText = taskSettings.ToolsSettings.ScreenColorPickerInfoText;
RegionCaptureTasks.ShowScreenColorPickerDialog(taskSettings.CaptureSettings.SurfaceOptions); RegionCaptureTasks.ShowScreenColorPickerDialog(taskSettings.CaptureSettings.SurfaceOptions);
} }
@ -805,6 +806,7 @@ public static void ShowScreenColorPickerDialog(TaskSettings taskSettings = null)
public static void OpenScreenColorPicker(TaskSettings taskSettings = null) public static void OpenScreenColorPicker(TaskSettings taskSettings = null)
{ {
if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings(); if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();
taskSettings.CaptureSettings.SurfaceOptions.ScreenColorPickerInfoText = taskSettings.ToolsSettings.ScreenColorPickerInfoText;
PointInfo pointInfo = RegionCaptureTasks.GetPointInfo(taskSettings.CaptureSettings.SurfaceOptions); PointInfo pointInfo = RegionCaptureTasks.GetPointInfo(taskSettings.CaptureSettings.SurfaceOptions);

View file

@ -405,6 +405,7 @@ public class TaskSettingsUpload
public class TaskSettingsTools public class TaskSettingsTools
{ {
public string ScreenColorPickerFormat = "$hex"; public string ScreenColorPickerFormat = "$hex";
public string ScreenColorPickerInfoText = "RGB: $r, $g, $b$nHex: $HEX$nX: $x Y: $y";
public IndexerSettings IndexerSettings = new IndexerSettings(); public IndexerSettings IndexerSettings = new IndexerSettings();
public ImageCombinerOptions ImageCombinerOptions = new ImageCombinerOptions(); public ImageCombinerOptions ImageCombinerOptions = new ImageCombinerOptions();
public VideoConverterOptions VideoConverterOptions = new VideoConverterOptions(); public VideoConverterOptions VideoConverterOptions = new VideoConverterOptions();