diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-20 22:21:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-20 22:29:19 +0300 |
commit | 3a13b89296a851027ba4cec34f8c36600cfdd1f2 (patch) | |
tree | b9302ad9f7774e53676028a55854806e06b7dd35 /source/blender/editors | |
parent | 176b0df92079bb7a1ab456b97055f01e0cc784db (diff) |
Cleanup: unused args, indentation
Diffstat (limited to 'source/blender/editors')
8 files changed, 68 insertions, 65 deletions
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 5078d071dd8..a0c31b64666 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1845,7 +1845,7 @@ void ED_gpencil_calc_stroke_uv(Object *ob, bGPDstroke *gps) /* if image, use texture width */ if ((gp_style) && (gp_style->stroke_style == GP_STYLE_STROKE_STYLE_TEXTURE) && - (gp_style->sima)) + (gp_style->sima)) { factor = gp_style->sima->gen_x; } diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 0ad7a18b5ac..950d156d4ed 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -988,8 +988,8 @@ static bool ui_but_event_operator_string_from_menu( IDP_AddToGroup(prop_menu, IDP_NewString(mt->idname, "name", sizeof(mt->idname))); if (WM_key_event_operator_string( - C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, true, - buf, buf_len)) + C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, true, + buf, buf_len)) { found = true; } @@ -1151,8 +1151,8 @@ static bool ui_but_event_property_operator_string( /* check each until one works... */ for (i = 0; (i < num_ops) && (ctx_toggle_opnames[i]); i++) { if (WM_key_event_operator_string( - C, ctx_toggle_opnames[i], WM_OP_INVOKE_REGION_WIN, prop_path, false, - buf, buf_len)) + C, ctx_toggle_opnames[i], WM_OP_INVOKE_REGION_WIN, prop_path, false, + buf, buf_len)) { found = true; break; @@ -1510,10 +1510,10 @@ static void ui_block_message_subscribe(ARegion *ar, struct wmMsgBus *mbus, uiBlo if (but->rnapoin.type && but->rnaprop) { /* quick check to avoid adding buttons representing a vector, multiple times. */ if ((but_prev && - (but_prev->rnaprop == but->rnaprop) && - (but_prev->rnapoin.type == but->rnapoin.type) && - (but_prev->rnapoin.data == but->rnapoin.data) && - (but_prev->rnapoin.id.data == but->rnapoin.id.data)) == false) + (but_prev->rnaprop == but->rnaprop) && + (but_prev->rnapoin.type == but->rnapoin.type) && + (but_prev->rnapoin.data == but->rnapoin.data) && + (but_prev->rnapoin.id.data == but->rnapoin.id.data)) == false) { /* TODO: could make this into utility function. */ WM_msg_subscribe_rna( @@ -3019,8 +3019,8 @@ void ui_but_update_ex(uiBut *but, const bool validate) EnumPropertyItem item; if (RNA_property_enum_item_from_value_gettexted( - but->block->evil_C, - &but->rnapoin, but->rnaprop, value_enum, &item)) + but->block->evil_C, + &but->rnapoin, but->rnaprop, value_enum, &item)) { size_t slen = strlen(item.name); ui_but_string_free_internal(but); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 2f84045a73f..ef20d1a1063 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2174,8 +2174,8 @@ static bool ui_but_has_array_value(uiBut *but) { return (but->rnapoin.data && but->rnaprop && ELEM(RNA_property_subtype(but->rnaprop), PROP_COLOR, PROP_TRANSLATION, PROP_DIRECTION, - PROP_VELOCITY, PROP_ACCELERATION, PROP_MATRIX, PROP_EULER, PROP_QUATERNION, PROP_AXISANGLE, - PROP_XYZ, PROP_XYZ_LENGTH, PROP_COLOR_GAMMA, PROP_COORDS)); + PROP_VELOCITY, PROP_ACCELERATION, PROP_MATRIX, PROP_EULER, PROP_QUATERNION, PROP_AXISANGLE, + PROP_XYZ, PROP_XYZ_LENGTH, PROP_COLOR_GAMMA, PROP_COORDS)); } static void ui_but_paste_normalized_vector(bContext *C, uiBut *but, char *buf_paste) @@ -8063,38 +8063,38 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but) break; } case MOUSEMOVE: - { - /* deselect the button when moving the mouse away */ - /* also de-activate for buttons that only show highlights */ - if (ui_but_contains_point_px(ar, but, event->x, event->y)) { - - /* Drag on a hold button (used in the toolbar) now opens it immediately. */ - if (data->hold_action_timer) { - if (but->flag & UI_SELECT) { - if ((abs(event->x - event->prevx)) > 2 || - (abs(event->y - event->prevy)) > 2) - { - WM_event_remove_timer(data->wm, data->window, data->hold_action_timer); - data->hold_action_timer = WM_event_add_timer(data->wm, data->window, TIMER, 0.0f); - } + { + /* deselect the button when moving the mouse away */ + /* also de-activate for buttons that only show highlights */ + if (ui_but_contains_point_px(ar, but, event->x, event->y)) { + + /* Drag on a hold button (used in the toolbar) now opens it immediately. */ + if (data->hold_action_timer) { + if (but->flag & UI_SELECT) { + if ((abs(event->x - event->prevx)) > 2 || + (abs(event->y - event->prevy)) > 2) + { + WM_event_remove_timer(data->wm, data->window, data->hold_action_timer); + data->hold_action_timer = WM_event_add_timer(data->wm, data->window, TIMER, 0.0f); } } + } - if (!(but->flag & UI_SELECT)) { - but->flag |= (UI_SELECT | UI_ACTIVE); - data->cancel = false; - ED_region_tag_redraw(data->region); - } + if (!(but->flag & UI_SELECT)) { + but->flag |= (UI_SELECT | UI_ACTIVE); + data->cancel = false; + ED_region_tag_redraw(data->region); } - else { - if (but->flag & UI_SELECT) { - but->flag &= ~(UI_SELECT | UI_ACTIVE); - data->cancel = true; - ED_region_tag_redraw(data->region); - } + } + else { + if (but->flag & UI_SELECT) { + but->flag &= ~(UI_SELECT | UI_ACTIVE); + data->cancel = true; + ED_region_tag_redraw(data->region); } } break; + } default: /* otherwise catch mouse release event */ ui_do_button(C, block, but, event); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 424f5004bf0..b36f83b1ccf 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -268,7 +268,7 @@ static int ui_item_fit(int item, int pos, int all, int available, bool is_last, static int ui_layout_vary_direction(uiLayout *layout) { return ((ELEM(layout->root->type, UI_LAYOUT_HEADER, UI_LAYOUT_PIEMENU) || - (layout->alignment != UI_LAYOUT_ALIGN_EXPAND)) ? + (layout->alignment != UI_LAYOUT_ALIGN_EXPAND)) ? UI_ITEM_VARY_X : UI_ITEM_VARY_Y); } @@ -2533,8 +2533,8 @@ void uiItemMenuEnumO_ptr( { char keybuf[128]; if (WM_key_event_operator_string( - C, ot->idname, layout->root->opcontext, NULL, false, - keybuf, sizeof(keybuf))) + C, ot->idname, layout->root->opcontext, NULL, false, + keybuf, sizeof(keybuf))) { ui_but_add_shortcut(but, keybuf, false); } diff --git a/source/blender/editors/interface/interface_region_color_picker.c b/source/blender/editors/interface/interface_region_color_picker.c index afa3486cf6c..a99bcb2b73c 100644 --- a/source/blender/editors/interface/interface_region_color_picker.c +++ b/source/blender/editors/interface/interface_region_color_picker.c @@ -549,8 +549,8 @@ static void ui_block_colorpicker( UI_but_func_set(bt, ui_colorpicker_hex_rna_cb, bt, hexcol); bt->custom_data = cpicker; uiDefBut( - block, UI_BTYPE_LABEL, 0, IFACE_("(Gamma Corrected)"), 0, yco - UI_UNIT_Y, - butwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + block, UI_BTYPE_LABEL, 0, IFACE_("(Gamma Corrected)"), 0, yco - UI_UNIT_Y, + butwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); ui_rgb_to_color_picker_v(rgb_gamma, hsv); diff --git a/source/blender/editors/interface/interface_region_menu_pie.c b/source/blender/editors/interface/interface_region_menu_pie.c index b7fc1055154..44effc8c097 100644 --- a/source/blender/editors/interface/interface_region_menu_pie.c +++ b/source/blender/editors/interface/interface_region_menu_pie.c @@ -105,7 +105,7 @@ static float ui_pie_menu_title_width(const char *name, int icon) { const uiFontStyle *fstyle = UI_FSTYLE_WIDGET; return (UI_fontstyle_string_width(fstyle, name) + - (UI_UNIT_X * (1.50f + (icon ? 0.25f : 0.0f)))); + (UI_UNIT_X * (1.50f + (icon ? 0.25f : 0.0f)))); } uiPieMenu *UI_pie_menu_begin(struct bContext *C, const char *title, int icon, const wmEvent *event) diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 738da4184b7..d4f6933693e 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -318,7 +318,8 @@ void UI_fontstyle_draw_simple_backdrop( float color[4] = { col_bg[0], col_bg[1], col_bg[2], 0.5f }; UI_draw_roundbox_corner_set(UI_CNR_ALL); - UI_draw_roundbox_aa(true, + UI_draw_roundbox_aa( + true, x - margin, (y + decent) - margin, x + width + margin, @@ -529,10 +530,11 @@ void uiStyleInit(void) /* Set default flags based on UI preferences (not render fonts) */ { - int flag_disable = BLF_MONOCHROME | - BLF_HINTING_NONE | - BLF_HINTING_SLIGHT | - BLF_HINTING_FULL; + int flag_disable = ( + BLF_MONOCHROME | + BLF_HINTING_NONE | + BLF_HINTING_SLIGHT | + BLF_HINTING_FULL); int flag_enable = 0; if (U.text_render & USER_TEXT_HINTING_NONE) { diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 45a3ef9690e..5b9f9b1faf3 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -993,14 +993,14 @@ void uiTemplateIDPreview( } void uiTemplateGpencilColorPreview( - uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, - int rows, int cols, float scale, int filter) + uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, + int rows, int cols, float scale, int filter) { ui_template_id( - layout, C, ptr, propname, - NULL, NULL, NULL, - UI_ID_BROWSE | UI_ID_PREVIEWS | UI_ID_DELETE, - rows, cols, filter, false, scale < 0.5f ? 0.5f : scale, false, false); + layout, C, ptr, propname, + NULL, NULL, NULL, + UI_ID_BROWSE | UI_ID_PREVIEWS | UI_ID_DELETE, + rows, cols, filter, false, scale < 0.5f ? 0.5f : scale, false, false); } /** @@ -1355,7 +1355,7 @@ static int modifier_is_simulation(ModifierData *md) { /* Physic Tab */ if (ELEM(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke, - eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint)) + eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint)) { return 1; } @@ -1533,7 +1533,7 @@ static uiLayout *draw_modifier( UI_block_lock_set(block, ob && ID_IS_LINKED(ob), ERROR_LIBDATA_MESSAGE); if (!ELEM(md->type, eModifierType_Fluidsim, eModifierType_Softbody, eModifierType_ParticleSystem, - eModifierType_Cloth, eModifierType_Smoke)) + eModifierType_Cloth, eModifierType_Smoke)) { uiItemO(row, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy"), ICON_NONE, "OBJECT_OT_modifier_copy"); @@ -1636,8 +1636,8 @@ static uiLayout *gpencil_draw_modifier( /* mode enabling buttons */ UI_block_align_begin(block); - uiItemR(row, &ptr, "show_render", 0, "", ICON_NONE); - uiItemR(row, &ptr, "show_viewport", 0, "", ICON_NONE); + uiItemR(row, &ptr, "show_render", 0, "", ICON_NONE); + uiItemR(row, &ptr, "show_viewport", 0, "", ICON_NONE); if (mti->flags & eGpencilModifierTypeFlag_SupportsEditmode) { sub = uiLayoutRow(row, true); @@ -1675,7 +1675,7 @@ static uiLayout *gpencil_draw_modifier( uiItemEnumO(sub, "OBJECT_OT_gpencil_modifier_apply", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Apply"), 0, "apply_as", MODIFIER_APPLY_DATA); uiItemO(row, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy"), ICON_NONE, - "OBJECT_OT_gpencil_modifier_copy"); + "OBJECT_OT_gpencil_modifier_copy"); /* result is the layout block inside the box, that we return so that modifier settings can be drawn */ result = uiLayoutColumn(box, false); @@ -1726,8 +1726,9 @@ uiLayout *uiTemplateGpencilModifier(uiLayout *layout, bContext *UNUSED(C), Point /************************ Shader FX Template *************************/ -static uiLayout *gpencil_draw_shaderfx(uiLayout *layout, Object *ob, - ShaderFxData *md) +static uiLayout *gpencil_draw_shaderfx( + uiLayout *layout, Object *ob, + ShaderFxData *md) { const ShaderFxTypeInfo *mti = BKE_shaderfxType_getInfo(md->type); PointerRNA ptr; @@ -3583,7 +3584,7 @@ static void uilist_draw_filter_default(struct uiList *ui_list, struct bContext * subrow = uiLayoutRow(row, true); uiItemR(subrow, &listptr, "use_filter_sort_alpha", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE); uiItemR(subrow, &listptr, "use_filter_sort_reverse", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", - (ui_list->filter_sort_flag & UILST_FLT_SORT_REVERSE) ? ICON_SORT_DESC : ICON_SORT_ASC); + (ui_list->filter_sort_flag & UILST_FLT_SORT_REVERSE) ? ICON_SORT_DESC : ICON_SORT_ASC); } } @@ -4300,8 +4301,8 @@ static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char /* check for hotkey */ if (len < sizeof(name) - 6) { if (WM_key_event_operator_string( - C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, true, - &name[len + 1], sizeof(name) - len - 1)) + C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, true, + &name[len + 1], sizeof(name) - len - 1)) { name[len] = UI_SEP_CHAR; } |