// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Content;
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.Surface.ContextMenu
{
///
/// The item.
///
[HideInEditor]
public class SearchItem : ContainerControl
{
private ContentFinder _finder;
///
/// The item icon.
///
protected Image _icon;
///
/// The item name.
///
public string Name;
///
/// The item type name.
///
public string Type;
///
/// The item object reference.
///
public object Item;
///
/// Initializes a new instance of the class.
///
/// The name.
/// The type.
/// The item.
/// The finder.
/// The item width.
/// The item height.
public SearchItem(string name, string type, object item, ContentFinder finder, float width, float height)
{
Size = new Vector2(width, height);
Name = name;
Type = type;
Item = item;
_finder = finder;
var logoSize = 15.0f;
var icon = new Image
{
Size = new Vector2(logoSize),
Location = new Vector2(5, (height - logoSize) / 2)
};
_icon = icon;
var nameLabel = AddChild