Example #1
0
        public void Refresh()
        {
            // GUI assert here is to catch Bug 434065 - Exception while going to the editor
            Runtime.AssertMainThread();

            if (toolboxService.Initializing)
            {
                SetCustomMessage(GettextCatalog.GetString("Initializing..."));
                return;
            }

            ConfigureToolbar();

            SetCustomMessage(null);

            toolboxWidget.ClearImageCache();

            categories.Clear();

            AddItems(toolboxService.GetCurrentToolboxItems());

            DragSourceUnset?.Invoke(this, EventArgs.Empty);

            Gtk.TargetEntry [] targetTable = toolboxService.GetCurrentDragTargetTable();
            if (targetTable != null)
            {
                DragSourceSet?.Invoke(this, targetTable);
            }

            Refilter(true);

            compactModeToggleButton.Hidden = !toolboxWidget.CanIconizeToolboxCategories;
            compactModeToggleButton.InvalidateIntrinsicContentSize();
            keyViewLoopDelegate.RecalculeNextResponderChain();

            if (categories.Count == 0)
            {
                SetCustomMessage(GettextCatalog.GetString("There are no tools available for the current document."));
            }
        }