Permalink
Browse files

Ctrl + W closes settings dialog when open

  • Loading branch information...
1 parent 00da3de commit 825966f1d9e83a3a48cb844a90147a25bcf6428a @JakeGinnivan JakeGinnivan committed Jun 7, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/MarkPad/Shell/ShellViewModel.cs
@@ -23,6 +23,7 @@ namespace MarkPad.Shell
{
internal class ShellViewModel : Conductor<IScreen>, IHandle<FileOpenEvent>, IHandle<SettingsCloseEvent>
{
+ private const string ShowSettingsState = "ShowSettings";
private readonly IEventAggregator eventAggregator;
private readonly IDialogService dialogService;
private readonly IWindowManager windowManager;
@@ -149,6 +150,12 @@ public void SaveAllDocuments()
public void CloseDocument()
{
+ if (CurrentState == ShowSettingsState)
+ {
+ Handle(new SettingsCloseEvent());
+ return;
+ }
+
var doc = MDI.ActiveItem as DocumentViewModel;
if (doc != null)
{
@@ -178,7 +185,7 @@ public void Handle(FileOpenEvent message)
public void ShowSettings()
{
- CurrentState = "ShowSettings";
+ CurrentState = ShowSettingsState;
}
public void ToggleWebView()

0 comments on commit 825966f

Please sign in to comment.