diff options
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs index b32a1749bc..4ea9fd8a0e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs @@ -85,7 +85,7 @@ namespace MonoDevelop.Components.MainToolbar Solution currentSolution; bool settingGlobalConfig; - SolutionEntityItem currentStartupProject; + SolutionItem currentStartupProject; int ignoreConfigurationChangedCount; int ignoreRuntimeChangedCount; @@ -148,6 +148,12 @@ namespace MonoDevelop.Components.MainToolbar renderer.Visible = ci.Visible; renderer.Sensitive = ci.Enabled; renderer.Xpad = 3; + + // it seems that once we add the ExecutionTargetGroups to the drop down then the width + // calculation for items needs some help in calculating the correct width + // doing this helps. + if (Platform.IsMac) + renderer.WidthChars = renderer.Text != null ? renderer.Text.Length : 0; return; } renderer.Sensitive = !(target is ExecutionTargetGroup) && (target != null && target.Enabled); @@ -190,6 +196,14 @@ namespace MonoDevelop.Components.MainToolbar return sb.ToString (); } + void DestroyPopup () + { + if (popup != null) { + popup.Destroy (); + popup = null; + } + } + public MainToolbar () { executionTargetsChanged = DispatchService.GuiDispatch (new EventHandler (HandleExecutionTargetsChanged)); @@ -303,7 +317,7 @@ namespace MonoDevelop.Components.MainToolbar matchEntry.Activated += (sender, e) => { var pattern = SearchPopupSearchPattern.ParsePattern (matchEntry.Entry.Text); if (pattern.Pattern == null && pattern.LineNumber > 0) { - popup.Destroy (); + DestroyPopup (); var doc = IdeApp.Workbench.ActiveDocument; if (doc != null && doc.Editor != null) { doc.Select (); @@ -320,8 +334,7 @@ namespace MonoDevelop.Components.MainToolbar if (args.Event.Key == Gdk.Key.Escape) { var doc = IdeApp.Workbench.ActiveDocument; if (doc != null) { - if (popup != null) - popup.Destroy (); + DestroyPopup (); doc.Select (); } return; @@ -517,8 +530,7 @@ namespace MonoDevelop.Components.MainToolbar void HandleSearchEntryChanged (object sender, EventArgs e) { if (string.IsNullOrEmpty (matchEntry.Entry.Text)){ - if (popup != null) - popup.Destroy (); + DestroyPopup (); return; } var pattern = SearchPopupSearchPattern.ParsePattern (matchEntry.Entry.Text); |