private void DoPreviewPopup(PackageImportTreeView.PackageImportTreeViewItem pitem, Rect rowRect)
{
ImportPackageItem item = pitem.item;
if (item != null)
{
if (((Event.current.type == EventType.MouseDown) && rowRect.Contains(Event.current.mousePosition)) && !PopupWindowWithoutFocus.IsVisible())
{
this.showPreviewForID = pitem.id;
}
if ((pitem.id == this.showPreviewForID) && (Event.current.type != EventType.Layout))
{
this.showPreviewForID = 0;
if (!string.IsNullOrEmpty(item.previewPath))
{
Texture2D preview = PackageImport.GetPreview(item.previewPath);
Rect activatorRect = rowRect;
activatorRect.width = EditorGUIUtility.currentViewWidth;
PopupLocationHelper.PopupLocation[] locationPriorityOrder = new PopupLocationHelper.PopupLocation[3];
locationPriorityOrder[0] = PopupLocationHelper.PopupLocation.Right;
locationPriorityOrder[1] = PopupLocationHelper.PopupLocation.Left;
PopupWindowWithoutFocus.Show(activatorRect, new PackageImportTreeView.PreviewPopup(preview), locationPriorityOrder);
}
}
}
}