blob: d6483c44fcec2566ae99e8246d35b7b2b60aa2b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup spoutliner
*/
#include <functional>
#include "BLI_listbase.h"
#include "DNA_space_types.h"
#include "outliner_intern.hh"
#include "tree/tree_display.hh"
using namespace blender::ed::outliner;
bool outliner_shows_mode_column(const SpaceOutliner &space_outliner)
{
const AbstractTreeDisplay &tree_display = *space_outliner.runtime->tree_display;
return tree_display.supportsModeColumn() && (space_outliner.flag & SO_MODE_COLUMN);
}
/**
* Iterate over the entire tree (including collapsed sub-elements), probing if any of the elements
* has a warning to be displayed.
*/
bool outliner_has_element_warnings(const SpaceOutliner &space_outliner)
{
std::function<bool(const ListBase &)> recursive_fn;
recursive_fn = [&](const ListBase &lb) {
LISTBASE_FOREACH (const TreeElement *, te, &lb) {
if (te->abstract_element && !te->abstract_element->getWarning().is_empty()) {
return true;
}
if (recursive_fn(te->subtree)) {
return true;
}
}
return false;
};
return recursive_fn(space_outliner.tree);
}
|