Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_align.c
| Show First 20 Lines • Show All 371 Lines • ▼ Show 20 Lines | case UI_BUT_ALIGN_RIGHT: | ||||
| rect->xmin = rect->xmax - but_width; | rect->xmin = rect->xmax - but_width; | ||||
| break; | break; | ||||
| default: | default: | ||||
| /* Tabs may be shown in unaligned regions too, they just appear as regular buttons then. */ | /* Tabs may be shown in unaligned regions too, they just appear as regular buttons then. */ | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * Compute the alignment of all 'align groups' of buttons in given block. | |||||
| * | |||||
| * This is using an order-independent algorithm, | |||||
| * i.e. alignment of buttons should be OK regardless of order in which | |||||
| * they are added to the block. | |||||
| */ | |||||
| void ui_block_align_calc(uiBlock *block, const ARegion *region) | void ui_block_align_calc(uiBlock *block, const ARegion *region) | ||||
| { | { | ||||
| int num_buttons = 0; | int num_buttons = 0; | ||||
| const int sides_to_ui_but_align_flags[4] = SIDE_TO_UI_BUT_ALIGN; | const int sides_to_ui_but_align_flags[4] = SIDE_TO_UI_BUT_ALIGN; | ||||
| ButAlign *butal_array; | ButAlign *butal_array; | ||||
| ButAlign *butal, *butal_other; | ButAlign *butal, *butal_other; | ||||
| ▲ Show 20 Lines • Show All 381 Lines • Show Last 20 Lines | |||||