Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_edit.c
| Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Toggle Open/Closed Operator | /** \name Toggle Open/Closed Operator | ||||
| * \{ */ | * \{ */ | ||||
| /* Open or close a tree element, optionally toggling all children recursively */ | /* Open or close a tree element, optionally toggling all children recursively */ | ||||
| void outliner_item_openclose(TreeElement *te, bool open, bool toggle_all) | void outliner_item_openclose(TreeElement *te, bool open, bool toggle_all) | ||||
| { | { | ||||
| TreeStoreElem *tselem = TREESTORE(te); | if (BLI_listbase_is_empty(&te->subtree)) { | ||||
| return; | |||||
| } | |||||
| TreeStoreElem *tselem = TREESTORE(te); | |||||
| if (open) { | if (open) { | ||||
| tselem->flag &= ~TSE_CLOSED; | tselem->flag &= ~TSE_CLOSED; | ||||
| } | } | ||||
| else { | else { | ||||
| tselem->flag |= TSE_CLOSED; | tselem->flag |= TSE_CLOSED; | ||||
| } | } | ||||
| if (toggle_all) { | if (toggle_all) { | ||||
| ▲ Show 20 Lines • Show All 2,274 Lines • Show Last 20 Lines | |||||