Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tree_element_label.hh « tree « space_outliner « editors « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fc730c7b8f49f78a896b338a146dc7a1c55aadeb (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
/* SPDX-License-Identifier: GPL-2.0-or-later */

/** \file
 * \ingroup spoutliner
 */

#pragma once

#include <string>

#include "UI_resources.h"

#include "tree_element.hh"

namespace blender::ed::outliner {

/**
 * A basic, general purpose tree element to just display a label and an icon. Can be used to group
 * together items underneath as well of course.
 *
 * Make sure to give this a unique index, so the element can be identified uniquely. Otherwise
 * glitches like multiple highlighted elements happen, that share all state (e.g. collapsed,
 * selected, etc.).
 */
class TreeElementLabel final : public AbstractTreeElement {
  const std::string label_;
  BIFIconID icon_ = ICON_NONE;

 public:
  TreeElementLabel(TreeElement &legacy_te, const char *label);

  void setIcon(BIFIconID icon);
  std::optional<BIFIconID> getIcon() const override;
};

}  // namespace blender::ed::outliner