bool DelayedTooltipShow() { var selectedItem = List.SelectedItem; if (selectedItem < 0 || selectedItem >= completionDataList.Count) { return(false); } var data = completionDataList [selectedItem]; IEnumerable <ICompletionData> filteredOverloads; if (data.HasOverloads) { filteredOverloads = data.OverloadedData; } else { filteredOverloads = new ICompletionData[] { data }; } EnsureDeclarationViewWindow(); if (data != currentData) { declarationviewwindow.Clear(); var overloads = new List <ICompletionData> (filteredOverloads); foreach (var overload in overloads) { declarationviewwindow.AddOverload((CompletionData)overload); } currentData = data; if (data.HasOverloads) { for (int i = 0; i < overloads.Count; i++) { if (!overloads[i].DisplayFlags.HasFlag(DisplayFlags.Obsolete)) { declarationviewwindow.CurrentOverload = i; break; } } } } if (declarationviewwindow.Overloads == 0) { HideDeclarationView(); return(false); } if (declarationViewHidden && Visible) { RepositionDeclarationViewWindow(); } declarationViewTimer = 0; return(false); }
async void DelayedTooltipShowAsync() { var selectedItem = List.SelectedItemIndex; if (selectedItem < 0 || selectedItem >= completionDataList.Count) { return; } var data = completionDataList [selectedItem]; IEnumerable <CompletionData> filteredOverloads; if (data.HasOverloads) { filteredOverloads = data.OverloadedData; } else { filteredOverloads = new CompletionData[] { data }; } EnsureDeclarationViewWindow(); if (data != currentData) { declarationviewwindow.Clear(); currentData = data; var cs = new CancellationTokenSource(); declarationViewCancelSource = cs; var overloads = new List <CompletionData> (filteredOverloads); overloads.Sort(ListWidget.overloadComparer); foreach (var overload in overloads) { await declarationviewwindow.AddOverload((CompletionData)overload, cs.Token); } if (cs.IsCancellationRequested) { return; } if (declarationViewCancelSource == cs) { declarationViewCancelSource = null; } if (data.HasOverloads) { for (int i = 0; i < overloads.Count; i++) { if (!overloads[i].DisplayFlags.HasFlag(DisplayFlags.Obsolete)) { declarationviewwindow.CurrentOverload = i; break; } } } } if (declarationviewwindow.Overloads == 0) { HideDeclarationView(); return; } if (declarationViewHidden && Visible) { RepositionDeclarationViewWindow(); } declarationViewTimer = 0; }
bool DelayedTooltipShow() { var selectedItem = List.SelectedItem; if (selectedItem < 0 || selectedItem >= completionDataList.Count) { return(false); } var data = completionDataList [selectedItem]; IEnumerable <ICompletionData> filteredOverloads; if (data.HasOverloads) { filteredOverloads = data.OverloadedData; if (PropertyService.Get("HideObsoleteItems", false)) { filteredOverloads = filteredOverloads.Where(x => !x.DisplayFlags.HasFlag(DisplayFlags.Obsolete)); } } else { filteredOverloads = new ICompletionData[] { data }; } if (data != currentData) { declarationviewwindow.Clear(); var overloads = new List <ICompletionData> (filteredOverloads); foreach (var overload in overloads) { declarationviewwindow.AddOverload((CompletionData)overload); } currentData = data; if (data.HasOverloads) { for (int i = 0; i < overloads.Count; i++) { if (!overloads[i].DisplayFlags.HasFlag(DisplayFlags.Obsolete)) { declarationviewwindow.CurrentOverload = i; break; } } } } if (declarationviewwindow.Overloads == 0) { HideDeclarationView(); return(false); } Gdk.Rectangle rect = List.GetRowArea(selectedItem); if (rect.IsEmpty || rect.Bottom < (int)List.vadj.Value || rect.Y > List.Allocation.Height + (int)List.vadj.Value) { return(false); } if (declarationViewHidden && Visible) { declarationviewwindow.ShowArrow = true; int ox; int oy; base.GdkWindow.GetOrigin(out ox, out oy); declarationviewwindow.MaximumYTopBound = oy; int y = rect.Y + Theme.Padding - (int)List.vadj.Value; declarationviewwindow.ShowPopup(this, new Gdk.Rectangle(Gui.Styles.TooltipInfoSpacing, Math.Min(Allocation.Height, Math.Max(0, y)), Allocation.Width, rect.Height), PopupPosition.Left); declarationViewHidden = false; } declarationViewTimer = 0; return(false); }