Example #1
0
        public virtual void OnWindowDestroy()
        {
            if (m_Window == null)
            {
                return;
            }

            m_EventDispatcher.SendWindowDestroyEvent();

            m_DetailsExtensionContainer.Clear();
            m_DetailsExtensionContainer = null;
            m_DetailsExtensions.Clear();

            m_ToolbarExtensionContainer = null;

            m_PackageActionContainer.Clear();
            m_PackageActions.Clear();
            m_PackageActionContainer.RemoveFromHierarchy();
            m_CollapsedPackageActions.RemoveFromHierarchy();

            m_PackageActionContainer  = null;
            m_CollapsedPackageActions = null;

            m_Window = null;
        }
        public PackageStatusBar()
        {
            ResolveDependencies();

            var root = m_ResourceLoader.GetTemplate("PackageStatusBar.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            var dropDownButton = new DropdownButton();

            dropDownButton.name = "refreshButton";
            refreshButtonContainer.Add(dropDownButton);

            statusLabel.ShowTextTooltipOnSizeChange();
        }
Example #3
0
        public PackageLoadBar()
        {
            ResolveDependencies();

            var root = m_ResourceLoader.GetTemplate("PackageLoadBar.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            var dropDownButton = new DropdownButton();

            dropDownButton.name = "loadAssetsDropdown";
            loadAssetsDropdownContainer.Add(dropDownButton);

            loadMoreLabel.OnLeftClick(LoadItemsClicked);
        }
Example #4
0
        public virtual void OnWindowCreated(IWindow window, VisualElement detailsExtensionContainer, VisualElement toolbarExtensionsContainer)
        {
            m_Window = window;
            m_DetailsExtensionContainer = detailsExtensionContainer;
            m_ToolbarExtensionContainer = toolbarExtensionsContainer;

            m_CollapsedPackageActions = new DropdownButton();
            m_CollapsedPackageActions.alwaysShowDropdown = true;
            m_CollapsedPackageActions.text = L10n.Tr("Extensions");
            m_CollapsedPackageActions.onBeforeShowDropdown += CollapsedPackageActionsOnBeforeShowDropdown;
            UIUtils.SetElementDisplay(m_CollapsedPackageActions, false);
            m_ToolbarExtensionContainer.Add(m_CollapsedPackageActions);

            m_PackageActionContainer = new VisualElement();
            m_PackageActionContainer.style.flexDirection = FlexDirection.Row;
            m_ToolbarExtensionContainer.Add(m_PackageActionContainer);

            m_ToolbarExtensionContainer.RegisterCallback <GeometryChangedEvent>(evt => RefreshPackageActionsBasedOnWidth());

            m_EventDispatcher.SendWindowCreatedEvent(window);
        }