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:
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c59
1 files changed, 41 insertions, 18 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 7cf68a144b2..ed3e2e863b7 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -129,8 +129,12 @@ static void template_add_button_search_menu(
ARegion *region = CTX_wm_region(C);
ScrArea *area = CTX_wm_area(C);
/* XXX ugly top-bar exception */
- const bool use_big_size = (region->regiontype != RGN_TYPE_HEADER) && (area->spacetype != SPACE_TOPBAR); /* silly check, could be more generic */
- /* Ugly exception for screens here, drawing their preview in icon size looks ugly/useless */
+ const bool use_big_size = (
+ /* silly check, could be more generic */
+ (region->regiontype != RGN_TYPE_HEADER) &&
+ (area->spacetype != SPACE_TOPBAR));
+ /* Ugly exception for screens here,
+ * drawing their preview in icon size looks ugly/useless */
const bool use_preview_icon = use_big_size || (id && (GS(id->name) != ID_SCR));
const short width = UI_UNIT_X * (use_big_size ? 6 : 1.6f);
const short height = UI_UNIT_Y * (use_big_size ? 6 : 1);
@@ -1048,7 +1052,9 @@ void uiTemplateAnyID(
}
/* Start drawing UI Elements using standard defines */
- split = uiLayoutSplit(layout, 0.33f, false); /* NOTE: split amount here needs to be synced with normal labels */
+
+ /* NOTE: split amount here needs to be synced with normal labels */
+ split = uiLayoutSplit(layout, 0.33f, false);
/* FIRST PART ................................................ */
row = uiLayoutRow(split, false);
@@ -1066,14 +1072,20 @@ void uiTemplateAnyID(
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... */
+
+ /* HACK: special group just for the enum,
+ * otherwise we get ugly layout with text included too... */
+ sub = uiLayoutRow(row, true);
+ uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT);
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 */
+
+ /* HACK: special group to counteract the effects of the previous enum,
+ * which now pushes everything too far right. */
+ sub = uiLayoutRow(row, true);
+ uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_EXPAND);
uiItemFullR(sub, ptr, propID, 0, 0, 0, "", ICON_NONE);
}
@@ -1312,7 +1324,8 @@ void uiTemplatePathBuilder(
/* 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 */
+ /* TODO: attach something to this to make allow
+ * searching of nested properties to 'build' the path */
}
/************************ Modifier Template *************************/
@@ -1350,7 +1363,8 @@ static int modifier_can_delete(ModifierData *md)
return 1;
}
-/* Check whether Modifier is a simulation or not, this is used for switching to the physics/particles context tab */
+/* Check whether Modifier is a simulation or not,
+ * this is used for switching to the physics/particles context tab */
static int modifier_is_simulation(ModifierData *md)
{
/* Physic Tab */
@@ -1477,7 +1491,8 @@ static uiLayout *draw_modifier(
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. */
+ /* When Modifier is a simulation,
+ * show button to switch to context rather than the delete button. */
if (modifier_can_delete(md) &&
!modifier_is_simulation(md))
{
@@ -1542,7 +1557,8 @@ static uiLayout *draw_modifier(
}
}
- /* result is the layout block inside the box, that we return so that modifier settings can be drawn */
+ /* 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);
}
@@ -1679,7 +1695,8 @@ static uiLayout *gpencil_draw_modifier(
uiItemO(row, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy"), ICON_NONE,
"OBJECT_OT_gpencil_modifier_copy");
- /* result is the layout block inside the box, that we return so that modifier settings can be drawn */
+ /* 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);
}
@@ -1797,7 +1814,8 @@ static uiLayout *gpencil_draw_shaderfx(
/* only here obdata, the rest of effect is ob level */
UI_block_lock_set(block, BKE_object_obdata_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- /* result is the layout block inside the box, that we return so that effect settings can be drawn */
+ /* result is the layout block inside the box,
+ * that we return so that effect settings can be drawn */
result = uiLayoutColumn(box, false);
block = uiLayoutAbsoluteBlock(box);
}
@@ -2022,7 +2040,8 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
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" */
+ /* 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_ENABLED, 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,
@@ -3057,7 +3076,8 @@ static void curvemap_buttons_reset(bContext *C, void *cb_v, void *cumap_v)
rna_update_cb(C, cb_v, NULL);
}
-/* still unsure how this call evolves... we use labeltype for defining what curve-channels to show */
+/* still unsure how this call evolves...
+ * we use labeltype for defining what curve-channels to show */
static void curvemap_buttons_layout(
uiLayout *layout, PointerRNA *ptr, char labeltype, bool levels,
bool brush, bool neg_slope, bool tone, RNAUpdateCb *cb)
@@ -3756,7 +3776,8 @@ static void uilist_prepare(
rows = min_ii(dyn_data->height, maxrows);
}
- /* If list length changes or list is tagged to check this, and active is out of view, scroll to it .*/
+ /* If list length changes or list is tagged to check this,
+ * and active is out of view, scroll to it .*/
if (ui_list->list_last_len != len || ui_list->flag & UILST_SCROLL_TO_ACTIVE_ITEM) {
if (activei_row < ui_list->list_scroll) {
ui_list->list_scroll = activei_row;
@@ -4397,7 +4418,8 @@ eAutoPropButsReturn uiTemplateOperatorPropertyButs(
/* menu */
if (op->type->flag & OPTYPE_PRESET) {
- /* XXX, no simple way to get WM_MT_operator_presets.bl_label from python! Label remains the same always! */
+ /* XXX, no simple way to get WM_MT_operator_presets.bl_label
+ * from python! Label remains the same always! */
PointerRNA op_ptr;
uiLayout *row;
@@ -4868,7 +4890,8 @@ void uiTemplateKeymapItemProperties(uiLayout *layout, PointerRNA *ptr)
if (but->rnaprop) {
UI_but_func_set(but, keymap_item_modified, ptr->data, NULL);
- /* Otherwise the keymap will be re-generated which we're trying to edit, see: T47685 */
+ /* Otherwise the keymap will be re-generated which we're trying to edit,
+ * see: T47685 */
UI_but_flag_enable(but, UI_BUT_UPDATE_DELAY);
}
}