From 441c6602704e3a7b828dd4b71ea8061fe9c531bc Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 22 Feb 2021 13:18:49 -0600 Subject: Cleanup: Use bool instead of char --- source/blender/editors/interface/interface.c | 11 +++++------ source/blender/editors/interface/interface_handlers.c | 2 +- source/blender/editors/interface/interface_intern.h | 8 ++++---- 3 files changed, 10 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/interface') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 1aff68871e4..636efbc50ce 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -988,10 +988,9 @@ bool UI_but_active_only(const bContext *C, ARegion *region, uiBlock *block, uiBu */ bool UI_block_active_only_flagged_buttons(const bContext *C, ARegion *region, uiBlock *block) { - /* Running this command before end-block has run, means buttons that open menus * wont have those menus correctly positioned, see T83539. */ - BLI_assert(block->endblock != 0); + BLI_assert(block->endblock); bool done = false; LISTBASE_FOREACH (uiBut *, but, &block->buttons) { @@ -1914,7 +1913,7 @@ void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2], int r_x ui_update_flexible_spacing(region, block); - block->endblock = 1; + block->endblock = true; } void UI_block_end(const bContext *C, uiBlock *block) @@ -3434,7 +3433,7 @@ void UI_blocklist_free_inactive(const bContext *C, ListBase *lb) UI_block_free(C, block); } else { - block->active = 0; + block->active = false; } } } @@ -3451,7 +3450,7 @@ void UI_block_region_set(uiBlock *block, ARegion *region) oldblock = BLI_findstring(lb, block->name, offsetof(uiBlock, name)); if (oldblock) { - oldblock->active = 0; + oldblock->active = false; oldblock->panel = NULL; oldblock->handle = NULL; } @@ -3469,7 +3468,7 @@ uiBlock *UI_block_begin(const bContext *C, ARegion *region, const char *name, eU Scene *scene = CTX_data_scene(C); uiBlock *block = MEM_callocN(sizeof(uiBlock), "uiBlock"); - block->active = 1; + block->active = true; block->emboss = emboss; block->evil_C = (void *)C; /* XXX */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 37ce269777c..5de330d7136 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -8267,7 +8267,7 @@ static void button_activate_exit( bt->flag &= ~UI_BUT_LAST_ACTIVE; } - block_iter->tooltipdisabled = 1; + block_iter->tooltipdisabled = true; } ui_blocks_set_tooltips(data->region, false); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 6a921f3f541..3da66d45abd 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -510,13 +510,13 @@ struct uiBlock { const char *lockstr; - char lock; + bool lock; /** to keep blocks while drawing and free them afterwards */ - char active; + bool active; /** to avoid tooltip after click */ - char tooltipdisabled; + bool tooltipdisabled; /** UI_block_end done? */ - char endblock; + bool endblock; /** for doing delayed */ eBlockBoundsCalc bounds_type; -- cgit v1.2.3