Skip to content

Commit

Permalink
Ctrl + W closes settings dialog when open
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Ginnivan committed Jun 7, 2012
1 parent 00da3de commit 825966f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/MarkPad/Shell/ShellViewModel.cs
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -178,7 +185,7 @@ public void Handle(FileOpenEvent message)

public void ShowSettings()
{
CurrentState = "ShowSettings";
CurrentState = ShowSettingsState;
}

public void ToggleWebView()
Expand Down

0 comments on commit 825966f

Please sign in to comment.