screen lock on file menu
MODIFY
WalletWasabi.Gui/MainWindow.xaml
WalletWasabi.Gui/MainWindow.xaml
<cont:MetroWindow.TitleBarContent>
<StackPanel Orientation="Horizontal" IsVisible="{Binding !LockScreen.IsLocked}">
<menu:MainMenuView DataContext="{Binding Shell.MainMenu}" Margin="4 0 0 0" Foreground="{DynamicResource ThemeForegroundBrush}" VerticalAlignment="Stretch" FontSize="13" />
- <Button Command="{Binding LockScreenCommand}" Margin="10 0" Background="Transparent" BorderBrush="Transparent">
- <StackPanel Orientation="Horizontal" Spacing="8">
- <DrawingPresenter Height="10" Width="10" Drawing="{StaticResource Lock}" />
- <TextBlock FontSize="13" Text="Lock Screen" />
- </StackPanel>
- </Button>
</StackPanel>
</cont:MetroWindow.TitleBarContent>
<cont:MetroWindow.Styles>

MODIFY
WalletWasabi.Gui/Shell/Commands/SystemCommands.cs
WalletWasabi.Gui/Shell/Commands/SystemCommands.cs
@@ -17,6 +17,10 @@ namespace WalletWasabi.Gui.Shell.Commands
[ExportCommandDefinition("File.Exit")]
public CommandDefinition ExitCommand { get; }
+ [DefaultKeyGesture("CTRL+L", osxKeyGesture: "CMD+L")]
+ [ExportCommandDefinition("File.LockScreen")]
+ public CommandDefinition LockScreenCommand {get;}
+
[ImportingConstructor]
public SystemCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global)
{
@@ -30,6 +34,17 @@ namespace WalletWasabi.Gui.Shell.Commands
"Exit",
commandIconService.GetCompletionKindImage("Exit"),
exit);
+
+ #pragma warning disable IDE0053 // Use expression body for lambda expressions
+ var lockCommand = ReactiveCommand.Create(() => { Global.UiConfig.LockScreenActive = true; });
+ #pragma warning restore IDE0053 // Use expression body for lambda expressions
+
+ lockCommand.ThrownExceptions.Subscribe(ex => Logger.LogWarning(ex));
+
+ LockScreenCommand = new CommandDefinition(
+ "Lock Screen",
+ commandIconService.GetCompletionKindImage("Exit"),
+ lockCommand);
}
private void OnExit()

MODIFY
WalletWasabi.Gui/Shell/MainMenu/FileMainMenuItems.cs
WalletWasabi.Gui/Shell/MainMenu/FileMainMenuItems.cs
@@ -35,9 +35,13 @@ namespace WalletWasabi.Gui.Shell.MainMenu
[DefaultOrder(1)]
public object DiskGroup => null;
+ [ExportMainMenuDefaultGroup("File", "Security")]
+ [DefaultOrder(2)]
+ public object SecurityGroup => null;
+
[ExportOnPlatform(osx: false)]
[ExportMainMenuDefaultGroup("File", "System")]
- [DefaultOrder(2)]
+ [DefaultOrder(3)]
public object SystemGroup => null;
#endregion Group
@@ -63,8 +67,13 @@ namespace WalletWasabi.Gui.Shell.MainMenu
[DefaultOrder(3)]
public IMenuItem Open => MenuItemFactory.CreateHeaderMenuItem("Open", null);
- [ExportMainMenuItem("File", "Exit")]
+ [ExportMainMenuItem("File", "LockScreen")]
[DefaultOrder(4)]
+ [DefaultGroup("Security")]
+ public IMenuItem LockScreen => MenuItemFactory.CreateCommandMenuItem("File.LockScreen");
+
+ [ExportMainMenuItem("File", "Exit")]
+ [DefaultOrder(5)]
[DefaultGroup("System")]
public IMenuItem Exit => MenuItemFactory.CreateCommandMenuItem("File.Exit");

MODIFY
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
@@ -69,12 +69,6 @@ namespace WalletWasabi.Gui.ViewModels
public MainWindowViewModel()
{
Shell = IoC.Get<IShell>();
-
-#pragma warning disable IDE0053 // Use expression body for lambda expressions
- LockScreenCommand = ReactiveCommand.Create(() => { Global.UiConfig.LockScreenActive = true; });
-#pragma warning restore IDE0053 // Use expression body for lambda expressions
-
- LockScreenCommand.ThrownExceptions.Subscribe(ex => Logger.LogWarning(ex));
}
public IShell Shell { get; }

screen lock on file menu