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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-04-26 10:09:50 +0300
committerJacques Lucke <jacques@blender.org>2021-04-26 10:09:50 +0300
commita17ea1a6691920cc307f3e44dd285b2d8e8bdd35 (patch)
tree441606fe1d3a59e35107f6743676ce28ec7d9222 /source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh
parentf2d70c02f88cc00266d330d89ea916e26c0ecf44 (diff)
Spreadsheet: combine vector/color spreadsheet columns
Differential Revision: https://developer.blender.org/D11056
Diffstat (limited to 'source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh')
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh b/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh
index 58a2776e0fc..373c988a41c 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh
@@ -74,11 +74,19 @@ template<typename GetValueF> class LambdaColumnValues : public ColumnValues {
/* Utility function that simplifies creating a spreadsheet column from a lambda function. */
template<typename GetValueF>
std::unique_ptr<ColumnValues> column_values_from_function(std::string name,
- int size,
- GetValueF get_value)
+ const int size,
+ GetValueF get_value,
+ const float default_width = 0.0f)
{
- return std::make_unique<LambdaColumnValues<GetValueF>>(
+ std::unique_ptr<ColumnValues> column_values = std::make_unique<LambdaColumnValues<GetValueF>>(
std::move(name), size, std::move(get_value));
+ column_values->default_width = default_width;
+ return column_values;
}
+static constexpr float default_float_column_width = 3;
+static constexpr float default_float2_column_width = 2 * default_float_column_width;
+static constexpr float default_float3_column_width = 3 * default_float_column_width;
+static constexpr float default_color_column_width = 4 * default_float_column_width;
+
} // namespace blender::ed::spreadsheet