Update right-click menu as soon as changes made

Partially fixes #49
This commit is contained in:
Terry MacDonald 2021-10-30 17:39:17 +13:00
parent a8a27bddde
commit bb524749b5
4 changed files with 21 additions and 5 deletions

View File

@ -26,8 +26,8 @@ using System.Resources;
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
// Version information
[assembly: AssemblyVersion("2.1.0.37")]
[assembly: AssemblyFileVersion("2.1.0.37")]
[assembly: AssemblyVersion("2.1.0.40")]
[assembly: AssemblyFileVersion("2.1.0.40")]
[assembly: NeutralResourcesLanguageAttribute( "en" )]
[assembly: CLSCompliant(true)]

View File

@ -223,6 +223,13 @@ namespace DisplayMagician.UIForms
}
// Also refresh the right-click menu (if we have a main form loaded)
if (Program.AppMainForm is Form)
{
Program.AppMainForm.RefreshNotifyIconMenus();
}
// Restart updating the saved_profiles listview
ilv_saved_profiles.ResumeLayout();
}
@ -255,7 +262,7 @@ namespace DisplayMagician.UIForms
// Refresh the Profile UI
RefreshDisplayProfileUI();
}

View File

@ -317,7 +317,7 @@ namespace DisplayMagician.UIForms
}
private void RefreshNotifyIconMenus()
public void RefreshNotifyIconMenus()
{
// Clear all the profiles
profileToolStripMenuItem.DropDownItems.Clear();
@ -370,7 +370,9 @@ namespace DisplayMagician.UIForms
shortcutToolStripMenuItem.DropDownItems.Add(shortcutMenuItem);
}
}
// Apply it by running the Application.DoEvents();
Application.DoEvents();
}

View File

@ -47,6 +47,7 @@ namespace DisplayMagician.UIForms
// Refresh the Shortcut Library UI
RefreshShortcutLibraryUI();
RemoveWarningIfShortcuts();
}
@ -101,6 +102,12 @@ namespace DisplayMagician.UIForms
// Restart updating the saved_profiles listview
ilv_saved_shortcuts.ResumeLayout();
// Also refresh the right-click menu (if we have a main form loaded)
if (Program.AppMainForm is Form)
{
Program.AppMainForm.RefreshNotifyIconMenus();
}
}
private ShortcutItem GetShortcutFromName(string shortcutName)