Keep tray icon lock menu option in sync

This commit is contained in:
2023-04-24 21:30:56 -04:00
parent fb777f4837
commit edd01cc052

View File

@@ -21,6 +21,7 @@ internal static class NotificationIcon
// Setup the menu // Setup the menu
var contextMenu = new ContextMenu(); var contextMenu = new ContextMenu();
contextMenu.Opened += HandleContextMenuOpened;
_lockMenuItem = new MenuItem() _lockMenuItem = new MenuItem()
{ {
@@ -46,6 +47,11 @@ internal static class NotificationIcon
_notificationIcon.ForceCreate(false); _notificationIcon.ForceCreate(false);
} }
private static void HandleContextMenuOpened(object sender, System.Windows.RoutedEventArgs e)
{
_lockMenuItem.IsChecked = Settings.Default.WindowLocked;
}
private static void HandleNotificationIconDoubleClick(object sender, System.EventArgs e) private static void HandleNotificationIconDoubleClick(object sender, System.EventArgs e)
{ {
// Bring the main form to the front // Bring the main form to the front