Esempio n. 1
0
        private void DisplayAssetStoreCachePathSetting()
        {
            assetsCacheLocationInfo.enableRichText = true;
            assetsCacheLocationInfo.text           = string.Format(L10n.Tr("Your assets will be store in <b>{0}</b> subfolder."), k_AssetStoreFolder);
            assetsCacheDropdown.SetIcon("folder");
            var assetsCacheDropdownMenu = new DropdownMenu();

            assetsCacheDropdownMenu.AppendAction(k_OpenFolder, action =>
            {
                if (!string.IsNullOrWhiteSpace(assetsCachePath.text))
                {
                    m_ApplicationProxy.RevealInFinder(Paths.Combine(assetsCachePath.text, k_AssetStoreFolder));
                }
            }, action => m_CurrentAssetStoreConfig.status == AssetStoreCachePathManager.ConfigStatus.InvalidPath ? DropdownMenuAction.Status.Disabled : DropdownMenuAction.Status.Normal, "openLocation");
            assetsCacheDropdownMenu.AppendAction(k_ChangeLocation, action =>
            {
                var path = m_ApplicationProxy.OpenFolderPanel("Select Assets Cache Location", Paths.Combine(assetsCachePath.text, k_AssetStoreFolder));
                if (!string.IsNullOrWhiteSpace(path))
                {
                    path = path.NormalizePath();
                    if (path.EndsWith(Path.DirectorySeparatorChar + k_AssetStoreFolder))
                    {
                        path = path.Substring(0, path.Length - k_AssetStoreFolder.Length - 1);
                    }

                    if (string.CompareOrdinal(path, m_CurrentAssetStoreConfig.path.NormalizePath()) == 0)
                    {
                        return;
                    }

                    if (!CancelDownloadInProgress())
                    {
                        return;
                    }

                    var status = m_AssetStoreCachePathProxy.SetConfig(path);
                    if (status == AssetStoreCachePathManager.ConfigStatus.Failed)
                    {
                        DisplayAssetsCacheErrorBox(HelpBoxMessageType.Error, L10n.Tr($"Cannot set the Assets Cache location, \"{path}\" is invalid or inaccessible."));
                    }
                }
            }, action => m_CurrentAssetStoreConfig.source != ConfigSource.Environment ? DropdownMenuAction.Status.Normal : DropdownMenuAction.Status.Disabled, "selectLocation");
            assetsCacheDropdownMenu.AppendAction(k_ResetToDefaultLocation, action =>
            {
                if (!CancelDownloadInProgress())
                {
                    return;
                }

                var status = m_AssetStoreCachePathProxy.ResetConfig();
                if (status == AssetStoreCachePathManager.ConfigStatus.Failed)
                {
                    DisplayAssetsCacheErrorBox(HelpBoxMessageType.Error, L10n.Tr("Cannot reset the Assets Cache location to default."));
                }
            }, action => m_CurrentAssetStoreConfig.source == ConfigSource.User ? DropdownMenuAction.Status.Normal : DropdownMenuAction.Status.Disabled, "resetLocation");
            assetsCacheDropdown.menu = assetsCacheDropdownMenu;

            GetAssetStoreCacheConfig();
            m_AssetStoreCachePathProxy.onConfigChanged += RefreshAssetStoreCachePathConfig;
        }
Esempio n. 2
0
        private void CollapsedPackageActionsOnBeforeShowDropdown()
        {
            var newDropdownMenu = new DropdownMenu();

            foreach (var extension in m_PackageActions.Where(a => a.visible))
            {
                var packageActionText = !string.IsNullOrEmpty(extension.text) ? extension.text : extension.tooltip;
                if (!extension.visibleDropdownItems.Any())
                {
                    newDropdownMenu.AppendAction(packageActionText, a => { extension.action?.Invoke(m_Window.activeSelection); });
                }
                else
                {
                    if (extension.action != null)
                    {
                        newDropdownMenu.AppendAction($"{packageActionText}/{packageActionText}", a => { extension.action?.Invoke(m_Window.activeSelection); });
                    }
                    foreach (var item in extension.visibleDropdownItems)
                    {
                        newDropdownMenu.AppendAction($"{packageActionText}/{item.text}", a => { item.action?.Invoke(m_Window.activeSelection); }, item.statusCallback);
                    }
                }
            }
            m_CollapsedPackageActions.menu = newDropdownMenu;
        }
Esempio n. 3
0
        private void DisplayPackagesCacheSetting()
        {
            packagesCacheDropdown.SetIcon("folder");
            var packagesCacheDropdownMenu = new DropdownMenu();

            packagesCacheDropdownMenu.AppendAction(k_OpenFolder, action =>
            {
                if (!string.IsNullOrWhiteSpace(currentPackagesNormalizedPath))
                {
                    m_ApplicationProxy.RevealInFinder(currentPackagesNormalizedPath);
                }
            }, action => DropdownMenuAction.Status.Normal, "openLocation");
            packagesCacheDropdownMenu.AppendAction(k_ChangeLocation, action =>
            {
                var path = m_ApplicationProxy.OpenFolderPanel(L10n.Tr("Select Packages Cache Location"), currentPackagesNormalizedPath);
                path     = path.NormalizePath();
                if (!string.IsNullOrWhiteSpace(path) && string.CompareOrdinal(path, currentPackagesNormalizedPath) != 0)
                {
                    m_UpmCacheRootClient.SetCacheRoot(path);
                }
            }, action => m_CurrentPackagesConfig.source != ConfigSource.Environment ? DropdownMenuAction.Status.Normal : DropdownMenuAction.Status.Disabled, "selectLocation");
            packagesCacheDropdownMenu.AppendAction(k_ResetToDefaultLocation, action =>
            {
                m_UpmCacheRootClient.ClearCacheRoot();
            }, action => m_CurrentPackagesConfig.source == ConfigSource.User ? DropdownMenuAction.Status.Normal : DropdownMenuAction.Status.Disabled, "resetLocation");
            packagesCacheDropdown.menu = packagesCacheDropdownMenu;

            m_UpmCacheRootClient.onGetCacheRootOperationError    += OnPackagesGetCacheRootOperationError;
            m_UpmCacheRootClient.onGetCacheRootOperationResult   += OnPackagesGetCacheRootOperationResult;
            m_UpmCacheRootClient.onSetCacheRootOperationError    += OnPackagesSetCacheRootOperationError;
            m_UpmCacheRootClient.onSetCacheRootOperationResult   += OnPackagesSetCacheRootOperationResult;
            m_UpmCacheRootClient.onClearCacheRootOperationError  += OnPackagesClearCacheRootOperationError;
            m_UpmCacheRootClient.onClearCacheRootOperationResult += OnPackagesClearCacheRootOperationResult;

            if (!m_ApplicationProxy.isBatchMode && m_ApplicationProxy.isUpmRunning)
            {
                packagesCachePath.text = string.Empty;
                packagesCacheDropdown.SetEnabled(false);

                UIUtils.SetElementDisplay(packagesCacheErrorBox, false);

                m_UpmCacheRootClient.GetCacheRoot();
            }
            else
            {
                packagesCachePath.text = string.Empty;
                packagesCacheDropdown.SetEnabled(false);

                DisplayPackagesCacheErrorBox(HelpBoxMessageType.Error, L10n.Tr("Cannot get the Packages Cache location, UPM server is not running."));
            }
        }
Esempio n. 4
0
        // ECS Specific contextual menu entries fall in here
        public void BuildContextualMenu(DropdownMenu menu,
                                        VisualElement targetElement,
                                        Store store,
                                        Vector2 mousePosition)
        {
            if (targetElement == null)
            {
                return;
            }

            var componentRow = targetElement.GetFirstOfType <ComponentRow>();

            if (componentRow?.Component != null)
            {
                menu.AppendAction("Update", menuAction =>
                {
                    var filter = new SearcherFilter(SearcherContext.Type)
                                 .WithComponentData(m_Stencil)
                                 .WithSharedComponentData(m_Stencil);
                    componentRow.UpdateType(mousePosition, filter);
                }, eventBase => DropdownMenuAction.Status.Normal);
                menu.AppendAction("Delete", menuAction =>
                {
                    store.Dispatch(new RemoveComponentFromQueryAction((ComponentQueryDeclarationModel)componentRow.GraphElementModel, componentRow.Component));
                }, eventBase => DropdownMenuAction.Status.Normal);
                return;
            }

            if (targetElement is CriterionRow criterionRow && criterionRow.Criterion != null)
            {
                menu.AppendAction("Update", menuAction =>
                {
                    criterionRow.Update(mousePosition);
                }, eventBase => DropdownMenuAction.Status.Normal);
                menu.AppendAction("Delete", menuAction =>
                {
                    store.Dispatch(new RemoveCriterionAction((ICriteriaModelContainer)criterionRow.GraphElementModel, criterionRow.CriteriaModel, criterionRow.Criterion));
                }, eventBase => DropdownMenuAction.Status.Normal);
                return;
            }

            var criteriaModelRow = targetElement.GetFirstOfType <CriteriaModelRow>();

            if (criteriaModelRow?.CriteriaModel != null)
            {
                menu.AppendAction("Delete", menuAction =>
                {
                    store.Dispatch(new RemoveCriteriaModelAction((ICriteriaModelContainer)criteriaModelRow.GraphElementModel, criteriaModelRow.CriteriaModel));
                }, eventBase => DropdownMenuAction.Status.Normal);
            }
        }
Esempio n. 5
0
        public MarkerTrack(Timeline owner) : base(owner)
        {
            name = "Markers";
            AddToClassList("markerTrack");

            RegisterCallback <AttachToPanelEvent>(OnAttachToPanel);
            RegisterCallback <DetachFromPanelEvent>(OnDetachFromPanel);

            m_MarkerOverlapIndicators = new List <MarkerOverlapIndicator>();
            var manipulator = new ContextualMenuManipulator(evt =>
            {
                DropdownMenu menu = evt.menu;
                float time        = m_Owner.WorldPositionToTime(evt.mousePosition.x);
                if (m_Owner.ViewMode == TimelineViewMode.frames)
                {
                    time = (float)TimelineUtility.RoundToFrame(time, Clip.SampleRate);
                }

                string timeStr = TimelineUtility.GetTimeString(m_Owner.ViewMode, time, (int)Clip.SampleRate);

                menu.AppendAction($"Add Marker at {timeStr}", null, DropdownMenuAction.Status.Disabled);
                menu.AppendSeparator();
                var menuStatus = EditorApplication.isPlaying ? DropdownMenuAction.Status.Disabled : DropdownMenuAction.Status.Normal;
                foreach (Type markerType in MarkerAttribute.GetMarkerTypes())
                {
                    evt.menu.AppendAction(MarkerAttribute.GetDescription(markerType), action => OnAddAnnotationSelection(markerType, time), a => menuStatus, markerType);
                }
            });

            this.AddManipulator(manipulator);
        }
            protected override void AddItem <TContainer, TValue>(Property <TContainer, TValue> property, ref TValue value)
            {
                var v = value;

                m_Menu.AppendAction($"{k_CopyPrefix}{property.Name}",
                                    action => { EditorGUIUtility.systemCopyBuffer = JsonSerialization.ToJson(v); });
            }
Esempio n. 7
0
 private void AddContextMenuOptions(DropdownMenu objMenu, Tuple <string, Action>[] contextualMenuOptions)
 {
     for (int i = 0; i < contextualMenuOptions.Length; i++)
     {
         int localIndex = i;
         objMenu.AppendAction(contextualMenuOptions[i].Item1, dropdownMenuAction => contextualMenuOptions[localIndex].Item2.Invoke());
     }
 }
        public static void AddCopyValue <TValue>(this DropdownMenu menu, TValue value)
        {
            menu.AppendAction($"{k_CopyPrefix}All", action => { EditorGUIUtility.systemCopyBuffer = JsonSerialization.ToJson(value); });
            menu.AppendSeparator(k_CopyPrefix);
            var visitor = new DropdownMenuCopyVisitor(menu);

            PropertyContainer.Visit(value, visitor);
        }
Esempio n. 9
0
    private void PopulateContextMenu(ContextualMenuPopulateEvent populateEvent)
    {
        DropdownMenu dropdownMenu = populateEvent.menu;

        if (IsCloseable)
        {
            dropdownMenu.AppendAction("Close Tab", e => OnClose(this));
        }
    }
Esempio n. 10
0
 void AppendWorlds(DropdownMenu menu, WorldCategoryHelper.Category category)
 {
     foreach (var world in category.Worlds)
     {
         menu.AppendAction(world.Name, OnWorldSelected, a =>
                           (BaseState.SelectedWorldName == world.Name)
             ? DropdownMenuAction.Status.Checked
             : DropdownMenuAction.Status.Normal, world);
     }
 }
Esempio n. 11
0
 public static void SetupOptions <T>(this DropdownMenu self, T initialValue, Action <T> callback, Func <T, bool> statusCallback) where T : Enum
 {
     foreach (T value in Enum.GetValues(typeof(T)))
     {
         self.AppendAction(value.ToString(),
                           a => { callback.Invoke(value); },
                           a => { return(statusCallback.Invoke(value) ? DropdownMenuAction.Status.Checked : DropdownMenuAction.Status.Normal); });
     }
     callback.Invoke(initialValue);
 }
Esempio n. 12
0
        void AddNoteMenuItems(DropdownMenu menu, string menuText, string category, Action <VisualElement, SpriteAlignment> createMethod)
        {
            Array spriteAlignments = Enum.GetValues(typeof(SpriteAlignment));

            Array.Reverse(spriteAlignments);
            foreach (SpriteAlignment align in spriteAlignments)
            {
                SpriteAlignment alignment = align;
                menu.AppendAction(menuText + "/" + category + "/" + alignment, (a) => createMethod(this, alignment), DropdownMenuAction.AlwaysEnabled);
            }
        }
Esempio n. 13
0
        private void Start()
        {
            var root = uiDoc.rootVisualElement;

            dropdown = new Dropdown(root);

            //setup button menu;
            btnMenu = new DropdownMenu();
            btnMenu.AppendAction("Action 1", DoMenuAction);
            btnMenu.AppendAction("Action 2", DoMenuAction);
            btnMenu.AppendAction("Action 3", DoMenuAction);
            btnMenu.AppendAction("DisabledAction", DoMenuAction, DropdownMenuAction.AlwaysDisabled);
            btnMenu.AppendSeparator();
            btnMenu.AppendAction("Sub Menu/Action 4", DoMenuAction);
            btnMenu.AppendSeparator("Sub Menu/");
            btnMenu.AppendAction("Sub Menu/Action 5", DoMenuAction);
            btnMenu.AppendAction("Sub Menu/Another Sub Menu/Action 6", DoMenuAction);
            btnMenu.AppendAction("Sub Menu/Another Sub Menu/Action 7", DoMenuAction);
            btnMenu.AppendAction("Deep/Nested/Menu/That/Would/Annoy/Anyone/That/Has/To/Click/Through/It/But/Atleast/It/Wraps/Around/Nicely/When/It/Reaches/The/End/Of/The/Screen", DoMenuAction);

            var btn = root.Q <Button>(name: "dropdown-btn");

            btn.clickable.clicked += () => dropdown.Open(btnMenu, btn.worldBound);

            //setup pointer menu;
            pointerMenu = new DropdownMenu();
            pointerMenu.AppendAction("Koala", ToggleOption, GetOptionStatus);
            pointerMenu.AppendAction("Kangaroo", ToggleOption, GetOptionStatus);
            pointerMenu.AppendAction("Platypus", ToggleOption, GetOptionStatus);
            pointerMenu.AppendAction("Wombat", ToggleOption, GetOptionStatus);


            root.Q <VisualElement>(name: "dropdown-area").RegisterCallback <PointerDownEvent>(evt =>
            {
                if (evt.button == 1)
                {
                    Debug.Log("Click");
                    dropdown.Open(pointerMenu, evt.position);
                }
            });
        }
 private void CreateDropdown(DropdownMenu menu)
 {
     foreach (ShapeBlueprintFactory.ShapeBlueprintType shapeType in Enum
              .GetValues(typeof(ShapeBlueprintFactory.ShapeBlueprintType))
              .Cast <ShapeBlueprintFactory.ShapeBlueprintType>())
     {
         menu.AppendAction(
             shapeType.ToString(),
             menuAction => CreateBlueprint(shapeType),
             DropdownMenuAction.AlwaysEnabled);
     }
 }
Esempio n. 15
0
        public void OnAdvancedMenuCreate(DropdownMenu menu)
        {
            if (!Unsupported.IsDeveloperMode())
            {
                return;
            }

            menu.AppendSeparator();
            menu.AppendAction("Internal/Always show development tools", a =>
            {
                OnDevelopmentToolToggle();
            }, a => !Unsupported.IsDeveloperMode() ? DropdownMenuAction.Status.Hidden :
                              AlwaysShowDevTools?DropdownMenuAction.Status.Checked: DropdownMenuAction.Status.Normal);
        }
        private void BuildNameFieldContextualMenu(DropdownMenu menu, object target)
        {
            menu.AppendAction(
                BuilderConstants.ContextMenuUnsetMessage,
                UnsetName,
                action =>
            {
                var vea = currentVisualElement.GetVisualElementAsset();

                return(vea != null && vea.HasAttribute("name")
                        ? DropdownMenuAction.Status.Normal
                        : DropdownMenuAction.Status.Disabled);
            },
                target);
        }
Esempio n. 17
0
 private void RefreshCheckUpdateMenuOption(PackageFilterTab tab)
 {
     if (tab == PackageFilterTab.AssetStore)
     {
         var menu = new DropdownMenu();
         menu.AppendAction(L10n.Tr("Check for updates"), a =>
         {
             m_AssetStoreCallQueue.ForceCheckUpdateForAllLocalInfos();
         }, action => m_AssetStoreCallQueue.isCheckUpdateInProgress ? DropdownMenuAction.Status.Disabled : DropdownMenuAction.Status.Normal);
         refreshButton.menu = menu;
     }
     else
     {
         refreshButton.menu = null;
     }
 }
Esempio n. 18
0
        public void AddDropdownItem(DropdownMenu menu, int value)
        {
            var textValue = value == (int)AssetsToLoad.All ? k_All : value.ToString();

            textValue = L10n.Tr(textValue);
            menu.AppendAction(textValue, a =>
            {
                loadAssetsDropdown.text    = textValue;
                m_SettingsProxy.loadAssets = value;
                m_SettingsProxy.Save();
                UpdateLoadBarMessage();
                LoadItemsClicked();
                UpdateMenu();

                PackageManagerWindowAnalytics.SendEvent($"load {value}");
            }, a => m_SettingsProxy.loadAssets == value ? DropdownMenuAction.Status.Checked : DropdownMenuAction.Status.Normal);
        }
Esempio n. 19
0
        private void Start()
        {
            //setup custom menu
            customMenu = new DropdownMenu();
            for (int i = 0; i < items.Length; i++)
            {
                var item = items[i];
                customMenu.AppendAction(item.path, DoMenuAction, DropdownMenuAction.AlwaysEnabled, userData: item);
            }

            var root = uiDoc.rootVisualElement;

            customDropdown = new Dropdown(root, MakeCustomItem, SetCustomItem);

            var customBtn = root.Q <Button>(name: "custom-dropdown-btn");

            customBtn.clickable.clicked += () => customDropdown.Open(customMenu, customBtn.worldBound);
        }
Esempio n. 20
0
        void AppendWorldMenu(DropdownMenu menu, bool showAdvancedWorlds)
        {
            var worldCategories = WorldCategoryHelper.Categories;

            foreach (var category in worldCategories)
            {
                if (showAdvancedWorlds)
                {
                    menu.AppendAction(category.Name.ToUpper(), null, DropdownMenuAction.Status.Disabled);
                    AppendWorlds(menu, category);
                    menu.AppendSeparator();
                }
                else if (category.Flag == WorldFlags.Live)
                {
                    AppendWorlds(menu, category);
                    break;
                }
            }
        }
Esempio n. 21
0
        public void RefreshDropdown()
        {
            if (m_NeedRefresh || m_DropdownItems.Any(item => item.needRefresh))
            {
                m_BuiltInItems.Sort(ExtensionManager.CompareExtensions);
                m_DropdownItems.Sort(ExtensionManager.CompareExtensions);

                var newDropdownMenu = new DropdownMenu();
                foreach (var item in m_BuiltInItems.Concat(m_DropdownItems))
                {
                    if (item.insertSeparatorBefore)
                    {
                        newDropdownMenu.AppendSeparator();
                    }

                    newDropdownMenu.AppendAction(item.text, a => { item.action?.Invoke(); }, item.statusCallback, item.userData);
                    item.needRefresh = false;
                }
                menu          = newDropdownMenu;
                m_NeedRefresh = false;
            }
        }
Esempio n. 22
0
        public void OnAddMenuCreate(DropdownMenu menu)
        {
            menu.AppendSeparator("");

            menu.AppendAction("Create Package...", a =>
            {
                var defaultName              = PackageCreator.GenerateUniquePackageDisplayName("New Package");
                var createPackage            = new PackagesAction("Create", defaultName);
                createPackage.actionClicked += displayName =>
                {
                    createPackage.Hide();
                    var packagePath = PackageCreator.CreatePackage("Packages/" + displayName);
                    PackageManagerWindowAnalytics.SendEvent("createPackage");
                    AssetDatabase.Refresh();
#if UNITY_2020_1_OR_NEWER
                    EditorApplication.delayCall += () => Window.Open(displayName);
#else
                    EditorApplication.delayCall += () =>
                    {
                        var path = Path.Combine(packagePath, "package.json");
                        var o    = AssetDatabase.LoadMainAssetAtPath(path);
                        if (o != null)
                        {
                            Selection.activeObject = o;
                        }

                        PackageManagerWindow.SelectPackageAndFilter(displayName, PackageFilterTab.InDevelopment, true);
                    };
#endif
                };

                var parent = EditorWindow.GetWindow <PackageManagerWindow>()
                             .rootVisualElement.Q <PackageManagerToolbar>("topMenuToolbar")
                             .parent;
                parent.Add(createPackage);
                createPackage.Show();
            }, a => DropdownMenuAction.Status.Normal);
        }
 public override void OnCreateContextMenu(DropdownMenu dropdownMenu)
 {
     dropdownMenu.AppendSeparator();
     dropdownMenu.AppendAction("Add input", action => AddInput());
     dropdownMenu.AppendAction("Remove input", action => RemoveInput());
 }
 public static void AppendAction(this DropdownMenu contextualMenu, string actionName, Action action, Func <DropdownMenuAction.Status> actionStatusCallback)
 {
     Debug.Assert(action != null);
     Debug.Assert(actionStatusCallback != null);
     contextualMenu.AppendAction(actionName, e => action(), e => actionStatusCallback());
 }
 public static void AppendAction(this DropdownMenu contextualMenu, string actionName, Action action, DropdownMenuAction.Status statusFlags)
 {
     Debug.Assert(action != null);
     contextualMenu.AppendAction(actionName, e => action(), e => statusFlags);
 }
Esempio n. 26
0
        void CreateToolbarGUI()
        {
            Toolbar toolbar = new Toolbar();

            {
                ToolbarButton clearBtn = new ToolbarButton(() =>
                {
                    logDatas.Clear();
                    searchedLogDatas.Clear();
                    m_DataListView.UpdateViewer();
                });
                clearBtn.text = "Clear";
                toolbar.Add(clearBtn);

                ToolbarSpacer spacer = new ToolbarSpacer();
                spacer.style.flexGrow = 1;
                toolbar.Add(spacer);

                ToolbarPopupSearchField searchField   = new ToolbarPopupSearchField();
                DropdownMenu            searchMenu    = searchField.menu;
                List <string>           allFieldNames = (from fieldInfo in typeof(LogData).GetFields(BindingFlags.Public | BindingFlags.Instance)
                                                         select fieldInfo.Name).ToList();
                foreach (var fieldName in allFieldNames)
                {
                    searchMenu.AppendAction(
                        fieldName,
                        (action) =>
                    {
                        if (searchedFieldNames.IndexOf(action.name) >= 0)
                        {
                            searchedFieldNames.Remove(action.name);
                        }
                        else
                        {
                            searchedFieldNames.Add(action.name);
                        }
                    },
                        (action) =>
                    {
                        if (searchedFieldNames.Count > 0 && searchedFieldNames.IndexOf(action.name) >= 0)
                        {
                            return(DropdownMenuAction.Status.Checked);
                        }
                        else
                        {
                            return(DropdownMenuAction.Status.Normal);
                        }
                    },
                        fieldName);
                }
                searchField.RegisterValueChangedCallback((callback) =>
                {
                    searchText = callback.newValue;
                    UpdateSearchedDatas();
                });
                toolbar.Add(searchField);

                EnumFlagsField levelFlagsField = new EnumFlagsField(m_AliveLevel);
                levelFlagsField.label = "Alive Level";
                levelFlagsField.RegisterValueChangedCallback((callback) =>
                {
                    watcherAppender.AliveLevel = (LogLevel)callback.newValue;
                });
                toolbar.Add(levelFlagsField);
            };
            rootVisualElement.Add(toolbar);
        }