diff options
Diffstat (limited to 'source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh')
-rw-r--r-- | source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh | 14 |
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 |