Differential D11056 Diff 36443 source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_spreadsheet/spreadsheet_column_values.hh
| Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | public: | ||||
| { | { | ||||
| get_value_(index, r_cell_value); | get_value_(index, r_cell_value); | ||||
| } | } | ||||
| }; | }; | ||||
| /* Utility function that simplifies creating a spreadsheet column from a lambda function. */ | /* Utility function that simplifies creating a spreadsheet column from a lambda function. */ | ||||
| template<typename GetValueF> | template<typename GetValueF> | ||||
| std::unique_ptr<ColumnValues> column_values_from_function(std::string name, | std::unique_ptr<ColumnValues> column_values_from_function(std::string name, | ||||
| int size, | const int size, | ||||
| GetValueF get_value) | 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)); | 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 | } // namespace blender::ed::spreadsheet | ||||