Skip to content

Commit

Permalink
Add "Lock Screen" menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacato committed Jul 2, 2019
1 parent f978386 commit 2c4f818
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
9 changes: 9 additions & 0 deletions WalletWasabi.Gui/Icons/Icons.xaml
Expand Up @@ -142,6 +142,15 @@
</DrawingGroup.Children>
</DrawingGroup>

<DrawingGroup x:Key="Lock">
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M13,5L13,4.75C13,2.513,11.513,0.636,9.482,0L6.517,0C4.487,0.636,3,2.513,3,4.75L3,5 1,5 1,16 15,16 15,5z" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M9.25,9.25C9.25,8.56 8.69,8 8,8 7.31,8 6.75,8.56 6.75,9.25 6.75,9.762 7.06,10.199 7.5,10.393L7.5,13 8.5,13 8.5,10.393C8.94,10.199,9.25,9.762,9.25,9.25 M13,14L3,14 3,7 13,7z" />
<GeometryDrawing Brush="#FF424242" Geometry="F1M6.75,9.25C6.75,8.56 7.31,8 8,8 8.69,8 9.25,8.56 9.25,9.25 9.25,9.762 8.94,10.199 8.5,10.393L8.5,13 7.5,13 7.5,10.393C7.06,10.199,6.75,9.762,6.75,9.25 M13,14L3,14 3,7 13,7z M5,4.75C5,3.096 6.346,1.75 8,1.75 9.654,1.75 11,3.096 11,4.75L11,6 5,6z M12,6L12,4.75C12,2.544 10.206,0.75 8,0.75 5.794,0.75 4,2.544 4,4.75L4,6 2,6 2,15 14,15 14,6z" />
</DrawingGroup.Children>
</DrawingGroup>

<!-- Anonimity icons -->
<DrawingGroup x:Key="PrivacyCritical">
<DrawingGroup.Children>
Expand Down
32 changes: 32 additions & 0 deletions WalletWasabi.Gui/Shell/Commands/LockScreenCommands.cs
@@ -0,0 +1,32 @@
using Avalonia;
using AvalonStudio.Commands;
using ReactiveUI;
using System;
using System.Composition;

namespace WalletWasabi.Gui.Shell.Commands
{
internal class LockScreenCommands
{
[ExportCommandDefinition("File.LockScreen")]
public CommandDefinition LockScreenCommand { get; }

[ImportingConstructor]
public LockScreenCommands(CommandIconService commandIconService)
{
var lockScreen = ReactiveCommand.Create(OnLockScreen);

lockScreen.ThrownExceptions.Subscribe(ex => Logging.Logger.LogWarning<ExitCommands>(ex));

LockScreenCommand = new CommandDefinition(
"Lock Screen",
commandIconService.GetCompletionKindImage("Lock"),
lockScreen);
}

private void OnLockScreen()
{

}
}
}
5 changes: 5 additions & 0 deletions WalletWasabi.Gui/Shell/MainMenu/FileMainMenuItems.cs
Expand Up @@ -62,6 +62,11 @@ public FileMainMenuItems(IMenuItemFactory menuItemFactory)
[DefaultOrder(3)]
public IMenuItem Open => MenuItemFactory.CreateHeaderMenuItem("Open", null);

[ExportMainMenuItem("File", "Lock Screen")]
[DefaultOrder(4)]
[DefaultGroup("Exit")]
public IMenuItem LockScreen => MenuItemFactory.CreateCommandMenuItem("File.LockScreen");

[ExportMainMenuItem("File", "Exit")]
[DefaultOrder(4)]
[DefaultGroup("Exit")]
Expand Down

0 comments on commit 2c4f818

Please sign in to comment.