Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hutchinson <mhutchinson@novell.com>2010-05-26 02:33:37 +0400
committerMichael Hutchinson <mhutchinson@novell.com>2010-05-26 02:33:37 +0400
commit8b9d96539f4bb79694a323daa17f344b0f1e2288 (patch)
tree412f7db4fa82f2bcfc0d6f0f25344d79ea4d4b67 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui
parentfab9d76b87335213c131c98c88dfe779b7afb391 (diff)
* MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Mark window as a popup,
so the command manger doesn't intercept keystroke. svn path=/trunk/monodevelop/; revision=157917
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs44
1 files changed, 26 insertions, 18 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs
index b3c0bd0b29..06990f59e1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs
@@ -33,6 +33,7 @@ using Gdk;
using Gtk;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide.Commands;
namespace MonoDevelop.Ide
@@ -90,7 +91,7 @@ namespace MonoDevelop.Ide
}
}
- public DocumentSwitcher (Gtk.Window parent, bool startWithNext) : base(Gtk.WindowType.Toplevel)
+ public DocumentSwitcher (Gtk.Window parent, bool startWithNext) : base(Gtk.WindowType.Popup)
{
this.documents = new List<Document> (IdeApp.Workbench.Documents.OrderByDescending (d => d.LastTimeActive));
this.TransientFor = parent;
@@ -300,7 +301,6 @@ namespace MonoDevelop.Ide
Gdk.Key key;
Gdk.ModifierType mod;
KeyBindingManager.MapRawKeys (evnt, out key, out mod);
- bool next = (mod & ModifierType.ShiftMask) == 0;
switch (key) {
case Gdk.Key.Left:
@@ -310,25 +310,16 @@ namespace MonoDevelop.Ide
SwitchToDocument ();
break;
case Gdk.Key.Up:
- if (documentFocus) {
- SelectDocument (GetPrevDocument (SelectedDocument));
- } else {
- SelectPad (GetPrevPad (SelectedPad));
- }
+ Previous ();
break;
case Gdk.Key.Down:
- if (documentFocus) {
- SelectDocument (GetNextDocument (SelectedDocument));
- } else {
- SelectPad (GetNextPad (SelectedPad));
- }
+ Next ();
break;
case Gdk.Key.Tab:
- if (documentFocus) {
- SelectDocument (next ? GetNextDocument (SelectedDocument) : GetPrevDocument (SelectedDocument));
- } else {
- SelectPad (next ? GetNextPad (SelectedPad) : GetPrevPad (SelectedPad));
- }
+ if ((mod & ModifierType.ShiftMask) == 0)
+ Next ();
+ else
+ Previous ();
break;
}
return true;
@@ -370,6 +361,23 @@ namespace MonoDevelop.Ide
this.GdkWindow.DrawRectangle (this.Style.ForegroundGC (StateType.Insensitive), false, 0, 0, winWidth-1, winHeight-1);
return false;
}
-
+
+ void Next ()
+ {
+ if (documentFocus) {
+ SelectDocument (GetNextDocument (SelectedDocument));
+ } else {
+ SelectPad (GetNextPad (SelectedPad));
+ }
+ }
+
+ void Previous ()
+ {
+ if (documentFocus) {
+ SelectDocument (GetPrevDocument (SelectedDocument));
+ } else {
+ SelectPad (GetPrevPad (SelectedPad));
+ }
+ }
}
}