Cleanup: ui align header
This commit is contained in:
@@ -107,7 +107,7 @@ enum {
|
|||||||
/* Max distance between to buttons for them to be 'mergeable'. */
|
/* Max distance between to buttons for them to be 'mergeable'. */
|
||||||
#define MAX_DELTA 0.45f * max_ii(UI_UNIT_Y, UI_UNIT_X)
|
#define MAX_DELTA 0.45f * max_ii(UI_UNIT_Y, UI_UNIT_X)
|
||||||
|
|
||||||
bool ui_but_can_align(uiBut *but)
|
bool ui_but_can_align(const uiBut *but)
|
||||||
{
|
{
|
||||||
return !ELEM(but->type, UI_BTYPE_LABEL, UI_BTYPE_CHECKBOX, UI_BTYPE_CHECKBOX_N, UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE);
|
return !ELEM(but->type, UI_BTYPE_LABEL, UI_BTYPE_CHECKBOX, UI_BTYPE_CHECKBOX_N, UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE);
|
||||||
}
|
}
|
||||||
|
@@ -496,7 +496,6 @@ extern int ui_but_is_pushed(uiBut *but) ATTR_WARN_UNUSED_RESULT;
|
|||||||
|
|
||||||
extern void ui_block_bounds_calc(uiBlock *block);
|
extern void ui_block_bounds_calc(uiBlock *block);
|
||||||
extern void ui_block_translate(uiBlock *block, int x, int y);
|
extern void ui_block_translate(uiBlock *block, int x, int y);
|
||||||
extern void ui_block_align_calc(uiBlock *block);
|
|
||||||
|
|
||||||
extern struct ColorManagedDisplay *ui_block_cm_display_get(uiBlock *block);
|
extern struct ColorManagedDisplay *ui_block_cm_display_get(uiBlock *block);
|
||||||
void ui_block_cm_to_display_space_v3(uiBlock *block, float pixel[3]);
|
void ui_block_cm_to_display_space_v3(uiBlock *block, float pixel[3]);
|
||||||
@@ -709,7 +708,8 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN
|
|||||||
void ui_layout_list_set_labels_active(uiLayout *layout);
|
void ui_layout_list_set_labels_active(uiLayout *layout);
|
||||||
|
|
||||||
/* interface_align.c */
|
/* interface_align.c */
|
||||||
bool ui_but_can_align(uiBut *but) ATTR_WARN_UNUSED_RESULT;
|
bool ui_but_can_align(const uiBut *but) ATTR_WARN_UNUSED_RESULT;
|
||||||
|
void ui_block_align_calc(uiBlock *block);
|
||||||
|
|
||||||
/* interface_anim.c */
|
/* interface_anim.c */
|
||||||
void ui_but_anim_flag(uiBut *but, float cfra);
|
void ui_but_anim_flag(uiBut *but, float cfra);
|
||||||
|
@@ -3015,9 +3015,12 @@ static void ui_item_align(uiLayout *litem, short nr)
|
|||||||
#ifndef USE_UIBUT_SPATIAL_ALIGN
|
#ifndef USE_UIBUT_SPATIAL_ALIGN
|
||||||
if (ui_but_can_align(bitem->but))
|
if (ui_but_can_align(bitem->but))
|
||||||
#endif
|
#endif
|
||||||
if (!bitem->but->alignnr)
|
{
|
||||||
|
if (!bitem->but->alignnr) {
|
||||||
bitem->but->alignnr = nr;
|
bitem->but->alignnr = nr;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (item->type == ITEM_LAYOUT_ABSOLUTE) {
|
else if (item->type == ITEM_LAYOUT_ABSOLUTE) {
|
||||||
/* pass */
|
/* pass */
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user