diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-11-18 00:22:30 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-11-18 00:22:30 +0400 |
commit | 095f2d7ec19bc4f78ed0fa54d5ca5a4e9423f4ba (patch) | |
tree | 4b8f293a7dbc3bbbe600eda7694153d090f89b22 /main/src/addins/MonoDevelop.Refactoring | |
parent | ae607a1050d901ae22d95cd6023a0aed2c7601e9 (diff) | |
parent | 532138fa22ed040ed3a353d755c259163c77398f (diff) |
Merge branch 'master' into newresolver
Conflicts:
extras/GtkSourceViewEditor/MonoDevelop.SourceEditor.addin.xml
extras/MonoDevelop.Database/MonoDevelop.Database.Components/Widgets/DataGrid/DataGrid.cs
main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml
main/src/addins/NUnit/Makefile.am
main/src/addins/NUnit/MonoDevelop.NUnit.csproj
main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Serialization/ProjectCodeCompletionDatabase.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWindow.cs
Diffstat (limited to 'main/src/addins/MonoDevelop.Refactoring')
-rw-r--r-- | main/src/addins/MonoDevelop.Refactoring/MonoDevelop.ContextAction/ContextActionWidget.cs | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.ContextAction/ContextActionWidget.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.ContextAction/ContextActionWidget.cs index 9b1a0dc8ea..9927237a1b 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.ContextAction/ContextActionWidget.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.ContextAction/ContextActionWidget.cs @@ -67,9 +67,14 @@ namespace MonoDevelop.ContextAction document.Editor.Parent.EditorOptionsChanged -= HandleDocumentEditorParentEditorOptionsChanged; base.OnDestroyed (); } - + public void PopupQuickFixMenu () { + PopupQuickFixMenu (null); + } + + void PopupQuickFixMenu (Gdk.EventButton evt) + { Gtk.Menu menu = new Gtk.Menu (); Dictionary<Gtk.MenuItem, ContextAction> fixTable = new Dictionary<Gtk.MenuItem, ContextAction> (); @@ -93,29 +98,19 @@ namespace MonoDevelop.ContextAction menu.Add (menuItem); } menu.ShowAll (); - int dx, dy; - this.ParentWindow.GetOrigin (out dx, out dy); - dx += ((TextEditorContainer.EditorContainerChild)(this.document.Editor.Parent.Parent as TextEditorContainer) [this]).X; - dy += ((TextEditorContainer.EditorContainerChild)(this.document.Editor.Parent.Parent as TextEditorContainer) [this]).Y - (int)document.Editor.VAdjustment.Value; - - menu.Popup (null, null, delegate (Gtk.Menu menu2, out int x, out int y, out bool pushIn) { - x = dx; - y = dy + Allocation.Height; - pushIn = false; - menuPushed = true; - QueueDraw (); - }, 0, Gtk.Global.CurrentEventTime); menu.SelectFirst (true); + menuPushed = true; menu.Destroyed += delegate { menuPushed = false; QueueDraw (); }; + GtkWorkarounds.ShowContextMenu (menu, this, evt, Allocation); } protected override bool OnButtonPressEvent (Gdk.EventButton evnt) { - if (evnt.Button == 1) - PopupQuickFixMenu (); + if (!evnt.TriggersContextMenu () && evnt.Button == 1) + PopupQuickFixMenu (evnt); return base.OnButtonPressEvent (evnt); } |