Calculates the initial order (=position) for a new theme in the tree. Themes are added at the top of the tree, but underneath any pinned themes. Defaults to 0. This prevents themes of visibly "jumping" around in the tree after being added due to reordering.
Removes all layers from the layer tree except themes that are pinned.