Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-04-23 11:00:42 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-23 13:53:45 +0300
commitb14979f91f81074dd7bba13cfc6610fecffe66b4 (patch)
tree501df8db364fb4e9943862cedec1bba1f2d4dda7 /source/blender/editors/interface/interface_region_menu_popup.c
parent8264b772f5a506b5cb6ce761b7282c23d57834b8 (diff)
Cleanup: style
Diffstat (limited to 'source/blender/editors/interface/interface_region_menu_popup.c')
-rw-r--r--source/blender/editors/interface/interface_region_menu_popup.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_region_menu_popup.c b/source/blender/editors/interface/interface_region_menu_popup.c
index ae133e909bd..9aec955413f 100644
--- a/source/blender/editors/interface/interface_region_menu_popup.c
+++ b/source/blender/editors/interface/interface_region_menu_popup.c
@@ -136,9 +136,11 @@ static uiBut *ui_popup_menu_memory__internal(uiBlock *block, uiBut *but)
}
else {
/* get */
- for (but = block->buttons.first; but; but = but->next)
- if (ui_popup_string_hash(but->str) == mem[hash_mod])
+ for (but = block->buttons.first; but; but = but->next) {
+ if (ui_popup_string_hash(but->str) == mem[hash_mod]) {
return but;
+ }
+ }
return NULL;
}
@@ -176,9 +178,8 @@ struct uiPopupMenu {
static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, void *arg_pup)
{
uiBlock *block;
- uiBut *bt;
uiPopupMenu *pup = arg_pup;
- int offset[2], minwidth, width, height;
+ int minwidth, width, height;
char direction;
bool flip;
@@ -218,8 +219,9 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
/* in some cases we create the block before the region,
* so we set it delayed here if necessary */
- if (BLI_findindex(&handle->region->uiblocks, block) == -1)
+ if (BLI_findindex(&handle->region->uiblocks, block) == -1) {
UI_block_region_set(block, handle->region);
+ }
block->direction = direction;
@@ -228,6 +230,9 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
UI_block_flag_enable(block, UI_BLOCK_MOVEMOUSE_QUIT);
if (pup->popup) {
+ uiBut *bt;
+ int offset[2];
+
uiBut *but_activate = NULL;
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_NUMSELECT);
UI_block_direction_set(block, direction);
@@ -251,8 +256,9 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
/* position mouse at 0.8*width of the button and below the tile
* on the first item */
offset[0] = 0;
- for (bt = block->buttons.first; bt; bt = bt->next)
+ for (bt = block->buttons.first; bt; bt = bt->next) {
offset[0] = min_ii(offset[0], -(bt->rect.xmin + 0.8f * BLI_rctf_size_x(&bt->rect)));
+ }
offset[1] = 2.1 * UI_UNIT_Y;
@@ -292,8 +298,9 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
}
/* if menu slides out of other menu, override direction */
- if (pup->slideout)
+ if (pup->slideout) {
UI_block_direction_set(block, UI_DIR_RIGHT);
+ }
return pup->block;
}
@@ -334,8 +341,9 @@ uiPopupBlockHandle *ui_popup_menu_create(
pup->block->flag |= UI_BLOCK_NO_FLIP;
}
#endif
- if (but->context)
+ if (but->context) {
uiLayoutContextCopy(pup->layout, but->context);
+ }
}
/* menu is created from a callback */