From e750e597042fbdf042607968ae79e587471bf4ed Mon Sep 17 00:00:00 2001 From: Jaex Date: Sun, 21 Jan 2018 13:23:45 +0300 Subject: [PATCH] Removed image effects refresh button, only show load image button on tool mode --- .../ImageEffectsForm.Designer.cs | 10 ---- ShareX.ImageEffectsLib/ImageEffectsForm.cs | 32 +++++------ ShareX.ImageEffectsLib/ImageEffectsForm.resx | 55 ++++++------------- 3 files changed, 30 insertions(+), 67 deletions(-) diff --git a/ShareX.ImageEffectsLib/ImageEffectsForm.Designer.cs b/ShareX.ImageEffectsLib/ImageEffectsForm.Designer.cs index 2d70bd529..2ceb817c5 100644 --- a/ShareX.ImageEffectsLib/ImageEffectsForm.Designer.cs +++ b/ShareX.ImageEffectsLib/ImageEffectsForm.Designer.cs @@ -37,7 +37,6 @@ private void InitializeComponent() this.btnRemove = new System.Windows.Forms.Button(); this.btnClear = new System.Windows.Forms.Button(); this.btnDuplicate = new System.Windows.Forms.Button(); - this.btnRefresh = new System.Windows.Forms.Button(); this.btnSaveImage = new System.Windows.Forms.Button(); this.eiImageEffects = new ShareX.HelpersLib.ExportImportControl(); this.pbResult = new ShareX.HelpersLib.MyPictureBox(); @@ -118,13 +117,6 @@ private void InitializeComponent() this.btnDuplicate.UseVisualStyleBackColor = true; this.btnDuplicate.Click += new System.EventHandler(this.btnDuplicate_Click); // - // btnRefresh - // - resources.ApplyResources(this.btnRefresh, "btnRefresh"); - this.btnRefresh.Name = "btnRefresh"; - this.btnRefresh.UseVisualStyleBackColor = true; - this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click); - // // btnSaveImage // resources.ApplyResources(this.btnSaveImage, "btnSaveImage"); @@ -252,7 +244,6 @@ private void InitializeComponent() this.Controls.Add(this.mbLoadImage); this.Controls.Add(this.eiImageEffects); this.Controls.Add(this.btnSaveImage); - this.Controls.Add(this.btnRefresh); this.Controls.Add(this.btnDuplicate); this.Controls.Add(this.btnClear); this.Controls.Add(this.pbResult); @@ -279,7 +270,6 @@ private void InitializeComponent() private ShareX.HelpersLib.MyPictureBox pbResult; private System.Windows.Forms.Button btnClear; private System.Windows.Forms.Button btnDuplicate; - private System.Windows.Forms.Button btnRefresh; private System.Windows.Forms.Button btnSaveImage; private ShareX.HelpersLib.ExportImportControl eiImageEffects; private System.Windows.Forms.ContextMenuStrip cmsEffects; diff --git a/ShareX.ImageEffectsLib/ImageEffectsForm.cs b/ShareX.ImageEffectsLib/ImageEffectsForm.cs index 217ba8032..45cdb8125 100644 --- a/ShareX.ImageEffectsLib/ImageEffectsForm.cs +++ b/ShareX.ImageEffectsLib/ImageEffectsForm.cs @@ -29,7 +29,6 @@ You should have received a copy of the GNU General Public License using System.Collections.Generic; using System.Diagnostics; using System.Drawing; -using System.Linq; using System.Windows.Forms; namespace ShareX.ImageEffectsLib @@ -221,7 +220,7 @@ private void UpdateControlStates() { btnRemovePreset.Enabled = cbPresets.Enabled = txtPresetName.Enabled = btnAdd.Enabled = cbPresets.SelectedIndex > -1; btnRemove.Enabled = btnDuplicate.Enabled = lvEffects.SelectedItems.Count > 0; - btnClear.Enabled = btnRefresh.Enabled = lvEffects.Items.Count > 0; + btnClear.Enabled = lvEffects.Items.Count > 0; } private Image ApplyEffects() @@ -401,18 +400,6 @@ private void btnRemove_Click(object sender, EventArgs e) RemoveSelectedEffects(); } - private void btnClear_Click(object sender, EventArgs e) - { - ImageEffectPreset preset = GetSelectedPreset(); - - if (preset != null) - { - lvEffects.Items.Clear(); - preset.Effects.Clear(); - UpdatePreview(); - } - } - private void btnDuplicate_Click(object sender, EventArgs e) { ImageEffectPreset preset = GetSelectedPreset(); @@ -434,6 +421,18 @@ private void btnDuplicate_Click(object sender, EventArgs e) } } + private void btnClear_Click(object sender, EventArgs e) + { + ImageEffectPreset preset = GetSelectedPreset(); + + if (preset != null) + { + lvEffects.Items.Clear(); + preset.Effects.Clear(); + UpdatePreview(); + } + } + private void lvEffects_ItemMoved(object sender, int oldIndex, int newIndex) { ImageEffectPreset preset = GetSelectedPreset(); @@ -445,11 +444,6 @@ private void lvEffects_ItemMoved(object sender, int oldIndex, int newIndex) } } - private void btnRefresh_Click(object sender, EventArgs e) - { - UpdatePreview(); - } - private void lvEffects_SelectedIndexChanged(object sender, EventArgs e) { pgSettings.SelectedObject = null; diff --git a/ShareX.ImageEffectsLib/ImageEffectsForm.resx b/ShareX.ImageEffectsLib/ImageEffectsForm.resx index 79b8c5c94..e90584353 100644 --- a/ShareX.ImageEffectsLib/ImageEffectsForm.resx +++ b/ShareX.ImageEffectsLib/ImageEffectsForm.resx @@ -142,13 +142,13 @@ $this - 18 + 17 8, 40 - 88, 24 + 104, 24 0 @@ -166,7 +166,7 @@ $this - 17 + 16 Top, Bottom, Left @@ -190,16 +190,16 @@ $this - 19 + 18 164 - 104, 40 + 120, 40 - 88, 24 + 104, 24 1 @@ -217,13 +217,13 @@ $this - 16 + 15 - 200, 40 + 344, 40 - 88, 24 + 104, 24 2 @@ -241,13 +241,13 @@ $this - 14 + 13 - 296, 40 + 232, 40 - 88, 24 + 104, 24 3 @@ -265,30 +265,6 @@ $this - 13 - - - 392, 40 - - - 88, 24 - - - 6 - - - Refresh - - - btnRefresh - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - 12 @@ -370,7 +346,7 @@ $this - 15 + 14 17, 17 @@ -411,6 +387,9 @@ Load image + + False + mbLoadImage @@ -604,7 +583,7 @@ $this - 0 + 2 True