diff options
author | David Karlaš <david.karlas@xamarin.com> | 2014-12-01 23:34:05 +0300 |
---|---|---|
committer | David Karlaš <david.karlas@xamarin.com> | 2014-12-01 23:34:05 +0300 |
commit | 9f18bdadf983b3778b10658efe543922c1042b41 (patch) | |
tree | fb6762863f1820b767763ea261891e398ea34cca /main/src/addins/MonoDevelop.Debugger | |
parent | 54bdd290bd76b6c2aea84d2fd095aefd9901b9bc (diff) |
[DebuggerVisualizers] Escape key closes PreviewWindow
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewWindowManager.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewWindowManager.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewWindowManager.cs index aa3b396bef..bf5ee2e886 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewWindowManager.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewWindowManager.cs @@ -27,6 +27,7 @@ using System; using MonoDevelop.Ide; using Mono.Debugging.Client; using MonoDevelop.Components; +using MonoDevelop.Components.Commands; namespace MonoDevelop.Debugger { @@ -67,11 +68,19 @@ namespace MonoDevelop.Debugger IdeApp.Workbench.RootWindow.Destroyed += (sender, e) => DestroyWindow (); IdeApp.Workbench.RootWindow.FocusOutEvent += HandleFocusOutEvent; } + IdeApp.CommandService.KeyPressed += HandleKeyPressed; DebuggingService.StoppedEvent += delegate { DestroyWindow (); }; } + static void HandleKeyPressed (object sender, KeyPressArgs e) + { + if (e.Key == Gdk.Key.Escape) { + DestroyWindow (); + } + } + static void HandleFocusOutEvent (object o, Gtk.FocusOutEventArgs args) { if (IdeApp.Workbench.RootWindow == null || !IdeApp.Workbench.RootWindow.HasFocus) { |