The Moonlight|3D toolchest widget

The toolchest is a specialised widget in Moonlight|3D. It displays a range of tools that the user can choose in a tree like fashion including tool options for each tool as additional areas that can be expanded. As of Moonlight|3D 0.1.4 it can only reasonably exist in a single instance because the tree of tools is stored statically so that plugins can register tools during the plugin initialisation phase of the startup sequence during which no widgets of the final UI are created. This restriction may be lifted in future versions of the widget when the need arises.

Toolchest structure

Although the toolchest appears as a single widget on screen it is a complex composite of several different widget types with additional overhead to create the tree-like layout. The toplevel widget in this construct is the ml.plugins.ui.mainwindow.toolchest.ToolChestView widget, which also contains all static methods to manage the tree of tools for this widget. It also directly manages the !QScrollArea that contains the tree.

The tree itself is built by ml.plugins.ui.mainwindow.toolchest.ToolCategory widgets as internal nodes and ml.plugins.ui.mainwindow.toolchest.ToolButton widgets as leaf nodes for the individual tools. The tree always contains an invisible root ToolCategory widget which layouts the top-level ToolCategory and ToolButton widgets with the usual ToolCategory layout logic.

Toolchest population on startup

How to write tools and tool editors