Differential D10819 Diff 35582 source/blender/editors/space_spreadsheet/spreadsheet_column_layout.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_spreadsheet/spreadsheet_column_layout.cc
| Show All 35 Lines | |||||
| public: | public: | ||||
| ColumnLayoutDrawer(const SpreadsheetColumnLayout &column_layout) : column_layout_(column_layout) | ColumnLayoutDrawer(const SpreadsheetColumnLayout &column_layout) : column_layout_(column_layout) | ||||
| { | { | ||||
| tot_columns = column_layout.columns.size(); | tot_columns = column_layout.columns.size(); | ||||
| tot_rows = column_layout.row_indices.size(); | tot_rows = column_layout.row_indices.size(); | ||||
| const int fontid = UI_style_get()->widget.uifont_id; | const int fontid = UI_style_get()->widget.uifont_id; | ||||
| /* Use a consistent font size for the width calculation. */ | /* Use a consistent font size for the width calculation. */ | ||||
| BLF_size(fontid, 11 * U.pixelsize, U.dpi); | BLF_size(fontid, UI_style_get_dpi()->widget.points * U.pixelsize, U.dpi); | ||||
| /* The width of the index column depends on the maximum row index. */ | /* The width of the index column depends on the maximum row index. */ | ||||
| left_column_width = std::to_string(std::max(0, column_layout_.tot_rows - 1)).size() * | left_column_width = std::to_string(std::max(0, column_layout_.tot_rows - 1)).size() * | ||||
| BLF_width(fontid, "0", 1) + | BLF_width(fontid, "0", 1) + | ||||
| UI_UNIT_X * 0.75; | UI_UNIT_X * 0.75; | ||||
| /* The column widths depend on the column name widths. */ | /* The column widths depend on the column name widths. */ | ||||
| const int minimum_column_width = 3 * UI_UNIT_X; | const int minimum_column_width = 3 * UI_UNIT_X; | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||