diff options
author | Lluis Sanchez <llsan@microsoft.com> | 2016-07-27 14:26:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-27 14:26:41 +0300 |
commit | 0e6b31f152d2343d27e46a08f912a4ae5ac81663 (patch) | |
tree | 36c5345f9eb1b5cf07f38c75e01fd0635e0ade5b /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands | |
parent | 7ec30dc386f7c32e12d11222eb72ea488d0a138a (diff) | |
parent | 1f05387a59b6c2b688c7ffd35b81f33f63819a40 (diff) |
Merge pull request #1576 from sevoku/optimize-document-switcher
Optimized document switcher
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs index 9eb216750e..880c18df00 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs @@ -277,4 +277,31 @@ namespace MonoDevelop.Ide.Commands Switch (false); } } + + internal class SwitchNextPad : CommandHandler + { + protected static void Switch (bool next) + { + if (!IdeApp.Preferences.EnableDocumentSwitchDialog) + return; + + var toplevel = Window.ListToplevels ().FirstOrDefault (w => w.HasToplevelFocus) + ?? IdeApp.Workbench.RootWindow; + var sw = new DocumentSwitcher (toplevel, GettextCatalog.GetString ("Pads"), next); + sw.Present (); + } + + protected override void Run () + { + Switch (true); + } + } + + internal class SwitchPreviousPad : SwitchNextPad + { + protected override void Run () + { + Switch (false); + } + } } |