/// <summary> /// Constructor. /// </summary> /// <param name="clickEvent">The action to be called when the button is pressed.</param> public ToolbarButton(Action clickEvent) : base(clickEvent) { Toolbar.SetToolbarStyleSheet(this); RemoveFromClassList(Button.ussClassName); AddToClassList(ussClassName); }
public BreadcrumbItem(Action clickEvent) : base(clickEvent) { Toolbar.SetToolbarStyleSheet(this); RemoveFromClassList(ussClassName); AddToClassList(itemClassName); }
public ToolbarSearchField() { Toolbar.SetToolbarStyleSheet(this); m_CurrentText = String.Empty; AddToClassList(ussClassName); m_TextField = new TextField(); m_TextField.AddToClassList(textUssClassName); hierarchy.Add(m_TextField); m_TextField.RegisterValueChangedCallback(OnTextChanged); m_TextField.Q(TextField.textInputUssName).RegisterCallback <KeyDownEvent>(OnTextFieldKeyDown); m_SearchButton = new Button(() => {}) { name = "unity-search" }; m_SearchButton.AddToClassList(searchButtonUssClassName); m_TextField.hierarchy.Add(m_SearchButton); m_CancelButton = new Button(() => {}) { name = "unity-cancel" }; m_CancelButton.AddToClassList(cancelButtonUssClassName); m_CancelButton.AddToClassList(cancelButtonOffVariantUssClassName); m_TextField.hierarchy.Add(m_CancelButton); }
/// <summary> /// Constructor. /// </summary> public ToolbarToggle() { focusable = false; Toolbar.SetToolbarStyleSheet(this); RemoveFromClassList(Toggle.ussClassName); AddToClassList(ussClassName); }
public ToolbarMenu() { Toolbar.SetToolbarStyleSheet(this); clickable = new Clickable(this.ShowMenu); this.AddManipulator(clickable); menu = new DropdownMenu(); AddToClassList(ussClassName); }
/// <summary> /// Constructor. /// </summary> public ToolbarMenu() { Toolbar.SetToolbarStyleSheet(this); generateVisualContent = null; this.AddManipulator(new Clickable(this.ShowMenu)); menu = new DropdownMenu(); AddToClassList(ussClassName); m_TextElement = new TextElement(); m_TextElement.AddToClassList(textUssClassName); m_TextElement.pickingMode = PickingMode.Ignore; Add(m_TextElement); m_ArrowElement = new VisualElement(); m_ArrowElement.AddToClassList(arrowUssClassName); m_ArrowElement.pickingMode = PickingMode.Ignore; Add(m_ArrowElement); }
/// <summary> /// Constructs a breadcrumb UI element for the toolbar to help users navigate a hierarchy. /// </summary> public ToolbarBreadcrumbs() { Toolbar.SetToolbarStyleSheet(this); AddToClassList(ussClassName); }
public ToolbarSpacer() { Toolbar.SetToolbarStyleSheet(this); AddToClassList(ussClassName); }