Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_layout.c
| Context not available. | |||||
| uiItemS(target); | uiItemS(target); | ||||
| } | } | ||||
| else { | else { | ||||
| /* XXX bug here, colums draw bottom item badly */ | /* XXX bug here, columns draw bottom item badly */ | ||||
| uiItemS(target); | uiItemS(target); | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| /* multi-column and multi-row layout. */ | /* multi-column and multi-row layout. */ | ||||
| typedef struct UILayoutGridFlowInput { | typedef struct UILayoutGridFlowInput { | ||||
| /* General layout controll settings. */ | /* General layout control settings. */ | ||||
| const bool row_major : 1; /* Fill rows before columns */ | const bool row_major : 1; /* Fill rows before columns */ | ||||
| const bool even_columns : 1; /* All columns will have same width. */ | const bool even_columns : 1; /* All columns will have same width. */ | ||||
| const bool even_rows : 1; /* All rows will have same height. */ | const bool even_rows : 1; /* All rows will have same height. */ | ||||
| Context not available. | |||||
| /* Even in varying column width case, we fix our columns number from weighted average width of items, | /* Even in varying column width case, we fix our columns number from weighted average width of items, | ||||
| * a proper solving of required width would be too costly, and this should give reasonably good results | * a proper solving of required width would be too costly, and this should give reasonably good results | ||||
| * in all resonable cases... */ | * in all reasonable cases... */ | ||||
| if (gflow->columns_len > 0) { | if (gflow->columns_len > 0) { | ||||
| gflow->tot_columns = gflow->columns_len; | gflow->tot_columns = gflow->columns_len; | ||||
| } | } | ||||
| Context not available. | |||||
| const int step = modulo ? modulo : 1; | const int step = modulo ? modulo : 1; | ||||
| if (gflow->row_major) { | if (gflow->row_major) { | ||||
| /* Adjust number of columns to be mutiple of given modulo. */ | /* Adjust number of columns to be multiple of given modulo. */ | ||||
| if (modulo && gflow->tot_columns % modulo != 0 && gflow->tot_columns > modulo) { | if (modulo && gflow->tot_columns % modulo != 0 && gflow->tot_columns > modulo) { | ||||
| gflow->tot_columns = gflow->tot_columns - (gflow->tot_columns % modulo); | gflow->tot_columns = gflow->tot_columns - (gflow->tot_columns % modulo); | ||||
| } | } | ||||
| Context not available. | |||||
| gflow->tot_columns -= step); | gflow->tot_columns -= step); | ||||
| } | } | ||||
| else { | else { | ||||
| /* Adjust number of rows to be mutiple of given modulo. */ | /* Adjust number of rows to be multiple of given modulo. */ | ||||
| if (modulo && gflow->tot_rows % modulo != 0) { | if (modulo && gflow->tot_rows % modulo != 0) { | ||||
| gflow->tot_rows = min_ii(gflow->tot_rows + modulo - (gflow->tot_rows % modulo), gflow->tot_items); | gflow->tot_rows = min_ii(gflow->tot_rows + modulo - (gflow->tot_rows % modulo), gflow->tot_items); | ||||
| } | } | ||||
| Context not available. | |||||