Cleanup: pass ICON_NONE instead of zero to UI functions

This commit is contained in:
Campbell Barton 2023-08-12 16:29:49 +10:00
parent 12538b75e9
commit 86c4ce66af
28 changed files with 185 additions and 114 deletions

View File

@ -920,11 +920,11 @@ static int armature_parent_set_invoke(bContext *C, wmOperator * /*op*/, const wm
uiLayout *row_offset = uiLayoutRow(layout, false);
uiLayoutSetEnabled(row_offset, enable_offset);
uiItemEnumO(row_offset, "ARMATURE_OT_parent_set", nullptr, 0, "type", ARM_PAR_OFFSET);
uiItemEnumO(row_offset, "ARMATURE_OT_parent_set", nullptr, ICON_NONE, "type", ARM_PAR_OFFSET);
uiLayout *row_connect = uiLayoutRow(layout, false);
uiLayoutSetEnabled(row_connect, enable_connect);
uiItemEnumO(row_connect, "ARMATURE_OT_parent_set", nullptr, 0, "type", ARM_PAR_CONNECT);
uiItemEnumO(row_connect, "ARMATURE_OT_parent_set", nullptr, ICON_NONE, "type", ARM_PAR_CONNECT);
UI_popup_menu_end(C, pup);
@ -1042,12 +1042,16 @@ static int armature_parent_clear_invoke(bContext *C,
uiLayout *row_clear = uiLayoutRow(layout, false);
uiLayoutSetEnabled(row_clear, enable_clear);
uiItemEnumO(row_clear, "ARMATURE_OT_parent_clear", nullptr, 0, "type", ARM_PAR_CLEAR);
uiItemEnumO(row_clear, "ARMATURE_OT_parent_clear", nullptr, ICON_NONE, "type", ARM_PAR_CLEAR);
uiLayout *row_disconnect = uiLayoutRow(layout, false);
uiLayoutSetEnabled(row_disconnect, enable_disconnect);
uiItemEnumO(
row_disconnect, "ARMATURE_OT_parent_clear", nullptr, 0, "type", ARM_PAR_CLEAR_DISCONNECT);
uiItemEnumO(row_disconnect,
"ARMATURE_OT_parent_clear",
nullptr,
ICON_NONE,
"type",
ARM_PAR_CLEAR_DISCONNECT);
UI_popup_menu_end(C, pup);

View File

@ -1026,7 +1026,7 @@ static uiBut *ui_item_with_label(uiLayout *layout,
if (name[0]) {
#ifdef UI_PROP_DECORATE
if (use_prop_sep) {
layout_prop_decorate = uiItemL_respect_property_split(layout, name, 0);
layout_prop_decorate = uiItemL_respect_property_split(layout, name, ICON_NONE);
}
else
#endif

View File

@ -278,7 +278,7 @@ int UI_pie_menu_invoke_from_rna_enum(bContext *C,
layout = UI_pie_menu_layout(pie);
layout = uiLayoutRadial(layout);
uiItemFullR(layout, &r_ptr, r_prop, RNA_NO_INDEX, 0, UI_ITEM_R_EXPAND, nullptr, 0);
uiItemFullR(layout, &r_ptr, r_prop, RNA_NO_INDEX, 0, UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
UI_pie_menu_end(C, pie);

View File

@ -244,8 +244,14 @@ void uiTemplateAssetView(uiLayout *layout,
uiLayout *row = uiLayoutRow(col, true);
if ((display_flags & UI_TEMPLATE_ASSET_DRAW_NO_LIBRARY) == 0) {
uiItemFullR(
row, asset_library_dataptr, asset_library_prop, RNA_NO_INDEX, 0, UI_ITEM_NONE, "", 0);
uiItemFullR(row,
asset_library_dataptr,
asset_library_prop,
RNA_NO_INDEX,
0,
UI_ITEM_NONE,
"",
ICON_NONE);
if (asset_library_ref.type != ASSET_LIBRARY_LOCAL) {
uiItemO(row, "", ICON_FILE_REFRESH, "ASSET_OT_library_refresh");
}

View File

@ -246,7 +246,7 @@ class LayerViewItem : public AbstractTreeViewItem {
but = uiDefIconButR(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
0,
0,
UI_UNIT_X,
@ -266,7 +266,7 @@ class LayerViewItem : public AbstractTreeViewItem {
but = uiDefIconButR(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
0,
0,
UI_UNIT_X,
@ -344,8 +344,8 @@ class LayerGroupViewItem : public AbstractTreeViewItem {
PointerRNA group_ptr;
RNA_pointer_create(&grease_pencil_.id, &RNA_GreasePencilLayerGroup, &group_, &group_ptr);
uiItemR(&row, &group_ptr, "hide", UI_ITEM_R_ICON_ONLY, nullptr, 0);
uiItemR(&row, &group_ptr, "lock", UI_ITEM_R_ICON_ONLY, nullptr, 0);
uiItemR(&row, &group_ptr, "hide", UI_ITEM_R_ICON_ONLY, nullptr, ICON_NONE);
uiItemR(&row, &group_ptr, "lock", UI_ITEM_R_ICON_ONLY, nullptr, ICON_NONE);
}
};

View File

@ -875,7 +875,7 @@ static void ui_template_list_layout_draw(const bContext *C,
but = uiDefIconTextButR_prop(block,
UI_BTYPE_NUM,
0,
0,
ICON_NONE,
numstr,
0,
0,

View File

@ -4742,20 +4742,28 @@ static void curvemap_buttons_layout(uiLayout *layout,
UI_but_funcN_set(bt, rna_update_cb, MEM_dupallocN(cb), nullptr);
if (brush && neg_slope) {
bt = uiDefIconBlockBut(
block, curvemap_brush_tools_negslope_func, cumap, 0, 0, 0, 0, dx, dx, TIP_("Tools"));
bt = uiDefIconBlockBut(block,
curvemap_brush_tools_negslope_func,
cumap,
0,
ICON_NONE,
0,
0,
dx,
dx,
TIP_("Tools"));
}
else if (brush) {
bt = uiDefIconBlockBut(
block, curvemap_brush_tools_func, cumap, 0, 0, 0, 0, dx, dx, TIP_("Tools"));
block, curvemap_brush_tools_func, cumap, 0, ICON_NONE, 0, 0, dx, dx, TIP_("Tools"));
}
else if (neg_slope) {
bt = uiDefIconBlockBut(
block, curvemap_tools_negslope_func, cumap, 0, 0, 0, 0, dx, dx, TIP_("Tools"));
block, curvemap_tools_negslope_func, cumap, 0, ICON_NONE, 0, 0, dx, dx, TIP_("Tools"));
}
else {
bt = uiDefIconBlockBut(
block, curvemap_tools_posslope_func, cumap, 0, 0, 0, 0, dx, dx, TIP_("Tools"));
block, curvemap_tools_posslope_func, cumap, 0, ICON_NONE, 0, 0, dx, dx, TIP_("Tools"));
}
UI_but_funcN_set(bt, rna_update_cb, MEM_dupallocN(cb), nullptr);
@ -5408,8 +5416,16 @@ static void CurveProfile_buttons_layout(uiLayout *layout, PointerRNA *ptr, RNAUp
UI_but_funcN_set(bt, CurveProfile_clipping_toggle, MEM_dupallocN(cb), profile);
/* Reset view, reset curve */
bt = uiDefIconBlockBut(
block, CurveProfile_buttons_tools, profile, 0, 0, 0, 0, UI_UNIT_X, UI_UNIT_X, TIP_("Tools"));
bt = uiDefIconBlockBut(block,
CurveProfile_buttons_tools,
profile,
0,
ICON_NONE,
0,
0,
UI_UNIT_X,
UI_UNIT_X,
TIP_("Tools"));
UI_but_funcN_set(bt, rna_update_cb, MEM_dupallocN(cb), nullptr);
UI_block_funcN_set(block, rna_update_cb, MEM_dupallocN(cb), nullptr);
@ -6311,7 +6327,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
uiButProgress *but_progress = (uiButProgress *)uiDefIconTextBut(block,
UI_BTYPE_PROGRESS,
0,
0,
ICON_NONE,
text,
UI_UNIT_X,
0,

View File

@ -927,7 +927,7 @@ static int parent_set_invoke_menu(bContext *C, wmOperatorType *ot)
PointerRNA opptr;
#if 0
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_OBJECT);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_OBJECT);
#else
uiItemFullO_ptr(
layout, ot, IFACE_("Object"), ICON_NONE, nullptr, WM_OP_EXEC_DEFAULT, UI_ITEM_NONE, &opptr);
@ -981,24 +981,24 @@ static int parent_set_invoke_menu(bContext *C, wmOperatorType *ot)
CTX_DATA_END;
if (parent->type == OB_ARMATURE) {
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_ARMATURE);
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_ARMATURE_NAME);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_ARMATURE);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_ARMATURE_NAME);
if (!has_children_of_type.gpencil) {
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_ARMATURE_ENVELOPE);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_ARMATURE_ENVELOPE);
}
if (has_children_of_type.mesh || has_children_of_type.gpencil) {
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_ARMATURE_AUTO);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_ARMATURE_AUTO);
}
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_BONE);
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_BONE_RELATIVE);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_BONE);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_BONE_RELATIVE);
}
else if (parent->type == OB_CURVES_LEGACY) {
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_CURVE);
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_FOLLOW);
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_PATH_CONST);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_CURVE);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_FOLLOW);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_PATH_CONST);
}
else if (parent->type == OB_LATTICE) {
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_LATTICE);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_LATTICE);
}
else if (parent->type == OB_MESH) {
if (has_children_of_type.curves) {
@ -1008,8 +1008,8 @@ static int parent_set_invoke_menu(bContext *C, wmOperatorType *ot)
/* vertex parenting */
if (OB_TYPE_SUPPORT_PARVERT(parent->type)) {
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_VERTEX);
uiItemEnumO_ptr(layout, ot, nullptr, 0, "type", PAR_VERTEX_TRI);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_VERTEX);
uiItemEnumO_ptr(layout, ot, nullptr, ICON_NONE, "type", PAR_VERTEX_TRI);
}
UI_popup_menu_end(C, pup);

View File

@ -850,7 +850,7 @@ static bool select_grouped_collection(bContext *C, Object *ob)
collection = ob_collections[i];
uiItemStringO(layout,
collection->id.name + 2,
0,
ICON_NONE,
"OBJECT_OT_select_same_collection",
"collection",
collection->id.name + 2);

View File

@ -186,7 +186,7 @@ static uiBut *file_add_icon_but(const SpaceFile *sfile,
const int x = tile_draw_rect->xmin;
const int y = tile_draw_rect->ymax - sfile->layout->tile_border_y - height;
/* For uiDefIconBut(), if a1==1.0 then a2 is alpha 0.0 - 1.0 */
/* For #uiDefIconBut(): if `a1==1.0` then a2 is alpha `0.0 - 1.0`. */
const float a1 = dimmed ? 1.0f : 0.0f;
const float a2 = dimmed ? 0.3f : 0.0f;
but = uiDefIconBut(

View File

@ -397,19 +397,19 @@ static void graph_panel_key_properties(const bContext *C, Panel *panel)
/* easing type */
if (bezt->ipo > BEZT_IPO_BEZ) {
uiItemR(col, &bezt_ptr, "easing", UI_ITEM_NONE, nullptr, 0);
uiItemR(col, &bezt_ptr, "easing", UI_ITEM_NONE, nullptr, ICON_NONE);
}
/* easing extra */
switch (bezt->ipo) {
case BEZT_IPO_BACK:
col = uiLayoutColumn(layout, true);
uiItemR(col, &bezt_ptr, "back", UI_ITEM_NONE, nullptr, 0);
uiItemR(col, &bezt_ptr, "back", UI_ITEM_NONE, nullptr, ICON_NONE);
break;
case BEZT_IPO_ELASTIC:
col = uiLayoutColumn(layout, true);
uiItemR(col, &bezt_ptr, "amplitude", UI_ITEM_NONE, nullptr, 0);
uiItemR(col, &bezt_ptr, "period", UI_ITEM_NONE, nullptr, 0);
uiItemR(col, &bezt_ptr, "amplitude", UI_ITEM_NONE, nullptr, ICON_NONE);
uiItemR(col, &bezt_ptr, "period", UI_ITEM_NONE, nullptr, ICON_NONE);
break;
default:
break;

View File

@ -80,7 +80,7 @@ static void node_socket_button_label(bContext * /*C*/,
PointerRNA * /*node_ptr*/,
const char *text)
{
uiItemL(layout, text, 0);
uiItemL(layout, text, ICON_NONE);
}
/* ****************** BUTTON CALLBACKS FOR ALL TREES ***************** */
@ -448,7 +448,7 @@ static void node_shader_buts_tex_environment_ex(uiLayout *layout, bContext *C, P
static void node_shader_buts_displacement(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
{
uiItemR(layout, ptr, "space", DEFAULT_FLAGS, "", 0);
uiItemR(layout, ptr, "space", DEFAULT_FLAGS, "", ICON_NONE);
}
static void node_shader_buts_glossy(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
@ -1312,7 +1312,7 @@ static void std_node_socket_draw(
case SOCK_FLOAT:
case SOCK_INT:
case SOCK_BOOLEAN:
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0);
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, ICON_NONE);
break;
case SOCK_VECTOR:
if (sock->flag & SOCK_COMPACT) {
@ -1335,30 +1335,30 @@ static void std_node_socket_draw(
}
case SOCK_RGBA: {
if (text[0] == '\0') {
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, "", 0);
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, "", ICON_NONE);
}
else {
uiLayout *row = uiLayoutSplit(layout, 0.4f, false);
uiItemL(row, text, 0);
uiItemR(row, ptr, "default_value", DEFAULT_FLAGS, "", 0);
uiItemL(row, text, ICON_NONE);
uiItemR(row, ptr, "default_value", DEFAULT_FLAGS, "", ICON_NONE);
}
break;
}
case SOCK_STRING: {
uiLayout *row = uiLayoutSplit(layout, 0.4f, false);
uiItemL(row, text, 0);
uiItemL(row, text, ICON_NONE);
if (socket_needs_attribute_search(*node, *sock)) {
node_geometry_add_attribute_search_button(*C, *node, *ptr, *row);
}
else {
uiItemR(row, ptr, "default_value", DEFAULT_FLAGS, "", 0);
uiItemR(row, ptr, "default_value", DEFAULT_FLAGS, "", ICON_NONE);
}
break;
}
case SOCK_OBJECT: {
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0);
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, ICON_NONE);
break;
}
case SOCK_IMAGE: {
@ -1379,7 +1379,7 @@ static void std_node_socket_draw(
else {
/* 0.3 split ratio is inconsistent, but use it here because the "New" button is large. */
uiLayout *row = uiLayoutSplit(layout, 0.3f, false);
uiItemL(row, text, 0);
uiItemL(row, text, ICON_NONE);
uiTemplateID(row,
C,
ptr,
@ -1393,12 +1393,12 @@ static void std_node_socket_draw(
}
}
else {
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0);
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, ICON_NONE);
}
break;
}
case SOCK_COLLECTION: {
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0);
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, ICON_NONE);
break;
}
case SOCK_TEXTURE: {
@ -1417,7 +1417,7 @@ static void std_node_socket_draw(
else {
/* 0.3 split ratio is inconsistent, but use it here because the "New" button is large. */
uiLayout *row = uiLayoutSplit(layout, 0.3f, false);
uiItemL(row, text, 0);
uiItemL(row, text, ICON_NONE);
uiTemplateID(
row, C, ptr, "default_value", "texture.new", nullptr, nullptr, 0, ICON_NONE, nullptr);
}
@ -1425,7 +1425,7 @@ static void std_node_socket_draw(
break;
}
case SOCK_MATERIAL: {
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, 0);
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, text, ICON_NONE);
break;
}
default:
@ -1475,17 +1475,17 @@ static void std_node_socket_interface_draw(bContext * /*C*/, uiLayout *layout, P
case SOCK_IMAGE:
case SOCK_TEXTURE:
case SOCK_MATERIAL: {
uiItemR(col, ptr, "default_value", DEFAULT_FLAGS, IFACE_("Default"), 0);
uiItemR(col, ptr, "default_value", DEFAULT_FLAGS, IFACE_("Default"), ICON_NONE);
break;
}
}
col = uiLayoutColumn(layout, false);
uiItemR(col, ptr, "hide_value", DEFAULT_FLAGS, nullptr, 0);
uiItemR(col, ptr, "hide_value", DEFAULT_FLAGS, nullptr, ICON_NONE);
const bNodeTree *node_tree = reinterpret_cast<const bNodeTree *>(ptr->owner_id);
if (sock->in_out == SOCK_IN && node_tree->type == NTREE_GEOMETRY) {
uiItemR(col, ptr, "hide_in_modifier", DEFAULT_FLAGS, nullptr, 0);
uiItemR(col, ptr, "hide_in_modifier", DEFAULT_FLAGS, nullptr, ICON_NONE);
}
}

View File

@ -693,8 +693,8 @@ static int node_group_separate_invoke(bContext *C, wmOperator * /*op*/, const wm
uiLayout *layout = UI_popup_menu_layout(pup);
uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
uiItemEnumO(layout, "NODE_OT_group_separate", nullptr, 0, "type", NODE_GS_COPY);
uiItemEnumO(layout, "NODE_OT_group_separate", nullptr, 0, "type", NODE_GS_MOVE);
uiItemEnumO(layout, "NODE_OT_group_separate", nullptr, ICON_NONE, "type", NODE_GS_COPY);
uiItemEnumO(layout, "NODE_OT_group_separate", nullptr, ICON_NONE, "type", NODE_GS_MOVE);
UI_popup_menu_end(C, pup);

View File

@ -1163,7 +1163,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.hide),
te->ys,
UI_UNIT_X,
@ -1190,7 +1190,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.select),
te->ys,
UI_UNIT_X,
@ -1215,7 +1215,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.viewport),
te->ys,
UI_UNIT_X,
@ -1240,7 +1240,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.render),
te->ys,
UI_UNIT_X,
@ -1271,7 +1271,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.hide),
te->ys,
UI_UNIT_X,
@ -1300,7 +1300,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.viewport),
te->ys,
UI_UNIT_X,
@ -1323,7 +1323,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.render),
te->ys,
UI_UNIT_X,
@ -1355,7 +1355,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.viewport),
te->ys,
UI_UNIT_X,
@ -1507,7 +1507,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax) - restrict_offsets.enable,
te->ys,
UI_UNIT_X,
@ -1527,7 +1527,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.hide),
te->ys,
UI_UNIT_X,
@ -1556,7 +1556,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.holdout),
te->ys,
UI_UNIT_X,
@ -1586,7 +1586,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.indirect_only),
te->ys,
UI_UNIT_X,
@ -1618,7 +1618,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.viewport),
te->ys,
UI_UNIT_X,
@ -1655,7 +1655,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.render),
te->ys,
UI_UNIT_X,
@ -1690,7 +1690,7 @@ static void outliner_draw_restrictbuts(uiBlock *block,
bt = uiDefIconButR_prop(block,
UI_BTYPE_ICON_TOGGLE,
0,
0,
ICON_NONE,
int(region->v2d.cur.xmax - restrict_offsets.select),
te->ys,
UI_UNIT_X,

View File

@ -3968,19 +3968,19 @@ static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, const wmEve
uiItemEnumO_ptr(layout,
op->type,
IFACE_("Reload from disk (ignore local changes)"),
0,
ICON_NONE,
"resolution",
RESOLVE_RELOAD);
uiItemEnumO_ptr(layout,
op->type,
IFACE_("Save to disk (ignore outside changes)"),
0,
ICON_NONE,
"resolution",
RESOLVE_SAVE);
uiItemEnumO_ptr(layout,
op->type,
IFACE_("Make text internal (separate copy)"),
0,
ICON_NONE,
"resolution",
RESOLVE_MAKE_INTERNAL);
UI_popup_menu_end(C, pup);
@ -3989,23 +3989,29 @@ static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, const wmEve
pup = UI_popup_menu_begin(C, IFACE_("File Modified Outside Blender"), ICON_NONE);
layout = UI_popup_menu_layout(pup);
uiItemEnumO_ptr(
layout, op->type, IFACE_("Reload from disk"), 0, "resolution", RESOLVE_RELOAD);
layout, op->type, IFACE_("Reload from disk"), ICON_NONE, "resolution", RESOLVE_RELOAD);
uiItemEnumO_ptr(layout,
op->type,
IFACE_("Make text internal (separate copy)"),
0,
ICON_NONE,
"resolution",
RESOLVE_MAKE_INTERNAL);
uiItemEnumO_ptr(layout, op->type, IFACE_("Ignore"), 0, "resolution", RESOLVE_IGNORE);
uiItemEnumO_ptr(
layout, op->type, IFACE_("Ignore"), ICON_NONE, "resolution", RESOLVE_IGNORE);
UI_popup_menu_end(C, pup);
}
break;
case 2:
pup = UI_popup_menu_begin(C, IFACE_("File Deleted Outside Blender"), ICON_NONE);
layout = UI_popup_menu_layout(pup);
uiItemEnumO_ptr(layout,
op->type,
IFACE_("Make text internal"),
ICON_NONE,
"resolution",
RESOLVE_MAKE_INTERNAL);
uiItemEnumO_ptr(
layout, op->type, IFACE_("Make text internal"), 0, "resolution", RESOLVE_MAKE_INTERNAL);
uiItemEnumO_ptr(layout, op->type, IFACE_("Recreate file"), 0, "resolution", RESOLVE_SAVE);
layout, op->type, IFACE_("Recreate file"), ICON_NONE, "resolution", RESOLVE_SAVE);
UI_popup_menu_end(C, pup);
break;
}

View File

@ -400,7 +400,7 @@ void unpack_menu(bContext *C,
break;
case PF_CMP_EQUAL:
SNPRINTF(line, TIP_("Use %s (identical)"), local_name);
// uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_LOCAL);
// uiItemEnumO_ptr(layout, ot, line, ICON_NONE, "method", PF_USE_LOCAL);
uiItemFullO_ptr(
layout, ot, line, ICON_NONE, nullptr, WM_OP_EXEC_DEFAULT, UI_ITEM_NONE, &props_ptr);
RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL);
@ -409,14 +409,14 @@ void unpack_menu(bContext *C,
break;
case PF_CMP_DIFFERS:
SNPRINTF(line, TIP_("Use %s (differs)"), local_name);
// uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_LOCAL);
// uiItemEnumO_ptr(layout, ot, line, ICON_NONE, "method", PF_USE_LOCAL);
uiItemFullO_ptr(
layout, ot, line, ICON_NONE, nullptr, WM_OP_EXEC_DEFAULT, UI_ITEM_NONE, &props_ptr);
RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL);
RNA_string_set(&props_ptr, "id", id_name);
SNPRINTF(line, TIP_("Overwrite %s"), local_name);
// uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_LOCAL);
// uiItemEnumO_ptr(layout, ot, line, ICON_NONE, "method", PF_WRITE_LOCAL);
uiItemFullO_ptr(
layout, ot, line, ICON_NONE, nullptr, WM_OP_EXEC_DEFAULT, UI_ITEM_NONE, &props_ptr);
RNA_enum_set(&props_ptr, "method", PF_WRITE_LOCAL);
@ -429,7 +429,7 @@ void unpack_menu(bContext *C,
switch (BKE_packedfile_compare_to_file(blendfile_path, abs_name, pf)) {
case PF_CMP_NOFILE:
SNPRINTF(line, TIP_("Create %s"), abs_name);
// uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_ORIGINAL);
// uiItemEnumO_ptr(layout, ot, line, ICON_NONE, "method", PF_WRITE_ORIGINAL);
uiItemFullO_ptr(
layout, ot, line, ICON_NONE, nullptr, WM_OP_EXEC_DEFAULT, UI_ITEM_NONE, &props_ptr);
RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL);
@ -437,7 +437,7 @@ void unpack_menu(bContext *C,
break;
case PF_CMP_EQUAL:
SNPRINTF(line, TIP_("Use %s (identical)"), abs_name);
// uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_ORIGINAL);
// uiItemEnumO_ptr(layout, ot, line, ICON_NONE, "method", PF_USE_ORIGINAL);
uiItemFullO_ptr(
layout, ot, line, ICON_NONE, nullptr, WM_OP_EXEC_DEFAULT, UI_ITEM_NONE, &props_ptr);
RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL);
@ -445,14 +445,14 @@ void unpack_menu(bContext *C,
break;
case PF_CMP_DIFFERS:
SNPRINTF(line, TIP_("Use %s (differs)"), abs_name);
// uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_USE_ORIGINAL);
// uiItemEnumO_ptr(layout, ot, line, ICON_NONE, "method", PF_USE_ORIGINAL);
uiItemFullO_ptr(
layout, ot, line, ICON_NONE, nullptr, WM_OP_EXEC_DEFAULT, UI_ITEM_NONE, &props_ptr);
RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL);
RNA_string_set(&props_ptr, "id", id_name);
SNPRINTF(line, TIP_("Overwrite %s"), abs_name);
// uiItemEnumO_ptr(layout, ot, line, 0, "method", PF_WRITE_ORIGINAL);
// uiItemEnumO_ptr(layout, ot, line, ICON_NONE, "method", PF_WRITE_ORIGINAL);
uiItemFullO_ptr(
layout, ot, line, ICON_NONE, nullptr, WM_OP_EXEC_DEFAULT, UI_ITEM_NONE, &props_ptr);
RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL);

View File

@ -480,7 +480,7 @@ static void options_panel_draw(const bContext * /*C*/, Panel *panel)
}
uiLayout *row = uiLayoutRowWithHeading(layout, false, IFACE_("Custom Camera"));
uiItemR(row, ptr, "use_custom_camera", UI_ITEM_NONE, "", 0);
uiItemR(row, ptr, "use_custom_camera", UI_ITEM_NONE, "", ICON_NONE);
uiLayout *subrow = uiLayoutRow(row, true);
uiLayoutSetActive(subrow, RNA_boolean_get(ptr, "use_custom_camera"));
uiLayoutSetPropSep(subrow, true);

View File

@ -30,7 +30,7 @@ static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_buts_bump(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
{
uiItemR(layout, ptr, "invert", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0);
uiItemR(layout, ptr, "invert", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
static int gpu_shader_bump(GPUMaterial *mat,

View File

@ -23,7 +23,7 @@ static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_buts_normal_map(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
uiItemR(layout, ptr, "space", UI_ITEM_R_SPLIT_EMPTY_NAME, "", 0);
uiItemR(layout, ptr, "space", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
if (RNA_enum_get(ptr, "space") == SHD_SPACE_TANGENT) {
PointerRNA obptr = CTX_data_pointer_get(C, "active_object");
@ -37,7 +37,7 @@ static void node_shader_buts_normal_map(uiLayout *layout, bContext *C, PointerRN
uiItemPointerR(layout, ptr, "uv_map", &dataptr, "uv_layers", "", ICON_NONE);
}
else {
uiItemR(layout, ptr, "uv_map", UI_ITEM_R_SPLIT_EMPTY_NAME, "", 0);
uiItemR(layout, ptr, "uv_map", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
}
}

View File

@ -24,7 +24,7 @@ static void node_shader_buts_tangent(uiLayout *layout, bContext *C, PointerRNA *
split = uiLayoutSplit(layout, 0.0f, false);
uiItemR(split, ptr, "direction_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", 0);
uiItemR(split, ptr, "direction_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
row = uiLayoutRow(split, false);
@ -40,11 +40,11 @@ static void node_shader_buts_tangent(uiLayout *layout, bContext *C, PointerRNA *
uiItemPointerR(row, ptr, "uv_map", &dataptr, "uv_layers", "", ICON_NONE);
}
else {
uiItemR(row, ptr, "uv_map", UI_ITEM_R_SPLIT_EMPTY_NAME, "", 0);
uiItemR(row, ptr, "uv_map", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
}
}
else {
uiItemR(row, ptr, "axis", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND, nullptr, 0);
uiItemR(row, ptr, "axis", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
}
}

View File

@ -24,8 +24,8 @@ static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_buts_tex_coord(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
{
uiItemR(layout, ptr, "object", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0);
uiItemR(layout, ptr, "from_instancer", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0);
uiItemR(layout, ptr, "object", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "from_instancer", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
static int node_shader_gpu_tex_coord(GPUMaterial *mat,

View File

@ -42,7 +42,7 @@ static void node_shader_buts_tex_sky(uiLayout *layout, bContext *C, PointerRNA *
if (BKE_scene_uses_blender_eevee(scene)) {
uiItemL(layout, TIP_("Sun disc not available in Eevee"), ICON_ERROR);
}
uiItemR(layout, ptr, "sun_disc", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0);
uiItemR(layout, ptr, "sun_disc", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiLayout *col;
if (RNA_boolean_get(ptr, "sun_disc")) {

View File

@ -16,7 +16,7 @@ static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_buts_uvalongstroke(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
{
uiItemR(layout, ptr, "use_tips", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0);
uiItemR(layout, ptr, "use_tips", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
} // namespace blender::nodes::node_shader_uv_along_stroke_cc

View File

@ -22,7 +22,7 @@ static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_buts_uvmap(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
uiItemR(layout, ptr, "from_instancer", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0);
uiItemR(layout, ptr, "from_instancer", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
if (!RNA_boolean_get(ptr, "from_instancer")) {
PointerRNA obptr = CTX_data_pointer_get(C, "active_object");

View File

@ -35,7 +35,7 @@ static void sh_node_vector_rotate_declare(NodeDeclarationBuilder &b)
static void node_shader_buts_vector_rotate(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
{
uiItemR(layout, ptr, "rotation_type", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
uiItemR(layout, ptr, "invert", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0);
uiItemR(layout, ptr, "invert", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
static const char *gpu_shader_get_name(int mode)

View File

@ -17,7 +17,7 @@ static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_buts_wireframe(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
{
uiItemR(layout, ptr, "use_pixel_size", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0);
uiItemR(layout, ptr, "use_pixel_size", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
}
static int node_shader_gpu_wireframe(GPUMaterial *mat,

View File

@ -6330,7 +6330,7 @@ bool WM_window_modal_keymap_status_draw(bContext *C, wmWindow *win, uiLayout *la
p -= 1;
if (p > buf) {
BLI_snprintf(p, available_len, ": %s", items[i].name);
uiItemL(row, buf, 0);
uiItemL(row, buf, ICON_NONE);
}
}
}

View File

@ -3808,8 +3808,21 @@ static void save_file_forwardcompat_cancel(bContext *C, void *arg_block, void *
static void save_file_forwardcompat_cancel_button(uiBlock *block, wmGenericCallback *post_action)
{
uiBut *but = uiDefIconTextBut(
block, UI_BTYPE_BUT, 0, 0, IFACE_("Cancel"), 0, 0, 0, UI_UNIT_Y, nullptr, 0, 0, 0, 0, "");
uiBut *but = uiDefIconTextBut(block,
UI_BTYPE_BUT,
0,
ICON_NONE,
IFACE_("Cancel"),
0,
0,
0,
UI_UNIT_Y,
nullptr,
0,
0,
0,
0,
"");
UI_but_func_set(but, save_file_forwardcompat_cancel, block, post_action);
UI_but_drawflag_disable(but, UI_BUT_TEXT_LEFT);
}
@ -3836,8 +3849,21 @@ static void save_file_forwardcompat_overwrite(bContext *C, void *arg_block, void
static void save_file_forwardcompat_overwrite_button(uiBlock *block,
wmGenericCallback *post_action)
{
uiBut *but = uiDefIconTextBut(
block, UI_BTYPE_BUT, 0, 0, IFACE_("Overwrite"), 0, 0, 0, UI_UNIT_Y, nullptr, 0, 0, 0, 0, "");
uiBut *but = uiDefIconTextBut(block,
UI_BTYPE_BUT,
0,
ICON_NONE,
IFACE_("Overwrite"),
0,
0,
0,
UI_UNIT_Y,
nullptr,
0,
0,
0,
0,
"");
UI_but_func_set(but, save_file_forwardcompat_overwrite, block, post_action);
UI_but_drawflag_disable(but, UI_BUT_TEXT_LEFT);
UI_but_flag_enable(but, UI_BUT_REDALERT);
@ -3856,7 +3882,7 @@ static void save_file_forwardcompat_saveas_button(uiBlock *block, wmGenericCallb
uiBut *but = uiDefIconTextBut(block,
UI_BTYPE_BUT,
0,
0,
ICON_NONE,
IFACE_("Save As..."),
0,
0,
@ -4030,8 +4056,21 @@ static void wm_block_file_close_save(bContext *C, void *arg_block, void *arg_dat
static void wm_block_file_close_cancel_button(uiBlock *block, wmGenericCallback *post_action)
{
uiBut *but = uiDefIconTextBut(
block, UI_BTYPE_BUT, 0, 0, IFACE_("Cancel"), 0, 0, 0, UI_UNIT_Y, nullptr, 0, 0, 0, 0, "");
uiBut *but = uiDefIconTextBut(block,
UI_BTYPE_BUT,
0,
ICON_NONE,
IFACE_("Cancel"),
0,
0,
0,
UI_UNIT_Y,
nullptr,
0,
0,
0,
0,
"");
UI_but_func_set(but, wm_block_file_close_cancel, block, post_action);
UI_but_drawflag_disable(but, UI_BUT_TEXT_LEFT);
}
@ -4041,7 +4080,7 @@ static void wm_block_file_close_discard_button(uiBlock *block, wmGenericCallback
uiBut *but = uiDefIconTextBut(block,
UI_BTYPE_BUT,
0,
0,
ICON_NONE,
IFACE_("Don't Save"),
0,
0,
@ -4065,7 +4104,7 @@ static void wm_block_file_close_save_button(uiBlock *block,
block,
UI_BTYPE_BUT,
0,
0,
ICON_NONE,
/* Forward compatibility issues force using 'save as' operator instead of 'save' one. */
has_forwardcompat_issues ? IFACE_("Save As...") : IFACE_("Save"),
0,