diff options
author | Hans Goudey <h.goudey@me.com> | 2021-11-20 01:36:11 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-11-20 01:36:11 +0300 |
commit | 01df48a983944ab3f8a6f3be926f825ac83bbc14 (patch) | |
tree | 8fab42eb2a468786351e274027faa4538ecc631a /source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.hh | |
parent | a0780ad6253fcb9768dd3184351998effef6d178 (diff) |
Refactor: Port spreadsheet data set to UI tree view
This patch removes a bunch of specific code for drawing the spreadsheet
data set region, which was an overly specific solution for a generic UI.
Nowadays, the UI tree view API used for asset browser catalogs is a much
better way to implement this behavior.
To make this possible, the tree view API is extended in a few ways.
Collapsibility can now be turned off, and whether an item should
be active is moved to a separate virtual function.
The only visual change is that the items are now drawn in a box,
just like the asset catalog.
Differential Revision: https://developer.blender.org/D13198
Diffstat (limited to 'source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.hh')
-rw-r--r-- | source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.hh | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.hh b/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.hh index 19906d73e7f..4a604533f11 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.hh +++ b/source/blender/editors/space_spreadsheet/spreadsheet_dataset_draw.hh @@ -16,49 +16,11 @@ #pragma once -#include <array> - -#include "BKE_geometry_set.hh" -#include "UI_interface.h" -#include "spreadsheet_dataset_layout.hh" - -struct ARegion; -struct View2D; +struct Panel; struct bContext; -struct uiBlock; namespace blender::ed::spreadsheet { -class DatasetDrawContext; - -class DatasetRegionDrawer { - public: - const int row_height; - float ymin_offset = 0; - - int xmin; - int xmax; - uiBlock █ - const View2D &v2d; - DatasetDrawContext &draw_context; - - DatasetRegionDrawer(const ARegion *region, uiBlock &block, DatasetDrawContext &draw_context); - - void draw_hierarchy(const DatasetLayoutHierarchy &layout); - - void draw_attribute_domain_row(const DatasetComponentLayoutInfo &component, - const DatasetAttrDomainLayoutInfo &domain_info); - void draw_component_row(const DatasetComponentLayoutInfo &component_info); - - private: - void draw_dataset_row(const int indentation, - const GeometryComponentType component, - const std::optional<AttributeDomain> domain, - const BIFIconID icon, - const char *label, - const bool is_active); -}; - -void draw_dataset_in_region(const bContext *C, ARegion *region); +void spreadsheet_data_set_panel_draw(const bContext *C, Panel *panel); } // namespace blender::ed::spreadsheet |