Blender Git Commit Log

Git Commits -> Revision 7fcfbba

September 3, 2021, 21:19 (GMT)
Add and use initial UI Tree-View API

This adds a simple to use API to implement custom tree views. This
should make adding tree like layouts much easier & cleaner. Plus, it
should become easier to mange UI state (once I've done some more
additions).
Another goal for this was separating UI code better from the data,
currently we often have to add UI state information to the data (we may
still have to do this in some cases for file writing).

Idea is to let API users implement a custom tree-view class, that
inherits from `uiAbstractTreeView` and implements its `build_tree()`
function to add tree items. Each such item has a custom type, that
defines how its tree row is drawn. For that, another class can be added,
inheriting from `uiAbstractTreeViewItem` and implementing its
`build_row()` function. But this also adds `uiBasicTreeViewItem` which
is just a tree-row with an icon and a label, for convenience. More such
common tree-view item types can be added.

I'm quite happy with how this turned out eventually. This could work!

The resulting UI should look identical to the one before this commit.
Only internals changed (drastically).

Commit Details:

Full Hash: 7fcfbba30edd425ce99492041176d8bbac5729a5
Parent Commit: 769563d
Lines Changed: +537, -45

2 Added Paths:

/source/blender/editors/include/UI_tree_view.hh (+167, -0) (View)
/source/blender/editors/interface/tree_view.cc (+149, -0) (View)

11 Modified Paths:

/source/blender/blenkernel/BKE_asset_catalog.hh (+34, -1) (Diff)
/source/blender/blenkernel/intern/asset_catalog.cc (+62, -0) (Diff)
/source/blender/editors/include/UI_interface.h (+5, -0) (Diff)
/source/blender/editors/interface/CMakeLists.txt (+1, -0) (Diff)
/source/blender/editors/interface/interface.c (+14, -0) (Diff)
/source/blender/editors/interface/interface_handlers.c (+2, -0) (Diff)
/source/blender/editors/interface/interface_intern.h (+7, -0) (Diff)
/source/blender/editors/interface/interface_query.c (+2, -1) (Diff)
/source/blender/editors/interface/interface_widgets.c (+30, -7) (Diff)
/source/blender/editors/space_file/asset_catalog_tree_view.cc (+63, -36) (Diff)
/source/blender/editors/util/CMakeLists.txt (+1, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021