From de4b9bc50153ea5f8430c95507d2f54d4280bc41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=93=9D=E7=82=B9lilac?= Date: Mon, 14 Dec 2020 02:34:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=AE=9A=E4=B9=89=E2=80=9C?= =?UTF-8?q?=E7=9B=BE=E7=89=8C=E5=9B=BE=E6=A0=87=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ContextMenuManager/Controls/ShellItem.cs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/ContextMenuManager/Controls/ShellItem.cs b/ContextMenuManager/Controls/ShellItem.cs index 5d7704f..c7fc8cf 100644 --- a/ContextMenuManager/Controls/ShellItem.cs +++ b/ContextMenuManager/Controls/ShellItem.cs @@ -414,12 +414,7 @@ namespace ContextMenuManager.Controls TsiNoWorkDir.Click += (sender, e) => this.NoWorkingDirectory = !TsiNoWorkDir.Checked; ContextMenuStrip.Opening += (sender, e) => RefreshMenuItem(); BtnSubItems.MouseDown += (sender, e) => ShowSubItems(); - TsiShieldIcon.Click += (sender, e) => - { - TsiShieldIcon.Checked = !TsiShieldIcon.Checked; - if(TsiShieldIcon.Checked) UseShieldIcon(); - else DeleteIcon(); - }; + TsiShieldIcon.Click += (sender, e) => UseShieldIcon(); MyToolTip.SetToolTip(BtnSubItems, AppString.Tip.EditSubItems); this.AddCtr(BtnSubItems); } @@ -433,11 +428,13 @@ namespace ContextMenuManager.Controls private void UseShieldIcon() { - this.IconLocation = null; - this.HasLUAShield = true; - this.Image = AppImage.Shield; - this.IconPath = "imageres.dll"; - this.IconIndex = -78; + bool flag = this.HasLUAShield = TsiShieldIcon.Checked = !TsiShieldIcon.Checked; + if(flag && IconLocation == null) + { + this.Image = AppImage.Shield; + this.IconPath = "imageres.dll"; + this.IconIndex = -78; + } } private void RefreshMenuItem() @@ -463,7 +460,7 @@ namespace ContextMenuManager.Controls TsiChangeIcon.Text = AppString.Menu.AddIcon; TsiDeleteIcon.Visible = false; } - TsiShieldIcon.Checked = (IconLocation == null) && HasLUAShield; + TsiShieldIcon.Checked = HasLUAShield; if(!this.IsSubItem) {