78e330923d
Implements scrolling support for tree-views, as well as changing the size of the scroll-able tree-view. This is important to be able to place them in many places in the UI, where a compact layout is preferred over an every expanding one (causing following contents to be scrolled out of view). UI-lists would use scrolling and resizing to ensure this, now tree-views are on par. Enables scrolling and resizing for: - Bone collection UI (`UILayout.template_bone_collection_tree()`) - Grease Pencil layer UI (`UILayout.template_grease_pencil_layer_tree()`) - Light link collection UI (`UILayout.template_light_linking_collection()`) - UI to define a node tree interface (`UILayout.template_node_tree_interface()`) These are all cases where compact UIs make more sense than expanding ones. Internally this is enabled by calling the `set_default_rows()` method of the tree-view, although the API might change still. It shouldn't be quite simple to implement this for grid-views too if necessary, or other potential view types. Although I'd like to do some smaller code quality improvements still, this feature is important for some other modules (e.g. grease pencil module for the layers UI in grease pencil v3), so I decided to prioritize merging this. Pull Request: https://projects.blender.org/blender/blender/pulls/119668