Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
 public BreadcrumbItem(Action clickEvent) :
     base(clickEvent)
 {
     Toolbar.SetToolbarStyleSheet(this);
     RemoveFromClassList(ussClassName);
     AddToClassList(itemClassName);
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public ToolbarToggle()
        {
            focusable = false;

            Toolbar.SetToolbarStyleSheet(this);
            RemoveFromClassList(Toggle.ussClassName);
            AddToClassList(ussClassName);
        }
Exemplo n.º 5
0
        public ToolbarMenu()
        {
            Toolbar.SetToolbarStyleSheet(this);

            clickable = new Clickable(this.ShowMenu);
            this.AddManipulator(clickable);
            menu = new DropdownMenu();

            AddToClassList(ussClassName);
        }
Exemplo n.º 6
0
        /// <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);
        }
Exemplo n.º 7
0
 /// <summary>
 /// Constructs a breadcrumb UI element for the toolbar to help users navigate a hierarchy.
 /// </summary>
 public ToolbarBreadcrumbs()
 {
     Toolbar.SetToolbarStyleSheet(this);
     AddToClassList(ussClassName);
 }
Exemplo n.º 8
0
 public ToolbarSpacer()
 {
     Toolbar.SetToolbarStyleSheet(this);
     AddToClassList(ussClassName);
 }