diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-23 11:47:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-23 11:48:50 +0300 |
commit | d886e32270edb8273ec48a41d1bdcef1fe802835 (patch) | |
tree | 05e91cdcada9e6af8869652d93cbb15b7ddb84df /source/blender/editors/interface/interface_templates.c | |
parent | 103a31f712649ab901d9508f5ae1a2319fde60b4 (diff) |
Cleanup: strip trailing space from interface files
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 266 |
1 files changed, 133 insertions, 133 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 5431f210441..574e1463857 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -252,7 +252,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) search[0] = 0; /* arg_litem is malloced, can be freed by parent button */ template_ui = *((TemplateID *)arg_litem); - + /* get active id for showing first item */ idptr = RNA_property_pointer_get(&template_ui.ptr, template_ui.prop); @@ -267,15 +267,15 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) block = UI_block_begin(C, ar, "_popup", UI_EMBOSS); UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_SEARCH_MENU); - + /* preview thumbnails */ if (template_ui.prv_rows > 0 && template_ui.prv_cols > 0) { int w = 4 * U.widget_unit * template_ui.prv_cols; int h = 5 * U.widget_unit * template_ui.prv_rows; - + /* fake button, it holds space for search items */ uiDefBut(block, UI_BTYPE_LABEL, 0, "", 10, 26, w, h, NULL, 0, 0, 0, 0, NULL); - + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, UI_UNIT_Y, template_ui.prv_rows, template_ui.prv_cols, ""); UI_but_func_search_set( @@ -286,7 +286,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) else { const int searchbox_width = UI_searchbox_size_x(); const int searchbox_height = UI_searchbox_size_y(); - + /* fake button, it holds space for search items */ uiDefBut(block, UI_BTYPE_LABEL, 0, "", 10, 15, searchbox_width, searchbox_height, NULL, 0, 0, 0, 0, NULL); but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, searchbox_width, UI_UNIT_Y - 1, 0, 0, ""); @@ -294,16 +294,16 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) but, ui_searchbox_create_generic, id_search_cb_p, &template_ui, id_search_call_cb, idptr.data); } - - + + UI_block_bounds_set_normal(block, 0.3f * U.widget_unit); UI_block_direction_set(block, UI_DIR_DOWN); - + /* give search-field focus */ UI_but_focus_on_enter_event(win, but); /* this type of search menu requires undo */ but->flag |= UI_BUT_UNDO; - + return block; } @@ -348,7 +348,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) PointerRNA idptr = RNA_property_pointer_get(&template_ui->ptr, template_ui->prop); ID *id = idptr.data; int event = GET_INT_FROM_POINTER(arg_event); - + switch (event) { case UI_ID_BROWSE: case UI_ID_PIN: @@ -504,7 +504,7 @@ static void template_ID( if ((idfrom && idfrom->lib) || !editable) UI_but_flag_enable(but, UI_BUT_DISABLED); - + uiLayoutRow(layout, true); } else if (flag & UI_ID_BROWSE) { @@ -569,17 +569,17 @@ static void template_ID( UI_but_flag_enable(but, UI_BUT_DISABLED); } } - + if (user_alert) UI_but_flag_enable(but, UI_BUT_REDALERT); - + if (id->lib == NULL && !(ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB))) { uiDefButR(block, UI_BTYPE_TOGGLE, 0, "F", 0, 0, UI_UNIT_X, UI_UNIT_Y, &idptr, "use_fake_user", -1, 0, 0, -1, -1, NULL); } } - + if (flag & UI_ID_ADD_NEW) { int w = id ? UI_UNIT_X : (flag & UI_ID_OPEN) ? UI_UNIT_X * 3 : UI_UNIT_X * 6; - + /* i18n markup, does nothing! */ BLT_I18N_MSGID_MULTI_CTXT("New", BLT_I18NCONTEXT_DEFAULT, BLT_I18NCONTEXT_ID_SCENE, @@ -607,7 +607,7 @@ static void template_ID( BLT_I18NCONTEXT_ID_GPENCIL, BLT_I18NCONTEXT_ID_FREESTYLELINESTYLE, ); - + if (newop) { but = uiDefIconTextButO(block, UI_BTYPE_BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id) ? "" : CTX_IFACE_(template_id_context(type), "New"), 0, 0, w, UI_UNIT_Y, NULL); @@ -629,14 +629,14 @@ static void template_ID( but = uiDefIconButO(block, UI_BTYPE_BUT, "FILE_OT_unpack_item", WM_OP_INVOKE_REGION_WIN, ICON_PACKAGE, 0, 0, UI_UNIT_X, UI_UNIT_Y, TIP_("Packed File, click to unpack")); UI_but_operator_ptr_get(but); - + RNA_string_set(but->opptr, "id_name", id->name + 2); RNA_int_set(but->opptr, "id_type", GS(id->name)); - + } else if (flag & UI_ID_OPEN) { int w = id ? UI_UNIT_X : (flag & UI_ID_ADD_NEW) ? UI_UNIT_X * 3 : UI_UNIT_X * 6; - + if (openop) { but = uiDefIconTextButO(block, UI_BTYPE_BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id) ? "" : IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL); @@ -651,7 +651,7 @@ static void template_ID( if ((idfrom && idfrom->lib) || !editable) UI_but_flag_enable(but, UI_BUT_DISABLED); } - + /* delete button */ /* don't use RNA_property_is_unlink here */ if (id && (flag & UI_ID_DELETE)) { @@ -776,7 +776,7 @@ void uiTemplateAnyID( { PropertyRNA *propID, *propType; uiLayout *split, *row, *sub; - + /* get properties... */ propID = RNA_struct_find_property(ptr, propname); propType = RNA_struct_find_property(ptr, proptypename); @@ -789,13 +789,13 @@ void uiTemplateAnyID( RNA_warning("pointer-type property not found: %s.%s", RNA_struct_identifier(ptr->type), proptypename); return; } - + /* Start drawing UI Elements using standard defines */ split = uiLayoutSplit(layout, 0.33f, false); /* NOTE: split amount here needs to be synced with normal labels */ - + /* FIRST PART ................................................ */ row = uiLayoutRow(split, false); - + /* Label - either use the provided text, or will become "ID-Block:" */ if (text) { if (text[0]) @@ -804,20 +804,20 @@ void uiTemplateAnyID( else { uiItemL(row, IFACE_("ID-Block:"), ICON_NONE); } - + /* SECOND PART ................................................ */ row = uiLayoutRow(split, true); - + /* ID-Type Selector - just have a menu of icons */ sub = uiLayoutRow(row, true); /* HACK: special group just for the enum, otherwise we */ uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT); /* we get ugly layout with text included too... */ - + uiItemFullR(sub, ptr, propType, 0, 0, UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - + /* ID-Block Selector - just use pointer widget... */ sub = uiLayoutRow(row, true); /* HACK: special group to counteract the effects of the previous */ uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_EXPAND); /* enum, which now pushes everything too far right */ - + uiItemFullR(sub, ptr, propID, 0, 0, 0, "", ICON_NONE); } @@ -837,20 +837,20 @@ void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propna { PropertyRNA *propPath; uiLayout *row; - + /* check that properties are valid */ propPath = RNA_struct_find_property(ptr, propname); if (!propPath || RNA_property_type(propPath) != PROP_STRING) { RNA_warning("path property not found: %s.%s", RNA_struct_identifier(ptr->type), propname); return; } - + /* Start drawing UI Elements using standard defines */ row = uiLayoutRow(layout, true); - + /* Path (existing string) Widget */ uiItemR(row, ptr, propname, 0, text, ICON_RNA); - + /* TODO: attach something to this to make allow searching of nested properties to 'build' the path */ } @@ -868,7 +868,7 @@ static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v) nmd->mode &= ~eModifierMode_Virtual; BLI_addhead(&ob->modifiers, nmd); - + modifier_unique_name(&ob->modifiers, nmd); ob->partype = PAROBJECT; @@ -928,7 +928,7 @@ static uiLayout *draw_modifier( /* rounded header ------------------------------------------------------------------- */ box = uiLayoutBox(column); - + if (isVirtual) { row = uiLayoutRow(box, false); uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_EXPAND); @@ -937,7 +937,7 @@ static uiLayout *draw_modifier( /* XXX this is not used now, since these cannot be accessed via RNA */ BLI_snprintf(str, sizeof(str), IFACE_("%s parent deform"), md->name); uiDefBut(block, UI_BTYPE_LABEL, 0, str, 0, 0, 185, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Modifier name")); - + but = uiDefBut(block, UI_BTYPE_BUT, 0, IFACE_("Make Real"), 0, 0, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Convert virtual modifier to a real modifier")); UI_but_func_set(but, modifiers_convertToReal, ob, md); @@ -946,15 +946,15 @@ static uiLayout *draw_modifier( /* REAL MODIFIER */ row = uiLayoutRow(box, false); block = uiLayoutGetBlock(row); - + UI_block_emboss_set(block, UI_EMBOSS_NONE); /* Open/Close ................................. */ uiItemR(row, &ptr, "show_expanded", 0, "", ICON_NONE); - + /* modifier-type icon */ uiItemL(row, "", RNA_struct_ui_icon(ptr.type)); UI_block_emboss_set(block, UI_EMBOSS); - + /* modifier name */ md->scene = scene; if (mti->isDisabled && mti->isDisabled(md, 0)) { @@ -962,7 +962,7 @@ static uiLayout *draw_modifier( } uiItemR(row, &ptr, "name", 0, "", ICON_NONE); uiLayoutSetRedAlert(row, false); - + /* mode enabling buttons */ UI_block_align_begin(block); /* Collision and Surface are always enabled, hide buttons! */ @@ -971,7 +971,7 @@ static uiLayout *draw_modifier( { uiItemR(row, &ptr, "show_render", 0, "", ICON_NONE); uiItemR(row, &ptr, "show_viewport", 0, "", ICON_NONE); - + if (mti->flags & eModifierTypeFlag_SupportsEditmode) { sub = uiLayoutRow(row, true); if (!(md->mode & eModifierMode_Realtime)) { @@ -1007,13 +1007,13 @@ static uiLayout *draw_modifier( } UI_block_align_end(block); - + /* Up/Down + Delete ........................... */ UI_block_align_begin(block); uiItemO(row, "", ICON_TRIA_UP, "OBJECT_OT_modifier_move_up"); uiItemO(row, "", ICON_TRIA_DOWN, "OBJECT_OT_modifier_move_down"); UI_block_align_end(block); - + UI_block_emboss_set(block, UI_EMBOSS_NONE); /* When Modifier is a simulation, show button to switch to context rather than the delete button. */ if (modifier_can_delete(md) && @@ -1031,20 +1031,20 @@ static uiLayout *draw_modifier( UI_block_emboss_set(block, UI_EMBOSS); } - + /* modifier settings (under the header) --------------------------------------------------- */ if (!isVirtual && (md->mode & eModifierMode_Expanded)) { /* apply/convert/copy */ box = uiLayoutBox(column); row = uiLayoutRow(box, false); - + if (!ELEM(md->type, eModifierType_Collision, eModifierType_Surface)) { /* only here obdata, the rest of modifiers is ob level */ UI_block_lock_set(block, BKE_object_obdata_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - + if (md->type == eModifierType_ParticleSystem) { ParticleSystem *psys = ((ParticleSystemModifierData *)md)->psys; - + if (!(ob->mode & OB_MODE_PARTICLE_EDIT)) { if (ELEM(psys->part->ren_as, PART_DRAW_GR, PART_DRAW_OB)) uiItemO(row, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Convert"), ICON_NONE, @@ -1058,17 +1058,17 @@ static uiLayout *draw_modifier( uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT); uiItemEnumO(row, "OBJECT_OT_modifier_apply", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Apply"), 0, "apply_as", MODIFIER_APPLY_DATA); - + if (modifier_isSameTopology(md) && !modifier_isNonGeometrical(md)) { uiItemEnumO(row, "OBJECT_OT_modifier_apply", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Apply as Shape Key"), 0, "apply_as", MODIFIER_APPLY_SHAPE); } } - + UI_block_lock_clear(block); 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)) { @@ -1076,19 +1076,19 @@ static uiLayout *draw_modifier( "OBJECT_OT_modifier_copy"); } } - + /* result is the layout block inside the box, that we return so that modifier settings can be drawn */ result = uiLayoutColumn(box, false); block = uiLayoutAbsoluteBlock(box); } - + /* error messages */ if (md->error) { box = uiLayoutBox(column); row = uiLayoutRow(box, false); uiItemL(row, md->error, ICON_ERROR); } - + return result; } @@ -1113,9 +1113,9 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr) RNA_warning("Expected modifier on object"); return NULL; } - + UI_block_lock_set(uiLayoutGetBlock(layout), (ob && ID_IS_LINKED(ob)), ERROR_LIBDATA_MESSAGE); - + /* find modifier and draw it */ cageIndex = modifiers_getCageIndex(scene, ob, &lastCageIndex, 0); @@ -1168,7 +1168,7 @@ static void do_constraint_panels(bContext *C, void *ob_pt, int event) * * object_test_constraints(ob); * if (ob->pose) BKE_pose_update_constraint_flags(ob->pose); */ - + if (ob->type == OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); else DAG_id_tag_update(&ob->id, OB_RECALC_OB); @@ -1200,7 +1200,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) } else BLI_strncpy(typestr, IFACE_(cti->name), sizeof(typestr)); - + /* determine whether constraint is proxy protected or not */ if (BKE_constraints_proxylocked_owner(ob, pchan)) proxy_protected = (con->flag & CONSTRAINT_PROXY_LOCAL) == 0; @@ -1234,34 +1234,34 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) if (con->flag & CONSTRAINT_DISABLE) uiLayoutSetRedAlert(row, true); - + if (proxy_protected == 0) { uiItemR(row, &ptr, "name", 0, "", ICON_NONE); } else uiItemL(row, con->name, ICON_NONE); - + uiLayoutSetRedAlert(row, false); - + /* proxy-protected constraints cannot be edited, so hide up/down + close buttons */ if (proxy_protected) { UI_block_emboss_set(block, UI_EMBOSS_NONE); - + /* draw a ghost icon (for proxy) and also a lock beside it, to show that constraint is "proxy locked" */ uiDefIconBut(block, UI_BTYPE_BUT, B_CONSTRAINT_TEST, ICON_GHOST, xco + 12.2f * UI_UNIT_X, yco, 0.95f * UI_UNIT_X, 0.95f * UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Proxy Protected")); uiDefIconBut(block, UI_BTYPE_BUT, B_CONSTRAINT_TEST, ICON_LOCKED, xco + 13.1f * UI_UNIT_X, yco, 0.95f * UI_UNIT_X, 0.95f * UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Proxy Protected")); - + UI_block_emboss_set(block, UI_EMBOSS); } else { short prev_proxylock, show_upbut, show_downbut; - - /* Up/Down buttons: + + /* Up/Down buttons: * Proxy-constraints are not allowed to occur after local (non-proxy) constraints * as that poses problems when restoring them, so disable the "up" button where - * it may cause this situation. + * it may cause this situation. * * Up/Down buttons should only be shown (or not grayed - todo) if they serve some purpose. */ @@ -1274,29 +1274,29 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) } else prev_proxylock = 0; - + show_upbut = ((prev_proxylock == 0) && (con->prev)); show_downbut = (con->next) ? 1 : 0; - + /* enabled */ UI_block_emboss_set(block, UI_EMBOSS_NONE); uiItemR(row, &ptr, "mute", 0, "", (con->flag & CONSTRAINT_OFF) ? ICON_RESTRICT_VIEW_ON : ICON_RESTRICT_VIEW_OFF); UI_block_emboss_set(block, UI_EMBOSS); - + uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT); - + /* up/down */ if (show_upbut || show_downbut) { UI_block_align_begin(block); if (show_upbut) uiItemO(row, "", ICON_TRIA_UP, "CONSTRAINT_OT_move_up"); - + if (show_downbut) uiItemO(row, "", ICON_TRIA_DOWN, "CONSTRAINT_OT_move_down"); UI_block_align_end(block); } - + /* Close 'button' - emboss calls here disable drawing of 'button' behind X */ UI_block_emboss_set(block, UI_EMBOSS_NONE); uiItemO(row, "", ICON_X, "CONSTRAINT_OT_delete"); @@ -1341,7 +1341,7 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr) RNA_warning("Expected constraint on object"); return NULL; } - + UI_block_lock_set(uiLayoutGetBlock(layout), (ob && ID_IS_LINKED(ob)), ERROR_LIBDATA_MESSAGE); /* hrms, the temporal constraint should not draw! */ @@ -1460,7 +1460,7 @@ void uiTemplatePreview( if (GS(pid->name) == ID_MA || (pparent && GS(pparent->name) == ID_MA)) { if (GS(pid->name) == ID_MA) ma = (Material *)pid; else ma = (Material *)pparent; - + /* Create RNA Pointer */ RNA_pointer_create(&ma->id, &RNA_Material, ma, &material_ptr); @@ -1472,7 +1472,7 @@ void uiTemplatePreview( if (pr_texture) { /* Create RNA Pointer */ RNA_pointer_create(id, &RNA_Texture, tex, &texture_ptr); - + uiLayoutRow(layout, true); uiDefButS(block, UI_BTYPE_ROW, B_MATPRV, IFACE_("Texture"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, pr_texture, 10, TEX_PR_TEXTURE, 0, 0, ""); @@ -1494,7 +1494,7 @@ void uiTemplatePreview( } uiDefButS(block, UI_BTYPE_ROW, B_MATPRV, IFACE_("Both"), 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, pr_texture, 10, TEX_PR_BOTH, 0, 0, ""); - + /* Alpha button for texture preview */ if (*pr_texture != TEX_PR_OTHER) { row = uiLayoutRow(layout, false); @@ -1776,7 +1776,7 @@ static uiBlock *ui_icon_view_menu_cb(bContext *C, ARegion *ar, void *arg_litem) if (free) { MEM_freeN((void *)item); } - + return block; } @@ -1954,26 +1954,26 @@ static void curvemap_buttons_zoom_out(bContext *C, void *cumap_v, void *UNUSED(u if (BLI_rctf_size_x(&cumap->curr) < 20.0f * BLI_rctf_size_x(&cumap->clipr)) { d = d1 = 0.15f * BLI_rctf_size_x(&cumap->curr); - if (cumap->flag & CUMA_DO_CLIP) + if (cumap->flag & CUMA_DO_CLIP) if (cumap->curr.xmin - d < cumap->clipr.xmin) d1 = cumap->curr.xmin - cumap->clipr.xmin; cumap->curr.xmin -= d1; d1 = d; - if (cumap->flag & CUMA_DO_CLIP) + if (cumap->flag & CUMA_DO_CLIP) if (cumap->curr.xmax + d > cumap->clipr.xmax) d1 = -cumap->curr.xmax + cumap->clipr.xmax; cumap->curr.xmax += d1; d = d1 = 0.15f * BLI_rctf_size_y(&cumap->curr); - if (cumap->flag & CUMA_DO_CLIP) + if (cumap->flag & CUMA_DO_CLIP) if (cumap->curr.ymin - d < cumap->clipr.ymin) d1 = cumap->curr.ymin - cumap->clipr.ymin; cumap->curr.ymin -= d1; d1 = d; - if (cumap->flag & CUMA_DO_CLIP) + if (cumap->flag & CUMA_DO_CLIP) if (cumap->curr.ymax + d > cumap->clipr.ymax) d1 = -cumap->curr.ymax + cumap->clipr.ymax; cumap->curr.ymax += d1; @@ -1987,7 +1987,7 @@ static void curvemap_buttons_setclip(bContext *UNUSED(C), void *cumap_v, void *U CurveMapping *cumap = cumap_v; curvemapping_changed(cumap, false); -} +} static void curvemap_buttons_delete(bContext *C, void *cb_v, void *cumap_v) { @@ -2160,15 +2160,15 @@ static void curvemap_buttons_reset(bContext *C, void *cb_v, void *cumap_v) { CurveMapping *cumap = cumap_v; int a; - + cumap->preset = CURVE_PRESET_LINE; for (a = 0; a < CM_TOT; a++) curvemap_reset(cumap->cm + a, &cumap->clipr, cumap->preset, CURVEMAP_SLOPE_POSITIVE); - + cumap->black[0] = cumap->black[1] = cumap->black[2] = 0.0f; cumap->white[0] = cumap->white[1] = cumap->white[2] = 1.0f; curvemapping_set_black_white(cumap, NULL, NULL); - + curvemapping_changed(cumap, false); rna_update_cb(C, cb_v, NULL); @@ -2238,7 +2238,7 @@ static void curvemap_buttons_layout( /* HSV */ sub = uiLayoutRow(row, true); uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT); - + if (cumap->cm[0].curve) { bt = uiDefButI(block, UI_BTYPE_ROW, 0, "H", 0, 0, dx, dx, &cumap->cur, 0.0, 0.0, 0.0, 0.0, ""); UI_but_func_set(bt, curvemap_buttons_redraw, NULL, NULL); @@ -2254,7 +2254,7 @@ static void curvemap_buttons_layout( } else uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_RIGHT); - + if (labeltype == 'h') bg = UI_GRAD_H; @@ -2444,7 +2444,7 @@ void uiTemplateColorPicker( if (cubic) but->flag |= UI_BUT_COLOR_CUBIC; - + if (value_slider) { switch (U.color_picker_type) { case USER_CP_CIRCLE_HSL: @@ -2543,7 +2543,7 @@ static void handle_layer_buttons(bContext *C, void *arg1, void *arg2) if (!shift) { tot = RNA_property_array_length(&but->rnapoin, but->rnaprop); - + /* Normally clicking only selects one layer */ RNA_property_boolean_set_index(&but->rnapoin, but->rnaprop, cur, true); for (i = 0; i < tot; ++i) { @@ -2575,8 +2575,8 @@ void uiTemplateLayers( RNA_warning("layers property not found: %s.%s", RNA_struct_identifier(ptr->type), propname); return; } - - /* the number of layers determines the way we group them + + /* the number of layers determines the way we group them * - we want 2 rows only (for now) * - the number of columns (cols) is the total number of buttons per row * the 'remainder' is added to this, as it will be ok to have first row slightly wider if need be @@ -2596,12 +2596,12 @@ void uiTemplateLayers( if (RNA_property_array_length(used_ptr, used_prop) < layers) used_prop = NULL; } - + /* layers are laid out going across rows, with the columns being divided into groups */ - + for (group = 0; group < groups; group++) { uCol = uiLayoutColumn(layout, true); - + for (row = 0; row < 2; row++) { uiBlock *block; uiBut *but; @@ -2609,7 +2609,7 @@ void uiTemplateLayers( uRow = uiLayoutRow(uCol, true); block = uiLayoutGetBlock(uRow); layer = groups * cols_per_group * row + cols_per_group * group; - + /* add layers as toggle buts */ for (col = 0; (col < cols_per_group) && (layer < layers); col++, layer++) { int icon = 0; @@ -2619,7 +2619,7 @@ void uiTemplateLayers( icon = ICON_LAYER_ACTIVE; else if (used_prop && RNA_property_boolean_get_index(used_ptr, used_prop, layer)) icon = ICON_LAYER_USED; - + but = uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, UI_UNIT_X / 2, UI_UNIT_Y / 2); UI_but_func_set(but, handle_layer_buttons, but, SET_INT_IN_POINTER(layer)); but->type = UI_BTYPE_TOGGLE; @@ -2644,8 +2644,8 @@ void uiTemplateGameStates( RNA_warning("states property not found: %s.%s", RNA_struct_identifier(ptr->type), propname); return; } - - /* the number of states determines the way we group them + + /* the number of states determines the way we group them * - we want 2 rows only (for now) * - the number of columns (cols) is the total number of buttons per row * the 'remainder' is added to this, as it will be ok to have first row slightly wider if need be @@ -2665,12 +2665,12 @@ void uiTemplateGameStates( if (RNA_property_array_length(used_ptr, used_prop) < states) used_prop = NULL; } - + /* layers are laid out going across rows, with the columns being divided into groups */ - + for (group = 0; group < groups; group++) { uCol = uiLayoutColumn(layout, true); - + for (row = 0; row < 2; row++) { uiBlock *block; uiBut *but; @@ -2678,7 +2678,7 @@ void uiTemplateGameStates( uRow = uiLayoutRow(uCol, true); block = uiLayoutGetBlock(uRow); state = groups * cols_per_group * row + cols_per_group * group; - + /* add layers as toggle buts */ for (col = 0; (col < cols_per_group) && (state < states); col++, state++) { int icon = 0; @@ -2688,7 +2688,7 @@ void uiTemplateGameStates( icon = ICON_LAYER_ACTIVE; else if (used_prop && RNA_property_boolean_get_index(used_ptr, used_prop, state)) icon = ICON_LAYER_USED; - + but = uiDefIconButR_prop(block, UI_BTYPE_ICON_TOGGLE, 0, icon, 0, 0, UI_UNIT_X / 2, UI_UNIT_Y / 2, ptr, prop, state, 0, 0, -1, -1, sca_state_name_get(ob, state)); UI_but_func_set(but, handle_layer_buttons, but, SET_INT_IN_POINTER(state)); @@ -3387,7 +3387,7 @@ void uiTemplateList( static void operator_call_cb(bContext *C, void *UNUSED(arg1), void *arg2) { wmOperatorType *ot = arg2; - + if (ot) WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, NULL); } @@ -3436,10 +3436,10 @@ static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char if (WM_operator_poll((bContext *)C, ot)) { char name[256]; int len = strlen(ot_ui_name); - + /* display name for menu, can hold hotkey */ BLI_strncpy(name, ot_ui_name, sizeof(name)); - + /* check for hotkey */ if (len < sizeof(name) - 6) { if (WM_key_event_operator_string( @@ -3449,7 +3449,7 @@ static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char name[len] = UI_SEP_CHAR; } } - + if (false == UI_search_item_add(items, name, ot, 0)) break; } @@ -3469,7 +3469,7 @@ void uiTemplateOperatorSearch(uiLayout *layout) uiBlock *block; uiBut *but; static char search[256] = ""; - + block = uiLayoutGetBlock(layout); UI_block_layout_set_current(block, layout); @@ -3679,7 +3679,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C) uiBlock *block; void *owner = NULL; int handle_event, icon = 0; - + block = uiLayoutGetBlock(layout); UI_block_layout_set_current(block, layout); @@ -3763,7 +3763,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C) if (owner) { const uiFontStyle *fstyle = UI_FSTYLE_WIDGET; bool active = !(G.is_break || WM_jobs_is_stopped(wm, owner)); - + uiLayout *row = uiLayoutRow(layout, false); block = uiLayoutGetBlock(row); @@ -3815,29 +3815,29 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) ReportList *reports = CTX_wm_reports(C); Report *report = BKE_reports_last_displayable(reports); ReportTimerInfo *rti; - + uiLayout *ui_abs; uiBlock *block; uiBut *but; uiStyle *style = UI_style_get(); int width; int icon; - + /* if the report display has timed out, don't show */ if (!reports->reporttimer) return; - + rti = (ReportTimerInfo *)reports->reporttimer->customdata; - + if (!rti || rti->widthfac == 0.0f || !report) return; - + ui_abs = uiLayoutAbsolute(layout, false); block = uiLayoutGetBlock(ui_abs); - + UI_fontstyle_set(&style->widgetlabel); width = BLF_width(style->widgetlabel.uifont_id, report->message, report->len); width = min_ii((int)(rti->widthfac * width), width); width = max_ii(width, 10); - + /* make a box around the report to make it stand out */ UI_block_align_begin(block); but = uiDefBut(block, UI_BTYPE_ROUNDBOX, 0, "", 0, 0, UI_UNIT_X + 10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); @@ -3851,12 +3851,12 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) but->col[3] = 255; UI_block_align_end(block); - - + + /* icon and report message on top */ icon = UI_icon_from_report_type(report->type); - - /* XXX: temporary operator to dump all reports to a text block, but only if more than 1 report + + /* XXX: temporary operator to dump all reports to a text block, but only if more than 1 report * to be shown instead of icon when appropriate... */ UI_block_emboss_set(block, UI_EMBOSS_NONE); @@ -3868,7 +3868,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) uiDefIconBut(block, UI_BTYPE_LABEL, 0, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); UI_block_emboss_set(block, UI_EMBOSS); - + uiDefBut(block, UI_BTYPE_LABEL, 0, report->message, UI_UNIT_X + 10, 0, UI_UNIT_X + width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); } @@ -3889,7 +3889,7 @@ static void template_keymap_item_properties(uiLayout *layout, const char *title, if (title) uiItemL(layout, title, ICON_NONE); - + flow = uiLayoutColumnFlow(layout, 2, false); RNA_STRUCT_BEGIN (ptr, prop) @@ -4018,17 +4018,17 @@ static uiBlock *component_menu(bContext *C, ARegion *ar, void *args_v) ComponentMenuArgs *args = (ComponentMenuArgs *)args_v; uiBlock *block; uiLayout *layout; - + block = UI_block_begin(C, ar, __func__, UI_EMBOSS); UI_block_flag_enable(block, UI_BLOCK_KEEP_OPEN); - + layout = uiLayoutColumn(UI_block_layout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y, 0, UI_style_get()), 0); - + uiItemR(layout, &args->ptr, args->propname, UI_ITEM_R_EXPAND, "", ICON_NONE); - + UI_block_bounds_set_normal(block, 6); UI_block_direction_set(block, UI_DIR_DOWN); - + return block; } void uiTemplateComponentMenu(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name) @@ -4036,10 +4036,10 @@ void uiTemplateComponentMenu(uiLayout *layout, PointerRNA *ptr, const char *prop ComponentMenuArgs *args = MEM_callocN(sizeof(ComponentMenuArgs), "component menu template args"); uiBlock *block; uiBut *but; - + args->ptr = *ptr; BLI_strncpy(args->propname, propname, sizeof(args->propname)); - + block = uiLayoutGetBlock(layout); UI_block_align_begin(block); @@ -4048,7 +4048,7 @@ void uiTemplateComponentMenu(uiLayout *layout, PointerRNA *ptr, const char *prop but->rnapoin = *ptr; but->rnaprop = RNA_struct_find_property(ptr, propname); but->rnaindex = 0; - + UI_block_align_end(block); } @@ -4058,17 +4058,17 @@ void uiTemplateNodeSocket(uiLayout *layout, bContext *UNUSED(C), float *color) { uiBlock *block; uiBut *but; - + block = uiLayoutGetBlock(layout); UI_block_align_begin(block); - + /* XXX using explicit socket colors is not quite ideal. * Eventually it should be possible to use theme colors for this purpose, * but this requires a better design for extendable color palettes in user prefs. */ but = uiDefBut(block, UI_BTYPE_NODE_SOCKET, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); rgba_float_to_uchar(but->col, color); - + UI_block_align_end(block); } |