diff options
37 files changed, 269 insertions, 244 deletions
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 6bb73416fec..8f28040cd52 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -290,13 +290,13 @@ static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, shor /* before range */ col = uiLayoutColumn(split, true); - uiItemL(col, IFACE_("Before:"), ICON_NONE); + uiItemL(col, IFACE_("Before:"), ICON_NONE, 0); uiItemR(col, &ptr, "mode_before", 0, "", ICON_NONE); uiItemR(col, &ptr, "cycles_before", 0, NULL, ICON_NONE); /* after range */ col = uiLayoutColumn(split, true); - uiItemL(col, IFACE_("After:"), ICON_NONE); + uiItemL(col, IFACE_("After:"), ICON_NONE, 0); uiItemR(col, &ptr, "mode_after", 0, "", ICON_NONE); uiItemR(col, &ptr, "cycles_after", 0, NULL, ICON_NONE); } @@ -428,7 +428,7 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh /* general settings */ col = uiLayoutColumn(layout, true); - uiItemL(col, IFACE_("Envelope:"), ICON_NONE); + uiItemL(col, IFACE_("Envelope:"), ICON_NONE, 0); uiItemR(col, &ptr, "reference_value", 0, NULL, ICON_NONE); row = uiLayoutRow(col, true); @@ -587,9 +587,9 @@ void ANIM_uiTemplate_fmodifier_draw(uiLayout *layout, ID *id, ListBase *modifier /* name */ if (fmi) - uiItemL(sub, IFACE_(fmi->name), ICON_NONE); + uiItemL(sub, IFACE_(fmi->name), ICON_NONE, 0); else - uiItemL(sub, IFACE_("<Unknown Modifier>"), ICON_NONE); + uiItemL(sub, IFACE_("<Unknown Modifier>"), ICON_NONE, 0); /* right-align ------------------------------------------- */ sub = uiLayoutRow(row, true); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index fd5351394c3..7a3fb8d8277 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -984,7 +984,7 @@ PointerRNA uiItemFullO_ptr(uiLayout *layout, struct wmOperatorType *ot, const ch PointerRNA uiItemFullO(uiLayout *layout, const char *idname, const char *name, int icon, struct IDProperty *properties, int context, int flag); void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon); -void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon); +void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon, const unsigned short icon_frame); void uiItemEnumR_prop(uiLayout *layout, const char *name, int icon, struct PointerRNA *ptr, PropertyRNA *prop, int value); void uiItemEnumR(uiLayout *layout, const char *name, int icon, struct PointerRNA *ptr, const char *propname, int value); void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *value, const char *name, int icon); @@ -998,7 +998,7 @@ void uiItemsFullEnumO_items( IDProperty *properties, int context, int flag, const EnumPropertyItem *item_array, int totitem); -void uiItemL(uiLayout *layout, const char *name, int icon); /* label */ +void uiItemL(uiLayout *layout, const char *name, int icon, const unsigned short icon_frame); /* label */ void uiItemLDrag(uiLayout *layout, struct PointerRNA *ptr, const char *name, int icon); /* label icon for dragging */ void uiItemM(uiLayout *layout, struct bContext *C, const char *menuname, const char *name, int icon); /* menu */ void uiItemV(uiLayout *layout, const char *name, int icon, int argval); /* value */ diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h index 945ac1b6db9..473170a53fd 100644 --- a/source/blender/editors/include/UI_interface_icons.h +++ b/source/blender/editors/include/UI_interface_icons.h @@ -70,7 +70,7 @@ void UI_icon_draw_preview(float x, float y, int icon_id); void UI_icon_draw_preview_aspect(float x, float y, int icon_id, float aspect); void UI_icon_draw_preview_aspect_size(float x, float y, int icon_id, float aspect, float alpha, int size); -void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect, float alpha); +void UI_icon_draw_aspect(float x, float y, int icon_id, const short frame, float aspect, float alpha); void UI_icon_draw_aspect_color(float x, float y, int icon_id, float aspect, const float rgb[3]); void UI_icon_draw_size(float x, float y, int size, int icon_id, float alpha); void UI_icons_free(void); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 6bba35e821f..3eb915bb884 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -719,6 +719,7 @@ static bool ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBu /* drawing */ oldbut->icon = but->icon; + oldbut->icon_frame = but->icon_frame; oldbut->iconadd = but->iconadd; oldbut->alignnr = but->alignnr; @@ -3202,12 +3203,15 @@ static uiBut *ui_def_but( return but; } -void ui_def_but_icon(uiBut *but, const int icon, const int flag) +/* Note that we may extend this further in future (thinking e.g. to some animated icons for active widget, + * could be nice for videos or animations previews... */ +void ui_def_but_icon_ex(uiBut *but, const int icon, const short frame, const int flag) { if (icon) { ui_icon_ensure_deferred(but->block->evil_C, icon, (flag & UI_BUT_ICON_PREVIEW) != 0); } but->icon = (BIFIconID)icon; + but->icon_frame = frame; but->flag |= flag; if (but->str && but->str[0]) { @@ -3215,6 +3219,11 @@ void ui_def_but_icon(uiBut *but, const int icon, const int flag) } } +void ui_def_but_icon(uiBut *but, const int icon, const int flag) +{ + ui_def_but_icon_ex(but, icon, 0, flag); +} + static void ui_def_but_rna__disable(uiBut *but, const char *info) { but->flag |= UI_BUT_DISABLED; @@ -3312,7 +3321,7 @@ static void ui_def_but_rna__menu(bContext *UNUSED(C), uiLayout *layout, void *bu if (!item->identifier[0]) { if (item->name) { if (item->icon) { - uiItemL(column, item->name, item->icon); + uiItemL(column, item->name, item->icon, 0); } else { /* Do not use uiItemL here, as our root layout is a menu one, it will add a fake blank icon! */ diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index eaf9e79c4bb..a4d528529af 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1606,16 +1606,16 @@ int UI_idcode_icon_get(const int idcode) } static void icon_draw_at_size( - float x, float y, int icon_id, float aspect, float alpha, + float x, float y, int icon_id, const short frame, float aspect, float alpha, enum eIconSizes size, const bool nocreate) { int draw_size = get_draw_size(size); - icon_draw_size(x, y, icon_id, 0, aspect, alpha, NULL, size, draw_size, nocreate, false); + icon_draw_size(x, y, icon_id, frame, aspect, alpha, NULL, size, draw_size, nocreate, false); } -void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect, float alpha) +void UI_icon_draw_aspect(float x, float y, int icon_id, const short frame, float aspect, float alpha) { - icon_draw_at_size(x, y, icon_id, aspect, alpha, ICON_SIZE_ICON, 0); + icon_draw_at_size(x, y, icon_id, frame, aspect, alpha, ICON_SIZE_ICON, 0); } void UI_icon_draw_aspect_color(float x, float y, int icon_id, float aspect, const float rgb[3]) @@ -1627,7 +1627,7 @@ void UI_icon_draw_aspect_color(float x, float y, int icon_id, float aspect, cons /* draws icon with dpi scale factor */ void UI_icon_draw(float x, float y, int icon_id) { - UI_icon_draw_aspect(x, y, icon_id, 1.0f / UI_DPI_FAC, 1.0f); + UI_icon_draw_aspect(x, y, icon_id, 0, 1.0f / UI_DPI_FAC, 1.0f); } void UI_icon_draw_size(float x, float y, int size, int icon_id, float alpha) @@ -1637,12 +1637,12 @@ void UI_icon_draw_size(float x, float y, int size, int icon_id, float alpha) void UI_icon_draw_preview(float x, float y, int icon_id) { - icon_draw_at_size(x, y, icon_id, 1.0f, 1.0f, ICON_SIZE_PREVIEW, 0); + icon_draw_at_size(x, y, icon_id, 0, 1.0f, 1.0f, ICON_SIZE_PREVIEW, 0); } void UI_icon_draw_preview_aspect(float x, float y, int icon_id, float aspect) { - icon_draw_at_size(x, y, icon_id, aspect, 1.0f, ICON_SIZE_PREVIEW, 0); + icon_draw_at_size(x, y, icon_id, 0, aspect, 1.0f, ICON_SIZE_PREVIEW, 0); } void UI_icon_draw_preview_aspect_size(float x, float y, int icon_id, float aspect, float alpha, int size) diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index fcf827bdbe6..ccb48d88d33 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -275,6 +275,7 @@ struct uiBut { const char *disabled_info; BIFIconID icon; + short icon_frame; /* For icon pointing to multi-frames ImagePreview. */ char dt; /* drawtype: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied from the block */ signed char pie_dir; /* direction in a pie menu, used for collision detection (RadialDirection) */ char changed; /* could be made into a single flag */ @@ -482,6 +483,7 @@ extern bool ui_but_string_set_eval_num(struct bContext *C, uiBut *but, const cha extern int ui_but_string_get_max_length(uiBut *but); extern uiBut *ui_but_drag_multi_edit_get(uiBut *but); +void ui_def_but_icon_ex(uiBut *but, const int icon, const short frame, const int flag); void ui_def_but_icon(uiBut *but, const int icon, const int flag); extern uiButExtraIconType ui_but_icon_extra_get(uiBut *but); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 875522e01c6..fb55757feb4 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -973,7 +973,7 @@ void uiItemsFullEnumO_items( } if (item->icon || radial) { - uiItemL(target, item->name, item->icon); + uiItemL(target, item->name, item->icon, 0); but = block->buttons.last; } @@ -1259,7 +1259,7 @@ static void ui_item_rna_size( *r_h = h; } -void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index, int value, int flag, const char *name, int icon) +void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index, int value, int flag, const char *name, int icon, const unsigned short icon_frame) { uiBlock *block = layout->root->block; uiBut *but = NULL; @@ -1340,11 +1340,11 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index /* enum item */ else if (type == PROP_ENUM && index == RNA_ENUM_VALUE) { if (icon && name[0] && !icon_only) - uiDefIconTextButR_prop(block, UI_BTYPE_ROW, 0, icon, name, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL); + but = uiDefIconTextButR_prop(block, UI_BTYPE_ROW, 0, icon, name, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL); else if (icon) - uiDefIconButR_prop(block, UI_BTYPE_ROW, 0, icon, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL); + but = uiDefIconButR_prop(block, UI_BTYPE_ROW, 0, icon, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL); else - uiDefButR_prop(block, UI_BTYPE_ROW, 0, name, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL); + but = uiDefButR_prop(block, UI_BTYPE_ROW, 0, name, 0, 0, w, h, ptr, prop, -1, 0, value, -1, -1, NULL); } /* expanded enum */ else if (type == PROP_ENUM && (expand || RNA_property_flag(prop) & PROP_ENUM_FLAG)) @@ -1371,6 +1371,10 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index UI_but_flag_enable(but, UI_BUT_REDALERT); } + if (but && icon_frame != 0) { + ui_def_but_icon_ex(but, icon, icon_frame, UI_HAS_ICON); + } + /* Mark non-embossed textfields inside a listbox. */ if (but && (block->flag & UI_BLOCK_LIST_ITEM) && (but->type == UI_BTYPE_TEXT) && (but->dt & UI_EMBOSS_NONE)) { UI_but_flag_enable(but, UI_BUT_LIST_ITEM); @@ -1396,7 +1400,7 @@ void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, int flag, return; } - uiItemFullR(layout, ptr, prop, RNA_NO_INDEX, 0, flag, name, icon); + uiItemFullR(layout, ptr, prop, RNA_NO_INDEX, 0, flag, name, icon, 0); } void uiItemEnumR_prop(uiLayout *layout, const char *name, int icon, struct PointerRNA *ptr, PropertyRNA *prop, int value) @@ -1408,7 +1412,7 @@ void uiItemEnumR_prop(uiLayout *layout, const char *name, int icon, struct Point return; } - uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, value, 0, name, icon); + uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, value, 0, name, icon, 0); } void uiItemEnumR(uiLayout *layout, const char *name, int icon, struct PointerRNA *ptr, const char *propname, int value) @@ -1421,7 +1425,7 @@ void uiItemEnumR(uiLayout *layout, const char *name, int icon, struct PointerRNA return; } - uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, value, 0, name, icon); + uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, value, 0, name, icon, 0); } void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *value, const char *name, int icon) @@ -1452,7 +1456,7 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *pr if (item[a].value == ivalue) { const char *item_name = name ? name : CTX_IFACE_(RNA_property_translation_context(prop), item[a].name); - uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, item_name, icon ? icon : item[a].icon); + uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, item_name, icon ? icon : item[a].icon, 0); break; } } @@ -1502,7 +1506,7 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname block->flag |= UI_BLOCK_NO_FLIP; } - uiItemL(column, item[i].name, ICON_NONE); + uiItemL(column, item[i].name, ICON_NONE, 0); bt = block->buttons.last; bt->drawflag = UI_BUT_TEXT_LEFT; @@ -1838,7 +1842,7 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const } /* label item */ -static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon) +static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon, const unsigned short icon_frame) { uiBlock *block = layout->root->block; uiBut *but; @@ -1860,6 +1864,10 @@ static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon) else but = uiDefBut(block, UI_BTYPE_LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + if (icon_frame != 0) { + ui_def_but_icon_ex(but, icon, icon_frame, UI_HAS_ICON); + } + /* to compensate for string size padding in ui_text_icon_width, * make text aligned right if the layout is aligned right. */ @@ -1876,14 +1884,14 @@ static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon) return but; } -void uiItemL(uiLayout *layout, const char *name, int icon) +void uiItemL(uiLayout *layout, const char *name, int icon, const unsigned short icon_frame) { - uiItemL_(layout, name, icon); + uiItemL_(layout, name, icon, icon_frame); } void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, const char *name, int icon) { - uiBut *but = uiItemL_(layout, name, icon); + uiBut *but = uiItemL_(layout, name, icon, 0); if (ptr && ptr->type) if (RNA_struct_is_ID(ptr->type)) @@ -3443,7 +3451,7 @@ void uiLayoutOperatorButs( } if (flag & UI_LAYOUT_OP_SHOW_TITLE) { - uiItemL(layout, RNA_struct_ui_name(op->type->srna), ICON_NONE); + uiItemL(layout, RNA_struct_ui_name(op->type->srna), ICON_NONE, 0); } /* poll() on this operator may still fail, at the moment there is no nice feedback when this happens @@ -3452,7 +3460,7 @@ void uiLayoutOperatorButs( UI_block_lock_set(uiLayoutGetBlock(layout), true, "Operator can't' redo"); /* XXX, could give some nicer feedback or not show redo panel at all? */ - uiItemL(layout, IFACE_("* Redo Unsupported *"), ICON_NONE); + uiItemL(layout, IFACE_("* Redo Unsupported *"), ICON_NONE, 0); } else { /* useful for macros where only one of the steps can't be re-done */ @@ -3498,7 +3506,7 @@ void uiLayoutOperatorButs( empty = uiDefAutoButsRNA(layout, &ptr, check_prop, label_align) == 0; if (empty && (flag & UI_LAYOUT_OP_SHOW_EMPTY)) { - uiItemL(layout, IFACE_("No Properties"), ICON_NONE); + uiItemL(layout, IFACE_("No Properties"), ICON_NONE, 0); } } diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index c131bcb8e14..95596c66472 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -621,7 +621,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, const rcti *rect, con { glEnable(GL_BLEND); UI_icon_draw_aspect(headrect.xmax - ((PNL_ICON * 2.2f) / block->aspect), headrect.ymin + (5.0f / block->aspect), - (panel->flag & PNL_PIN) ? ICON_PINNED : ICON_UNPINNED, + (panel->flag & PNL_PIN) ? ICON_PINNED : ICON_UNPINNED, 0, (block->aspect / UI_DPI_FAC), 1.0f); glDisable(GL_BLEND); } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index cdf34642a8d..5c41fd11b9a 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -3075,7 +3075,7 @@ int UI_pie_menu_invoke_from_rna_enum( layout = UI_pie_menu_layout(pie); layout = uiLayoutRadial(layout); - uiItemFullR(layout, &r_ptr, r_prop, RNA_NO_INDEX, 0, UI_ITEM_R_EXPAND, NULL, 0); + uiItemFullR(layout, &r_ptr, r_prop, RNA_NO_INDEX, 0, UI_ITEM_R_EXPAND, NULL, 0, 0); UI_pie_menu_end(C, pie); @@ -3220,7 +3220,7 @@ void UI_popup_menu_reports(bContext *C, ReportList *reports) BLI_strncpy(buf, msg, MIN2(sizeof(buf), msg_next - msg)); msg = buf; } - uiItemL(layout, msg, icon); + uiItemL(layout, msg, icon, 0); icon = ICON_NONE; } while ((msg = msg_next) && *msg); } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 36f65065fa1..3077464b771 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -710,10 +710,10 @@ void uiTemplateAnyID( /* Label - either use the provided text, or will become "ID-Block:" */ if (text) { if (text[0]) - uiItemL(row, text, ICON_NONE); + uiItemL(row, text, ICON_NONE, 0); } else { - uiItemL(row, IFACE_("ID-Block:"), ICON_NONE); + uiItemL(row, IFACE_("ID-Block:"), ICON_NONE, 0); } /* SECOND PART ................................................ */ @@ -723,13 +723,13 @@ void uiTemplateAnyID( 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); + uiItemFullR(sub, ptr, propType, 0, 0, UI_ITEM_R_ICON_ONLY, "", ICON_NONE, 0); /* 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); + uiItemFullR(sub, ptr, propID, 0, 0, 0, "", ICON_NONE, 0); } /********************* RNA Path Builder Template ********************/ @@ -863,7 +863,7 @@ static uiLayout *draw_modifier( uiItemR(row, &ptr, "show_expanded", 0, "", ICON_NONE); /* modifier-type icon */ - uiItemL(row, "", RNA_struct_ui_icon(ptr.type)); + uiItemL(row, "", RNA_struct_ui_icon(ptr.type), 0); UI_block_emboss_set(block, UI_EMBOSS); /* modifier name */ @@ -997,7 +997,7 @@ static uiLayout *draw_modifier( if (md->error) { box = uiLayoutBox(column); row = uiLayoutRow(box, false); - uiItemL(row, md->error, ICON_ERROR); + uiItemL(row, md->error, ICON_ERROR, 0); } return result; @@ -1150,7 +1150,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) uiItemR(row, &ptr, "name", 0, "", ICON_NONE); } else - uiItemL(row, con->name, ICON_NONE); + uiItemL(row, con->name, ICON_NONE, 0); uiLayoutSetRedAlert(row, false); @@ -2616,16 +2616,16 @@ static void uilist_draw_item_default( /* Simplest one! */ switch (ui_list->layout_type) { case UILST_LAYOUT_GRID: - uiItemL(layout, "", icon); + uiItemL(layout, "", icon, 0); break; case UILST_LAYOUT_DEFAULT: case UILST_LAYOUT_COMPACT: default: if (nameprop) { - uiItemFullR(layout, itemptr, nameprop, RNA_NO_INDEX, 0, UI_ITEM_R_NO_BG, "", icon); + uiItemFullR(layout, itemptr, nameprop, RNA_NO_INDEX, 0, UI_ITEM_R_NO_BG, "", icon, 0); } else { - uiItemL(layout, "", icon); + uiItemL(layout, "", icon, 0); } break; } @@ -3131,7 +3131,7 @@ void uiTemplateList( /* add dummy buttons to fill space */ for (; i < layoutdata.start_idx + layoutdata.visual_items; i++) { - uiItemL(col, "", ICON_NONE); + uiItemL(col, "", ICON_NONE, 0); } /* add scrollbar */ @@ -3158,7 +3158,7 @@ void uiTemplateList( } /* if list is empty, add in dummy button */ else { - uiItemL(row, "", ICON_NONE); + uiItemL(row, "", ICON_NONE, 0); } /* next/prev button */ @@ -3220,7 +3220,7 @@ void uiTemplateList( if (!(i % columns)) { subrow = uiLayoutRow(col, false); } - uiItemL(subrow, "", ICON_NONE); + uiItemL(subrow, "", ICON_NONE, 0); } /* add scrollbar */ @@ -3669,7 +3669,7 @@ static void template_keymap_item_properties(uiLayout *layout, const char *title, uiItemS(layout); if (title) - uiItemL(layout, title, ICON_NONE); + uiItemL(layout, title, ICON_NONE, 0); flow = uiLayoutColumnFlow(layout, 2, false); @@ -3694,7 +3694,7 @@ static void template_keymap_item_properties(uiLayout *layout, const char *title, row = uiLayoutRow(box, false); /* property value */ - uiItemFullR(row, ptr, prop, -1, 0, 0, NULL, ICON_NONE); + uiItemFullR(row, ptr, prop, -1, 0, 0, NULL, ICON_NONE, 0); if (is_set) { /* unset operator */ @@ -3908,7 +3908,7 @@ void uiTemplateCacheFile(uiLayout *layout, bContext *C, PointerRNA *ptr, const c uiItemR(row, &fileptr, "frame", 0, "Frame", ICON_NONE); row = uiLayoutRow(layout, false); - uiItemL(row, IFACE_("Manual Transform:"), ICON_NONE); + uiItemL(row, IFACE_("Manual Transform:"), ICON_NONE, 0); row = uiLayoutRow(layout, false); uiItemR(row, &fileptr, "scale", 0, "Scale", ICON_NONE); diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 1d51c0588b6..3e97a032265 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -185,14 +185,14 @@ int uiDefAutoButsRNA( col = uiLayoutColumn(layout, true); if (!is_boolean) - uiItemL(col, name, ICON_NONE); + uiItemL(col, name, ICON_NONE, 0); } else { /* (label_align == 'H') */ BLI_assert(label_align == 'H'); split = uiLayoutSplit(layout, 0.5f, false); col = uiLayoutColumn(split, false); - uiItemL(col, (is_boolean) ? "" : name, ICON_NONE); + uiItemL(col, (is_boolean) ? "" : name, ICON_NONE, 0); col = uiLayoutColumn(split, false); } @@ -207,7 +207,7 @@ int uiDefAutoButsRNA( name = NULL; /* no smart label alignment, show default name with button */ } - uiItemFullR(col, ptr, prop, -1, 0, 0, name, ICON_NONE); + uiItemFullR(col, ptr, prop, -1, 0, 0, name, ICON_NONE, 0); tot++; } RNA_STRUCT_END; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index c285d753b96..a464a8dedba 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -831,7 +831,7 @@ static int ui_but_draw_menu_icon(const uiBut *but) /* icons have been standardized... and this call draws in untransformed coordinates */ static void widget_draw_icon( - const uiBut *but, BIFIconID icon, float alpha, const rcti *rect, + const uiBut *but, BIFIconID icon, const float frame, float alpha, const rcti *rect, const bool show_menu_icon) { float xs = 0.0f, ys = 0.0f; @@ -901,15 +901,16 @@ static void widget_draw_icon( float rgb[3] = {1.25f, 1.25f, 1.25f}; UI_icon_draw_aspect_color(xs, ys, icon, aspect, rgb); } - else - UI_icon_draw_aspect(xs, ys, icon, aspect, alpha); + else { + UI_icon_draw_aspect(xs, ys, icon, frame, aspect, alpha); + } } if (show_menu_icon) { xs = rect->xmax - UI_DPI_ICON_SIZE - aspect; ys = (rect->ymin + rect->ymax - height) / 2.0f; - UI_icon_draw_aspect(xs, ys, ICON_RIGHTARROW_THIN, aspect, alpha); + UI_icon_draw_aspect(xs, ys, ICON_RIGHTARROW_THIN, 0, aspect, alpha); } glDisable(GL_BLEND); @@ -1519,7 +1520,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB if (but->type == UI_BTYPE_MENU && (but->flag & UI_BUT_NODE_LINK)) { rcti temp = *rect; temp.xmin = rect->xmax - BLI_rcti_size_y(rect) - 1; - widget_draw_icon(but, ICON_LAYER_USED, alpha, &temp, false); + widget_draw_icon(but, ICON_LAYER_USED, 0, alpha, &temp, false); } /* If there's an icon too (made with uiDefIconTextBut) then draw the icon @@ -1554,6 +1555,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB /* Icons on the left with optional text label on the right */ else if (but->flag & UI_HAS_ICON || show_menu_icon) { const BIFIconID icon = (but->flag & UI_HAS_ICON) ? but->icon + but->iconadd : ICON_NONE; + const short frame = (but->flag & UI_HAS_ICON) ? but->icon_frame : 0; const float icon_size = ICON_SIZE_FROM_BUTRECT(rect); /* menu item - add some more padding so menus don't feel cramped. it must @@ -1561,7 +1563,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB if (ui_block_is_menu(but->block)) rect->xmin += 0.3f * U.widget_unit; - widget_draw_icon(but, icon, alpha, rect, show_menu_icon); + widget_draw_icon(but, icon, frame, alpha, rect, show_menu_icon); rect->xmin += icon_size; /* without this menu keybindings will overlap the arrow icon [#38083] */ @@ -1586,10 +1588,10 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f); if (extra_icon_type == UI_BUT_ICONEXTRA_UNLINK) { - widget_draw_icon(but, ICON_X, alpha, &temp, false); + widget_draw_icon(but, ICON_X, 0, alpha, &temp, false); } else if (extra_icon_type == UI_BUT_ICONEXTRA_EYEDROPPER) { - widget_draw_icon(but, ICON_EYEDROPPER, alpha, &temp, false); + widget_draw_icon(but, ICON_EYEDROPPER, 0, alpha, &temp, false); } else { BLI_assert(0); @@ -4135,7 +4137,7 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, const char *name, int ic aspect = ICON_DEFAULT_HEIGHT / height; glEnable(GL_BLEND); - UI_icon_draw_aspect(xs, ys, iconid, aspect, 1.0f); /* XXX scale weak get from fstyle? */ + UI_icon_draw_aspect(xs, ys, iconid, 0, aspect, 1.0f); /* XXX scale weak get from fstyle? */ glDisable(GL_BLEND); } } diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c index 2256bd7f8c5..233caf61ae9 100644 --- a/source/blender/editors/io/io_alembic.c +++ b/source/blender/editors/io/io_alembic.c @@ -142,7 +142,7 @@ static void ui_alembic_export_settings(uiLayout *layout, PointerRNA *imfptr) #ifdef WITH_ALEMBIC_HDF5 box = uiLayoutBox(layout); row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Archive Options:"), ICON_NONE); + uiItemL(row, IFACE_("Archive Options:"), ICON_NONE, 0); row = uiLayoutRow(box, false); uiItemR(row, imfptr, "compression_type", 0, NULL, ICON_NONE); @@ -150,7 +150,7 @@ static void ui_alembic_export_settings(uiLayout *layout, PointerRNA *imfptr) box = uiLayoutBox(layout); row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Manual Transform:"), ICON_NONE); + uiItemL(row, IFACE_("Manual Transform:"), ICON_NONE, 0); row = uiLayoutRow(box, false); uiItemR(row, imfptr, "global_scale", 0, NULL, ICON_NONE); @@ -158,7 +158,7 @@ static void ui_alembic_export_settings(uiLayout *layout, PointerRNA *imfptr) /* Scene Options */ box = uiLayoutBox(layout); row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Scene Options:"), ICON_SCENE_DATA); + uiItemL(row, IFACE_("Scene Options:"), ICON_SCENE_DATA, 0); row = uiLayoutRow(box, false); uiItemR(row, imfptr, "start", 0, NULL, ICON_NONE); @@ -193,7 +193,7 @@ static void ui_alembic_export_settings(uiLayout *layout, PointerRNA *imfptr) /* Object Data */ box = uiLayoutBox(layout); row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Object Options:"), ICON_OBJECT_DATA); + uiItemL(row, IFACE_("Object Options:"), ICON_OBJECT_DATA, 0); row = uiLayoutRow(box, false); uiItemR(row, imfptr, "uvs", 0, NULL, ICON_NONE); @@ -423,14 +423,14 @@ static void ui_alembic_import_settings(uiLayout *layout, PointerRNA *imfptr) { uiLayout *box = uiLayoutBox(layout); uiLayout *row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Manual Transform:"), ICON_NONE); + uiItemL(row, IFACE_("Manual Transform:"), ICON_NONE, 0); row = uiLayoutRow(box, false); uiItemR(row, imfptr, "scale", 0, NULL, ICON_NONE); box = uiLayoutBox(layout); row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Options:"), ICON_NONE); + uiItemL(row, IFACE_("Options:"), ICON_NONE, 0); row = uiLayoutRow(box, false); uiItemR(row, imfptr, "set_frame_range", 0, NULL, ICON_NONE); diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c index 8659100df87..aa8b505dba6 100644 --- a/source/blender/editors/io/io_collada.c +++ b/source/blender/editors/io/io_collada.c @@ -197,7 +197,7 @@ static void uiCollada_exportSettings(uiLayout *layout, PointerRNA *imfptr) /* Export Options: */ box = uiLayoutBox(layout); row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Export Data Options:"), ICON_MESH_DATA); + uiItemL(row, IFACE_("Export Data Options:"), ICON_MESH_DATA, 0); row = uiLayoutRow(box, false); split = uiLayoutSplit(row, 0.6f, UI_LAYOUT_ALIGN_RIGHT); @@ -225,7 +225,7 @@ static void uiCollada_exportSettings(uiLayout *layout, PointerRNA *imfptr) /* Texture options */ box = uiLayoutBox(layout); row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Texture Options:"), ICON_TEXTURE_DATA); + uiItemL(row, IFACE_("Texture Options:"), ICON_TEXTURE_DATA, 0); row = uiLayoutRow(box, false); uiItemR(row, imfptr, "active_uv_only", 0, NULL, ICON_NONE); @@ -243,7 +243,7 @@ static void uiCollada_exportSettings(uiLayout *layout, PointerRNA *imfptr) /* Armature options */ box = uiLayoutBox(layout); row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Armature Options:"), ICON_ARMATURE_DATA); + uiItemL(row, IFACE_("Armature Options:"), ICON_ARMATURE_DATA, 0); row = uiLayoutRow(box, false); uiItemR(row, imfptr, "deform_bones_only", 0, NULL, ICON_NONE); @@ -253,7 +253,7 @@ static void uiCollada_exportSettings(uiLayout *layout, PointerRNA *imfptr) /* Collada options: */ box = uiLayoutBox(layout); row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Collada Options:"), ICON_MODIFIER); + uiItemL(row, IFACE_("Collada Options:"), ICON_MODIFIER, 0); row = uiLayoutRow(box, false); uiItemR(row, imfptr, "triangulate", 0, NULL, ICON_NONE); @@ -264,7 +264,7 @@ static void uiCollada_exportSettings(uiLayout *layout, PointerRNA *imfptr) row = uiLayoutRow(box, false); split = uiLayoutSplit(row, 0.6f, UI_LAYOUT_ALIGN_RIGHT); - uiItemL(split, IFACE_("Transformation Type"), ICON_NONE); + uiItemL(split, IFACE_("Transformation Type"), ICON_NONE, 0); uiItemR(split, imfptr, "export_transformation_type_selection", 0, "", ICON_NONE); row = uiLayoutRow(box, false); @@ -434,14 +434,14 @@ static void uiCollada_importSettings(uiLayout *layout, PointerRNA *imfptr) /* Import Options: */ box = uiLayoutBox(layout); row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Import Data Options:"), ICON_MESH_DATA); + uiItemL(row, IFACE_("Import Data Options:"), ICON_MESH_DATA, 0); row = uiLayoutRow(box, false); uiItemR(row, imfptr, "import_units", 0, NULL, ICON_NONE); box = uiLayoutBox(layout); row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Armature Options:"), ICON_MESH_DATA); + uiItemL(row, IFACE_("Armature Options:"), ICON_MESH_DATA, 0); row = uiLayoutRow(box, false); uiItemR(row, imfptr, "fix_orientation", 0, NULL, ICON_NONE); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index e6bb604d387..971bd2425a3 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -197,7 +197,7 @@ static void area_draw_azone_fullscreen(short x1, short y1, short x2, short y2, f alpha = min_ff(alpha, 0.75f); - UI_icon_draw_aspect(x, y, ICON_FULLSCREEN_EXIT, 0.7f / UI_DPI_FAC, alpha); + UI_icon_draw_aspect(x, y, ICON_FULLSCREEN_EXIT, 0, 0.7f / UI_DPI_FAC, alpha); /* debug drawing : * The click_rect is the same as defined in fullscreen_click_rcti_init diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index fe0fb3f5035..c37e27ad075 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5137,8 +5137,8 @@ static int dyntopo_warning_popup(bContext *C, wmOperatorType *ot, enum eDynTopoW if (flag & (DYNTOPO_WARN_VDATA | DYNTOPO_WARN_EDATA | DYNTOPO_WARN_LDATA)) { const char *msg_error = TIP_("Vertex Data Detected!"); const char *msg = TIP_("Dyntopo will not preserve vertex colors, UVs, or other customdata"); - uiItemL(layout, msg_error, ICON_INFO); - uiItemL(layout, msg, ICON_NONE); + uiItemL(layout, msg_error, ICON_INFO, 0); + uiItemL(layout, msg, ICON_NONE, 0); uiItemS(layout); } @@ -5146,8 +5146,8 @@ static int dyntopo_warning_popup(bContext *C, wmOperatorType *ot, enum eDynTopoW const char *msg_error = TIP_("Generative Modifiers Detected!"); const char *msg = TIP_("Keeping the modifiers will increase polycount when returning to object mode"); - uiItemL(layout, msg_error, ICON_INFO); - uiItemL(layout, msg, ICON_NONE); + uiItemL(layout, msg_error, ICON_INFO, 0); + uiItemL(layout, msg, ICON_NONE, 0); uiItemS(layout); } diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index da3364d872d..01c024e0f24 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -1114,7 +1114,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) ptr = &path->ptr[a]; if (a != 0) - uiItemL(row, "", VICO_SMALL_TRI_RIGHT_VEC); + uiItemL(row, "", VICO_SMALL_TRI_RIGHT_VEC, 0); if (ptr->data) { icon = RNA_struct_ui_icon(ptr->type); @@ -1130,7 +1130,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) MEM_freeN(name); } else - uiItemL(row, "", icon); + uiItemL(row, "", icon, 0); } } } diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index 58c538c4ee5..967b4c188b6 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -563,7 +563,7 @@ static void template_texture_user_menu(bContext *C, uiLayout *layout, void *UNUS /* add label per category */ if (!last_category || !STREQ(last_category, user->category)) { - uiItemL(layout, IFACE_(user->category), ICON_NONE); + uiItemL(layout, IFACE_(user->category), ICON_NONE, 0); but = block->buttons.last; but->drawflag = UI_BUT_TEXT_LEFT; } @@ -608,7 +608,7 @@ void uiTemplateTextureUser(uiLayout *layout, bContext *C) user = ct->user; if (!user) { - uiItemL(layout, IFACE_("No textures in context"), ICON_NONE); + uiItemL(layout, IFACE_("No textures in context"), ICON_NONE, 0); return; } diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c index 0378c68d12c..4871b0b3339 100644 --- a/source/blender/editors/space_clip/clip_buttons.c +++ b/source/blender/editors/space_clip/clip_buttons.c @@ -537,7 +537,7 @@ void uiTemplateMovieclipInformation(uiLayout *layout, PointerRNA *ptr, const cha ofs += BLI_strncpy_rlen(str + ofs, IFACE_(", failed to load"), sizeof(str) - ofs); } - uiItemL(col, str, ICON_NONE); + uiItemL(col, str, ICON_NONE, 0); /* Display current frame number. */ framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, user->framenr); @@ -545,7 +545,7 @@ void uiTemplateMovieclipInformation(uiLayout *layout, PointerRNA *ptr, const cha BLI_snprintf(str, sizeof(str), IFACE_("Frame: %d / %d"), framenr, clip->len); else BLI_snprintf(str, sizeof(str), IFACE_("Frame: - / %d"), clip->len); - uiItemL(col, str, ICON_NONE); + uiItemL(col, str, ICON_NONE, 0); /* Display current file name if it's a sequence clip. */ if (clip->source == MCLIP_SRC_SEQUENCE) { @@ -562,7 +562,7 @@ void uiTemplateMovieclipInformation(uiLayout *layout, PointerRNA *ptr, const cha BLI_snprintf(str, sizeof(str), IFACE_("File: %s"), file); - uiItemL(col, str, ICON_NONE); + uiItemL(col, str, ICON_NONE, 0); } IMB_freeImBuf(ibuf); diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c index b042bbe8fea..f34e9bd8ef7 100644 --- a/source/blender/editors/space_clip/clip_toolbar.c +++ b/source/blender/editors/space_clip/clip_toolbar.c @@ -210,7 +210,7 @@ static void clip_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOp { if (op->type->flag & OPTYPE_MACRO) { for (op = op->macro.first; op; op = op->next) { - uiItemL(pa->layout, RNA_struct_ui_name(op->type->srna), ICON_NONE); + uiItemL(pa->layout, RNA_struct_ui_name(op->type->srna), ICON_NONE, 0); clip_panel_operator_redo_operator(C, pa, op); } } diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 52d01063175..b0d05714d8e 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -389,7 +389,7 @@ static void file_draw_preview( glaDrawPixelsTexScaled((float)xco, (float)yco, imb->x, imb->y, GL_RGBA, GL_UNSIGNED_BYTE, GL_NEAREST, imb->rect, scale, scale); if (icon) { - UI_icon_draw_aspect((float)xco, (float)yco, icon, icon_aspect, 1.0f); + UI_icon_draw_aspect((float)xco, (float)yco, icon, 0, icon_aspect, 1.0f); } /* border */ diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 516814b63b4..010c0e16232 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -190,7 +190,7 @@ static void graph_panel_properties(const bContext *C, Panel *pa) if (ale->type == ANIMTYPE_NLACURVE) icon = ICON_NLA; } - uiItemL(col, name, icon); + uiItemL(col, name, icon, 0); /* RNA-Path Editing - only really should be enabled when things aren't working */ col = uiLayoutColumn(layout, true); @@ -200,7 +200,7 @@ static void graph_panel_properties(const bContext *C, Panel *pa) /* color settings */ col = uiLayoutColumn(layout, true); - uiItemL(col, IFACE_("Display Color:"), ICON_NONE); + uiItemL(col, IFACE_("Display Color:"), ICON_NONE, 0); row = uiLayoutRow(col, true); uiItemR(row, &fcu_ptr, "color_mode", 0, "", ICON_NONE); @@ -360,8 +360,8 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa) col = uiLayoutColumn(layout, false); if (fcu->flag & FCURVE_DISCRETE_VALUES) { uiLayout *split = uiLayoutSplit(col, 0.33f, true); - uiItemL(split, IFACE_("Interpolation:"), ICON_NONE); - uiItemL(split, IFACE_("None for Enum/Boolean"), ICON_IPO_CONSTANT); + uiItemL(split, IFACE_("Interpolation:"), ICON_NONE, 0); + uiItemL(split, IFACE_("None for Enum/Boolean"), ICON_IPO_CONSTANT, 0); } else { uiItemR(col, &bezt_ptr, "interpolation", 0, NULL, ICON_NONE); @@ -393,7 +393,7 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa) col = uiLayoutColumn(layout, true); /* keyframe itself */ { - uiItemL(col, IFACE_("Key:"), ICON_NONE); + uiItemL(col, IFACE_("Key:"), ICON_NONE, 0); but = uiDefButR(block, UI_BTYPE_NUM, B_REDR, IFACE_("Frame:"), 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "co", 0, 0, 0, -1, -1, NULL); @@ -407,7 +407,7 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa) /* previous handle - only if previous was Bezier interpolation */ if ((prevbezt) && (prevbezt->ipo == BEZT_IPO_BEZ)) { - uiItemL(col, IFACE_("Left Handle:"), ICON_NONE); + uiItemL(col, IFACE_("Left Handle:"), ICON_NONE, 0); but = uiDefButR(block, UI_BTYPE_NUM, B_REDR, "X:", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "handle_left", 0, 0, 0, -1, -1, NULL); @@ -427,7 +427,7 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa) /* next handle - only if current is Bezier interpolation */ if (bezt->ipo == BEZT_IPO_BEZ) { /* NOTE: special update callbacks are needed on the coords here due to T39911 */ - uiItemL(col, IFACE_("Right Handle:"), ICON_NONE); + uiItemL(col, IFACE_("Right Handle:"), ICON_NONE, 0); but = uiDefButR(block, UI_BTYPE_NUM, B_REDR, "X:", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "handle_right", 0, 0, 0, -1, -1, NULL); @@ -447,16 +447,16 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa) else { if ((fcu->bezt == NULL) && (fcu->modifiers.first)) { /* modifiers only - so no keyframes to be active */ - uiItemL(layout, IFACE_("F-Curve only has F-Modifiers"), ICON_NONE); - uiItemL(layout, IFACE_("See Modifiers panel below"), ICON_INFO); + uiItemL(layout, IFACE_("F-Curve only has F-Modifiers"), ICON_NONE, 0); + uiItemL(layout, IFACE_("See Modifiers panel below"), ICON_INFO, 0); } else if (fcu->fpt) { /* samples only */ uiItemL(layout, IFACE_("F-Curve doesn't have any keyframes as it only contains sampled points"), - ICON_NONE); + ICON_NONE, 0); } else - uiItemL(layout, IFACE_("No active keyframe on F-Curve"), ICON_NONE); + uiItemL(layout, IFACE_("No active keyframe on F-Curve"), ICON_NONE, 0); } MEM_freeN(ale); @@ -528,28 +528,28 @@ static void driver_dvar_invalid_name_query_cb(bContext *C, void *dvar_v, void *U DriverVar *dvar = (DriverVar *)dvar_v; if (dvar->flag & DVAR_FLAG_INVALID_EMPTY) { - uiItemL(layout, "It cannot be left blank", ICON_ERROR); + uiItemL(layout, "It cannot be left blank", ICON_ERROR, 0); } if (dvar->flag & DVAR_FLAG_INVALID_START_NUM) { - uiItemL(layout, "It cannot start with a number", ICON_ERROR); + uiItemL(layout, "It cannot start with a number", ICON_ERROR, 0); } if (dvar->flag & DVAR_FLAG_INVALID_START_CHAR) { uiItemL(layout, "It cannot start with a special character," " including '$', '@', '!', '~', '+', '-', '_', '.', or ' '", - ICON_NONE); + ICON_NONE, 0); } if (dvar->flag & DVAR_FLAG_INVALID_HAS_SPACE) { - uiItemL(layout, "It cannot contain spaces (e.g. 'a space')", ICON_ERROR); + uiItemL(layout, "It cannot contain spaces (e.g. 'a space')", ICON_ERROR, 0); } if (dvar->flag & DVAR_FLAG_INVALID_HAS_DOT) { - uiItemL(layout, "It cannot contain dots (e.g. 'a.dot')", ICON_ERROR); + uiItemL(layout, "It cannot contain dots (e.g. 'a.dot')", ICON_ERROR, 0); } if (dvar->flag & DVAR_FLAG_INVALID_HAS_SPECIAL) { - uiItemL(layout, "It cannot contain special (non-alphabetical/numeric) characters", ICON_ERROR); + uiItemL(layout, "It cannot contain special (non-alphabetical/numeric) characters", ICON_ERROR, 0); } if (dvar->flag & DVAR_FLAG_INVALID_PY_KEYWORD) { - uiItemL(layout, "It cannot be a reserved keyword in Python", ICON_INFO); + uiItemL(layout, "It cannot be a reserved keyword in Python", ICON_INFO, 0); } UI_popup_menu_end(C, pup); @@ -771,29 +771,29 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) /* errors? */ if ((G.f & G_SCRIPT_AUTOEXEC) == 0) { - uiItemL(col, IFACE_("ERROR: Python auto-execution disabled"), ICON_CANCEL); + uiItemL(col, IFACE_("ERROR: Python auto-execution disabled"), ICON_CANCEL, 0); } else if (driver->flag & DRIVER_FLAG_INVALID) { - uiItemL(col, IFACE_("ERROR: Invalid Python expression"), ICON_CANCEL); + uiItemL(col, IFACE_("ERROR: Invalid Python expression"), ICON_CANCEL, 0); } /* Explicit bpy-references are evil. Warn about these to prevent errors */ /* TODO: put these in a box? */ if (bpy_data_expr_error || bpy_ctx_expr_error) { - uiItemL(col, IFACE_("WARNING: Driver expression may not work correctly"), ICON_HELP); + uiItemL(col, IFACE_("WARNING: Driver expression may not work correctly"), ICON_HELP, 0); if (bpy_data_expr_error) { - uiItemL(col, IFACE_("TIP: Use variables instead of bpy.data paths (see below)"), ICON_ERROR); + uiItemL(col, IFACE_("TIP: Use variables instead of bpy.data paths (see below)"), ICON_ERROR, 0); } if (bpy_ctx_expr_error) { - uiItemL(col, IFACE_("TIP: bpy.context is not safe for renderfarm usage"), ICON_ERROR); + uiItemL(col, IFACE_("TIP: bpy.context is not safe for renderfarm usage"), ICON_ERROR, 0); } } } else { /* errors? */ if (driver->flag & DRIVER_FLAG_INVALID) - uiItemL(col, IFACE_("ERROR: Invalid target channel(s)"), ICON_ERROR); + uiItemL(col, IFACE_("ERROR: Invalid target channel(s)"), ICON_ERROR, 0); /* Warnings about a lack of variables * NOTE: The lack of variables is generally a bad thing, since it indicates @@ -802,11 +802,11 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) * property animation */ if (BLI_listbase_is_empty(&driver->variables)) { - uiItemL(col, IFACE_("ERROR: Driver is useless without any inputs"), ICON_ERROR); + uiItemL(col, IFACE_("ERROR: Driver is useless without any inputs"), ICON_ERROR, 0); if (!BLI_listbase_is_empty(&fcu->modifiers)) { - uiItemL(col, IFACE_("TIP: Use F-Curves for procedural animation instead"), ICON_INFO); - uiItemL(col, IFACE_("F-Modifiers can generate curves for those too"), ICON_INFO); + uiItemL(col, IFACE_("TIP: Use F-Curves for procedural animation instead"), ICON_INFO, 0); + uiItemL(col, IFACE_("F-Modifiers can generate curves for those too"), ICON_INFO, 0); } } } @@ -825,10 +825,10 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) uiLayout *row = uiLayoutRow(col, true); char valBuf[32]; - uiItemL(row, IFACE_("Driver Value:"), ICON_NONE); + uiItemL(row, IFACE_("Driver Value:"), ICON_NONE, 0); BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", driver->curval); - uiItemL(row, valBuf, ICON_NONE); + uiItemL(row, valBuf, ICON_NONE, 0); } /* add/copy/paste driver variables */ @@ -923,7 +923,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) box = uiLayoutBox(col); row = uiLayoutRow(box, true); - uiItemL(row, IFACE_("Value:"), ICON_NONE); + uiItemL(row, IFACE_("Value:"), ICON_NONE, 0); if ((dvar->type == DVAR_TYPE_ROT_DIFF) || (dvar->type == DVAR_TYPE_TRANSFORM_CHAN && @@ -936,7 +936,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", dvar->curval); } - uiItemL(row, valBuf, ICON_NONE); + uiItemL(row, valBuf, ICON_NONE, 0); } } diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index b9d98dfe794..0587f7facd2 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -900,8 +900,8 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char image_info(scene, iuser, ima, ibuf, str, MAX_IMAGE_INFO_LEN); BKE_image_release_ibuf(ima, ibuf, lock); - uiItemL(layout, ima->id.name + 2, ICON_NONE); - uiItemL(layout, str, ICON_NONE); + uiItemL(layout, ima->id.name + 2, ICON_NONE, 0); + uiItemL(layout, str, ICON_NONE, 0); if (ima->type == IMA_TYPE_COMPOSITE) { // XXX not working yet @@ -1109,7 +1109,7 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, int color_man { row = uiLayoutRow(col, false); - uiItemL(row, IFACE_("Color Depth:"), ICON_NONE); + uiItemL(row, IFACE_("Color Depth:"), ICON_NONE, 0); uiItemR(row, imfptr, "color_depth", UI_ITEM_R_EXPAND, NULL, ICON_NONE); } @@ -1151,7 +1151,7 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, int color_man if (imf->imtype == R_IMF_IMTYPE_CINEON) { #if 1 - uiItemL(col, IFACE_("Hard coded Non-Linear, Gamma:1.7"), ICON_NONE); + uiItemL(col, IFACE_("Hard coded Non-Linear, Gamma:1.7"), ICON_NONE, 0); #else uiItemR(col, imfptr, "use_cineon_log", 0, NULL, ICON_NONE); uiItemR(col, imfptr, "cineon_black", 0, NULL, ICON_NONE); @@ -1173,7 +1173,7 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, int color_man display_settings_ptr = RNA_property_pointer_get(imfptr, prop); col = uiLayoutColumn(layout, false); - uiItemL(col, IFACE_("Color Management"), ICON_NONE); + uiItemL(col, IFACE_("Color Management"), ICON_NONE, 0); uiItemR(col, &display_settings_ptr, "display_device", 0, NULL, ICON_NONE); @@ -1220,7 +1220,7 @@ static void uiTemplateViewsFormat(uiLayout *layout, PointerRNA *ptr, PointerRNA col = uiLayoutColumn(layout, false); - uiItemL(col, IFACE_("Views Format:"), ICON_NONE); + uiItemL(col, IFACE_("Views Format:"), ICON_NONE, 0); uiItemR(uiLayoutRow(col, false), ptr, "views_format", UI_ITEM_R_EXPAND, NULL, ICON_NONE); if (stereo3d_format_ptr) { @@ -1305,7 +1305,7 @@ void uiTemplateImageInfo(uiLayout *layout, bContext *C, Image *ima, ImageUser *i image_info(CTX_data_scene(C), iuser, ima, ibuf, str, MAX_IMAGE_INFO_LEN); BKE_image_release_ibuf(ima, ibuf, lock); - uiItemL(layout, str, ICON_NONE); + uiItemL(layout, str, ICON_NONE, 0); } #undef MAX_IMAGE_INFO_LEN diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 6ca738b0e11..a6e14590a56 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -2491,30 +2491,30 @@ static void image_new_draw(bContext *UNUSED(C), wmOperator *op) col[0] = uiLayoutColumn(split, false); col[1] = uiLayoutColumn(split, false); - uiItemL(col[0], IFACE_("Name"), ICON_NONE); + uiItemL(col[0], IFACE_("Name"), ICON_NONE, 0); uiItemR(col[1], &ptr, "name", 0, "", ICON_NONE); - uiItemL(col[0], IFACE_("Width"), ICON_NONE); + uiItemL(col[0], IFACE_("Width"), ICON_NONE, 0); uiItemR(col[1], &ptr, "width", 0, "", ICON_NONE); - uiItemL(col[0], IFACE_("Height"), ICON_NONE); + uiItemL(col[0], IFACE_("Height"), ICON_NONE, 0); uiItemR(col[1], &ptr, "height", 0, "", ICON_NONE); - uiItemL(col[0], IFACE_("Color"), ICON_NONE); + uiItemL(col[0], IFACE_("Color"), ICON_NONE, 0); uiItemR(col[1], &ptr, "color", 0, "", ICON_NONE); - uiItemL(col[0], "", ICON_NONE); + uiItemL(col[0], "", ICON_NONE, 0); uiItemR(col[1], &ptr, "alpha", 0, NULL, ICON_NONE); - uiItemL(col[0], IFACE_("Generated Type"), ICON_NONE); + uiItemL(col[0], IFACE_("Generated Type"), ICON_NONE, 0); uiItemR(col[1], &ptr, "generated_type", 0, "", ICON_NONE); - uiItemL(col[0], "", ICON_NONE); + uiItemL(col[0], "", ICON_NONE, 0); uiItemR(col[1], &ptr, "float", 0, NULL, ICON_NONE); #if 0 if (is_multiview) { - uiItemL(col[0], "", ICON_NONE); + uiItemL(col[0], "", ICON_NONE, 0); uiItemR(col[1], &ptr, "use_stereo_3d", 0, NULL, ICON_NONE); } #endif diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 21777fd8afa..15a38d30c3f 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -292,7 +292,7 @@ static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu) } } else { - uiItemL(layout, IFACE_("No Recent Files"), ICON_NONE); + uiItemL(layout, IFACE_("No Recent Files"), ICON_NONE, 0); } } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 874e54ba5e7..d0292e92f89 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -863,8 +863,8 @@ static void draw_sensor_header(uiLayout *layout, PointerRNA *ptr, PointerRNA *lo uiItemR(sub, ptr, "name", 0, "", ICON_NONE); } else { - uiItemL(sub, IFACE_(sensor_name(sens->type)), ICON_NONE); - uiItemL(sub, sens->name, ICON_NONE); + uiItemL(sub, IFACE_(sensor_name(sens->type)), ICON_NONE, 0); + uiItemL(sub, sens->name, ICON_NONE, 0); } sub = uiLayoutRow(row, false); @@ -930,7 +930,7 @@ static void draw_sensor_armature(uiLayout *layout, PointerRNA *ptr) uiLayout *row; if (ob->type != OB_ARMATURE) { - uiItemL(layout, IFACE_("Sensor only available for armatures"), ICON_NONE); + uiItemL(layout, IFACE_("Sensor only available for armatures"), ICON_NONE, 0); return; } @@ -1033,7 +1033,7 @@ static void draw_sensor_keyboard(uiLayout *layout, PointerRNA *ptr) uiLayout *row, *col; row = uiLayoutRow(layout, false); - uiItemL(row, CTX_IFACE_(BLT_I18NCONTEXT_ID_WINDOWMANAGER, "Key:"), ICON_NONE); + uiItemL(row, CTX_IFACE_(BLT_I18NCONTEXT_ID_WINDOWMANAGER, "Key:"), ICON_NONE, 0); col = uiLayoutColumn(row, false); uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_keys") == false); uiItemR(col, ptr, "key", UI_ITEM_R_EVENT, "", ICON_NONE); @@ -1043,11 +1043,11 @@ static void draw_sensor_keyboard(uiLayout *layout, PointerRNA *ptr) col = uiLayoutColumn(layout, false); uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_keys") == false); row = uiLayoutRow(col, false); - uiItemL(row, IFACE_("First Modifier:"), ICON_NONE); + uiItemL(row, IFACE_("First Modifier:"), ICON_NONE, 0); uiItemR(row, ptr, "modifier_key_1", UI_ITEM_R_EVENT, "", ICON_NONE); row = uiLayoutRow(col, false); - uiItemL(row, IFACE_("Second Modifier:"), ICON_NONE); + uiItemL(row, IFACE_("Second Modifier:"), ICON_NONE, 0); uiItemR(row, ptr, "modifier_key_2", UI_ITEM_R_EVENT, "", ICON_NONE); RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr); @@ -1246,9 +1246,9 @@ static void draw_controller_header(uiLayout *layout, PointerRNA *ptr, int xco, i uiDefBlockBut(uiLayoutGetBlock(layout), controller_state_mask_menu, cont, state, (short)(xco+width-44), yco, 22+22, UI_UNIT_Y, IFACE_("Set controller state index (from 1 to 30)")); } else { - uiItemL(sub, IFACE_(controller_name(cont->type)), ICON_NONE); - uiItemL(sub, cont->name, ICON_NONE); - uiItemL(sub, state, ICON_NONE); + uiItemL(sub, IFACE_(controller_name(cont->type)), ICON_NONE, 0); + uiItemL(sub, cont->name, ICON_NONE, 0); + uiItemL(sub, state, ICON_NONE, 0); } sub = uiLayoutRow(row, false); @@ -1347,8 +1347,8 @@ static void draw_actuator_header(uiLayout *layout, PointerRNA *ptr, PointerRNA * uiItemR(sub, ptr, "name", 0, "", ICON_NONE); } else { - uiItemL(sub, IFACE_(actuator_name(act->type)), ICON_NONE); - uiItemL(sub, act->name, ICON_NONE); + uiItemL(sub, IFACE_(actuator_name(act->type)), ICON_NONE, 0); + uiItemL(sub, act->name, ICON_NONE, 0); } sub = uiLayoutRow(row, false); @@ -1432,7 +1432,7 @@ static void draw_actuator_armature(uiLayout *layout, PointerRNA *ptr) PropertyRNA *bones_prop = NULL; if (ob->type != OB_ARMATURE) { - uiItemL(layout, IFACE_("Actuator only available for armatures"), ICON_NONE); + uiItemL(layout, IFACE_("Actuator only available for armatures"), ICON_NONE, 0); return; } @@ -1538,7 +1538,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext row = uiLayoutRow(layout, false); col = uiLayoutColumn(row, true); - uiItemL(col, IFACE_("Range:"), ICON_NONE); + uiItemL(col, IFACE_("Range:"), ICON_NONE, 0); uiItemR(col, ptr, "range", 0, "", ICON_NONE); col = uiLayoutColumn(row, true); @@ -1636,7 +1636,7 @@ static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr) break; case ACT_EDOB_REPLACE_MESH: if (ob->type != OB_MESH) { - uiItemL(layout, IFACE_("Mode only available for mesh objects"), ICON_NONE); + uiItemL(layout, IFACE_("Mode only available for mesh objects"), ICON_NONE, 0); break; } split = uiLayoutSplit(layout, 0.6, false); @@ -1660,7 +1660,7 @@ static void draw_actuator_edit_object(uiLayout *layout, PointerRNA *ptr) break; case ACT_EDOB_DYNAMICS: if (ob->type != OB_MESH) { - uiItemL(layout, IFACE_("Mode only available for mesh objects"), ICON_NONE); + uiItemL(layout, IFACE_("Mode only available for mesh objects"), ICON_NONE, 0); break; } uiItemR(layout, ptr, "dynamic_operation", 0, NULL, ICON_NONE); @@ -1749,7 +1749,7 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr) uiItemR(split, ptr, "use_local_rotation", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); if (ELEM(physics_type, OB_BODY_TYPE_DYNAMIC, OB_BODY_TYPE_RIGID, OB_BODY_TYPE_SOFT)) { - uiItemL(layout, IFACE_("Dynamic Object Settings:"), ICON_NONE); + uiItemL(layout, IFACE_("Dynamic Object Settings:"), ICON_NONE, 0); split = uiLayoutSplit(layout, 0.9, false); row = uiLayoutRow(split, false); uiItemR(row, ptr, "force", 0, NULL, ICON_NONE); @@ -1830,7 +1830,7 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr) split = uiLayoutSplit(layout, 0.9, false); row = uiLayoutRow(split, false); split = uiLayoutSplit(row, 0.7, false); - uiItemL(split, "", ICON_NONE); /*Just use this for some spacing */ + uiItemL(split, "", ICON_NONE, 0); /*Just use this for some spacing */ uiItemR(split, ptr, "use_character_jump", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); break; } @@ -1919,7 +1919,7 @@ static void draw_actuator_random(uiLayout *layout, PointerRNA *ptr) break; case ACT_RANDOM_BOOL_UNIFORM: - uiItemL(row, IFACE_("Choose between true and false, 50% chance each"), ICON_NONE); + uiItemL(row, IFACE_("Choose between true and false, 50% chance each"), ICON_NONE, 0); break; case ACT_RANDOM_BOOL_BERNOUILLI: @@ -1982,7 +1982,7 @@ static void draw_actuator_shape_action(uiLayout *layout, PointerRNA *ptr) uiLayout *row; if (ob->type != OB_MESH) { - uiItemL(layout, IFACE_("Actuator only available for mesh objects"), ICON_NONE); + uiItemL(layout, IFACE_("Actuator only available for mesh objects"), ICON_NONE, 0); return; } @@ -2020,7 +2020,7 @@ static void draw_actuator_sound(uiLayout *layout, PointerRNA *ptr, bContext *C) uiTemplateID(layout, C, ptr, "sound", NULL, "SOUND_OT_open", NULL); if (!RNA_pointer_get(ptr, "sound").data) { - uiItemL(layout, IFACE_("Select a sound from the list or load a new one"), ICON_NONE); + uiItemL(layout, IFACE_("Select a sound from the list or load a new one"), ICON_NONE, 0); return; } uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE); @@ -2362,8 +2362,8 @@ void logic_buttons(bContext *C, ARegion *ar) split = uiLayoutSplit(box, 0.2f, false); col = uiLayoutColumn(split, false); - uiItemL(col, IFACE_("Visible"), ICON_NONE); - uiItemL(col, IFACE_("Initial"), ICON_NONE); + uiItemL(col, IFACE_("Visible"), ICON_NONE, 0); + uiItemL(col, IFACE_("Initial"), ICON_NONE, 0); subsplit = uiLayoutSplit(split, 0.85f, false); col = uiLayoutColumn(subsplit, false); diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 3243579f7d0..759f48baf62 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -275,9 +275,9 @@ static void nla_panel_animdata(const bContext *C, Panel *pa) row = uiLayoutRow(layout, true); uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_LEFT); - uiItemL(row, id->name + 2, RNA_struct_ui_icon(id_ptr.type)); /* id-block (src) */ - uiItemL(row, "", VICO_SMALL_TRI_RIGHT_VEC); /* expander */ - uiItemL(row, IFACE_("Animation Data"), ICON_ANIM_DATA); /* animdata */ + uiItemL(row, id->name + 2, RNA_struct_ui_icon(id_ptr.type), 0); /* id-block (src) */ + uiItemL(row, "", VICO_SMALL_TRI_RIGHT_VEC, 0); /* expander */ + uiItemL(row, IFACE_("Animation Data"), ICON_ANIM_DATA, 0); /* animdata */ uiItemS(layout); } @@ -343,7 +343,7 @@ static void nla_panel_properties(const bContext *C, Panel *pa) /* strip extents */ column = uiLayoutColumn(layout, true); - uiItemL(column, IFACE_("Strip Extents:"), ICON_NONE); + uiItemL(column, IFACE_("Strip Extents:"), ICON_NONE, 0); uiItemR(column, &strip_ptr, "frame_start", 0, NULL, ICON_NONE); uiItemR(column, &strip_ptr, "frame_end", 0, NULL, ICON_NONE); @@ -378,7 +378,7 @@ static void nla_panel_properties(const bContext *C, Panel *pa) /* settings */ column = uiLayoutColumn(layout, true); uiLayoutSetActive(column, !(RNA_boolean_get(&strip_ptr, "use_animated_influence") || RNA_boolean_get(&strip_ptr, "use_animated_time"))); - uiItemL(column, IFACE_("Playback Settings:"), ICON_NONE); + uiItemL(column, IFACE_("Playback Settings:"), ICON_NONE, 0); uiItemR(column, &strip_ptr, "mute", 0, NULL, ICON_NONE); uiItemR(column, &strip_ptr, "use_reverse", 0, NULL, ICON_NONE); } @@ -408,7 +408,7 @@ static void nla_panel_actclip(const bContext *C, Panel *pa) /* action extents */ // XXX custom names were used here (to avoid the prefixes)... probably not necessary in future? column = uiLayoutColumn(layout, true); - uiItemL(column, IFACE_("Action Extents:"), ICON_NONE); + uiItemL(column, IFACE_("Action Extents:"), ICON_NONE, 0); uiItemR(column, &strip_ptr, "action_frame_start", 0, IFACE_("Start Frame"), ICON_NONE); uiItemR(column, &strip_ptr, "action_frame_end", 0, IFACE_("End Frame"), ICON_NONE); @@ -420,7 +420,7 @@ static void nla_panel_actclip(const bContext *C, Panel *pa) /* action usage */ column = uiLayoutColumn(layout, true); uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_time") == false); - uiItemL(column, IFACE_("Playback Settings:"), ICON_NONE); + uiItemL(column, IFACE_("Playback Settings:"), ICON_NONE, 0); uiItemR(column, &strip_ptr, "scale", 0, NULL, ICON_NONE); uiItemR(column, &strip_ptr, "repeat", 0, NULL, ICON_NONE); } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 7b08b8368ba..b1ab7e8c134 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -77,7 +77,7 @@ static void node_socket_button_label(bContext *UNUSED(C), uiLayout *layout, PointerRNA *UNUSED(ptr), PointerRNA *UNUSED(node_ptr), const char *text) { - uiItemL(layout, text, 0); + uiItemL(layout, text, ICON_NONE, 0); } @@ -706,7 +706,7 @@ static void node_buts_image_user(uiLayout *layout, bContext *C, PointerRNA *ptr, char numstr[32]; const int framenr = BKE_image_user_frame_get(iuser, CFRA, 0, NULL); BLI_snprintf(numstr, sizeof(numstr), IFACE_("Frame: %d"), framenr); - uiItemL(layout, numstr, ICON_NONE); + uiItemL(layout, numstr, ICON_NONE, 0); } if (ELEM(source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { @@ -750,15 +750,15 @@ static void node_shader_buts_mapping(uiLayout *layout, bContext *UNUSED(C), Poin row = uiLayoutRow(layout, false); col = uiLayoutColumn(row, true); - uiItemL(col, IFACE_("Location:"), ICON_NONE); + uiItemL(col, IFACE_("Location:"), ICON_NONE, 0); uiItemR(col, ptr, "translation", 0, "", ICON_NONE); col = uiLayoutColumn(row, true); - uiItemL(col, IFACE_("Rotation:"), ICON_NONE); + uiItemL(col, IFACE_("Rotation:"), ICON_NONE, 0); uiItemR(col, ptr, "rotation", 0, "", ICON_NONE); col = uiLayoutColumn(row, true); - uiItemL(col, IFACE_("Scale:"), ICON_NONE); + uiItemL(col, IFACE_("Scale:"), ICON_NONE, 0); uiItemR(col, ptr, "scale", 0, "", ICON_NONE); row = uiLayoutRow(layout, false); @@ -1369,7 +1369,7 @@ static void node_composit_buts_blur(uiLayout *layout, bContext *UNUSED(C), Point uiItemR(col, ptr, "use_relative", 0, NULL, ICON_NONE); if (RNA_boolean_get(ptr, "use_relative")) { - uiItemL(col, IFACE_("Aspect Correction"), ICON_NONE); + uiItemL(col, IFACE_("Aspect Correction"), ICON_NONE, 0); row = uiLayoutRow(layout, true); uiItemR(row, ptr, "aspect_correction", UI_ITEM_R_EXPAND, NULL, ICON_NONE); @@ -1393,7 +1393,7 @@ static void node_composit_buts_dblur(uiLayout *layout, bContext *UNUSED(C), Poin uiItemR(layout, ptr, "use_wrap", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, true); - uiItemL(col, IFACE_("Center:"), ICON_NONE); + uiItemL(col, IFACE_("Center:"), ICON_NONE, 0); uiItemR(col, ptr, "center_x", 0, IFACE_("X"), ICON_NONE); uiItemR(col, ptr, "center_y", 0, IFACE_("Y"), ICON_NONE); @@ -1424,7 +1424,7 @@ static void node_composit_buts_defocus(uiLayout *layout, bContext *C, PointerRNA uiLayout *sub, *col; col = uiLayoutColumn(layout, false); - uiItemL(col, IFACE_("Bokeh Type:"), ICON_NONE); + uiItemL(col, IFACE_("Bokeh Type:"), ICON_NONE, 0); uiItemR(col, ptr, "bokeh", 0, "", ICON_NONE); uiItemR(col, ptr, "angle", 0, NULL, ICON_NONE); @@ -1521,7 +1521,7 @@ static void node_composit_buts_vecblur(uiLayout *layout, bContext *UNUSED(C), Po uiItemR(col, ptr, "factor", 0, IFACE_("Blur"), ICON_NONE); col = uiLayoutColumn(layout, true); - uiItemL(col, IFACE_("Speed:"), ICON_NONE); + uiItemL(col, IFACE_("Speed:"), ICON_NONE, 0); uiItemR(col, ptr, "speed_min", 0, IFACE_("Min"), ICON_NONE); uiItemR(col, ptr, "speed_max", 0, IFACE_("Max"), ICON_NONE); @@ -1576,9 +1576,9 @@ static void node_composit_buts_double_edge_mask(uiLayout *layout, bContext *UNUS col = uiLayoutColumn(layout, false); - uiItemL(col, IFACE_("Inner Edge:"), ICON_NONE); + uiItemL(col, IFACE_("Inner Edge:"), ICON_NONE, 0); uiItemR(col, ptr, "inner_mode", 0, "", ICON_NONE); - uiItemL(col, IFACE_("Buffer Edge:"), ICON_NONE); + uiItemL(col, IFACE_("Buffer Edge:"), ICON_NONE, 0); uiItemR(col, ptr, "edge_mode", 0, "", ICON_NONE); } @@ -1683,7 +1683,7 @@ static void node_composit_buts_distance_matte(uiLayout *layout, bContext *UNUSED col = uiLayoutColumn(layout, true); - uiItemL(layout, IFACE_("Color Space:"), ICON_NONE); + uiItemL(layout, IFACE_("Color Space:"), ICON_NONE, 0); row = uiLayoutRow(layout, false); uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE); @@ -1695,7 +1695,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C) { uiLayout *row, *col; - uiItemL(layout, IFACE_("Despill Channel:"), ICON_NONE); + uiItemL(layout, IFACE_("Despill Channel:"), ICON_NONE, 0); row = uiLayoutRow(layout, false); uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE); @@ -1703,7 +1703,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C) uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE); if (RNA_enum_get(ptr, "limit_method") == 0) { - uiItemL(col, IFACE_("Limiting Channel:"), ICON_NONE); + uiItemL(col, IFACE_("Limiting Channel:"), ICON_NONE, 0); row = uiLayoutRow(col, false); uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE); } @@ -1745,12 +1745,12 @@ static void node_composit_buts_channel_matte(uiLayout *layout, bContext *UNUSED( { uiLayout *col, *row; - uiItemL(layout, IFACE_("Color Space:"), ICON_NONE); + uiItemL(layout, IFACE_("Color Space:"), ICON_NONE, 0); row = uiLayoutRow(layout, false); uiItemR(row, ptr, "color_space", UI_ITEM_R_EXPAND, NULL, ICON_NONE); col = uiLayoutColumn(layout, false); - uiItemL(col, IFACE_("Key Channel:"), ICON_NONE); + uiItemL(col, IFACE_("Key Channel:"), ICON_NONE, 0); row = uiLayoutRow(col, false); uiItemR(row, ptr, "matte_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE); @@ -1758,7 +1758,7 @@ static void node_composit_buts_channel_matte(uiLayout *layout, bContext *UNUSED( uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE); if (RNA_enum_get(ptr, "limit_method") == 0) { - uiItemL(col, IFACE_("Limiting Channel:"), ICON_NONE); + uiItemL(col, IFACE_("Limiting Channel:"), ICON_NONE, 0); row = uiLayoutRow(col, false); uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE); } @@ -1793,9 +1793,9 @@ static void node_composit_buts_file_output(uiLayout *layout, bContext *UNUSED(C) const bool multilayer = RNA_enum_get(&imfptr, "file_format") == R_IMF_IMTYPE_MULTILAYER; if (multilayer) - uiItemL(layout, IFACE_("Path:"), ICON_NONE); + uiItemL(layout, IFACE_("Path:"), ICON_NONE, 0); else - uiItemL(layout, IFACE_("Base Path:"), ICON_NONE); + uiItemL(layout, IFACE_("Base Path:"), ICON_NONE, 0); uiItemR(layout, ptr, "base_path", 0, "", ICON_NONE); } static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, PointerRNA *ptr) @@ -1852,7 +1852,7 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi if (multilayer) { col = uiLayoutColumn(layout, true); - uiItemL(col, IFACE_("Layer:"), ICON_NONE); + uiItemL(col, IFACE_("Layer:"), ICON_NONE, 0); row = uiLayoutRow(col, false); uiItemR(row, &active_input_ptr, "name", 0, "", ICON_NONE); uiItemFullO(row, "NODE_OT_output_file_remove_active_socket", "", @@ -1861,7 +1861,7 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi else { col = uiLayoutColumn(layout, true); - uiItemL(col, IFACE_("File Subpath:"), ICON_NONE); + uiItemL(col, IFACE_("File Subpath:"), ICON_NONE, 0); row = uiLayoutRow(col, false); uiItemR(row, &active_input_ptr, "path", 0, "", ICON_NONE); uiItemFullO(row, "NODE_OT_output_file_remove_active_socket", "", @@ -1871,7 +1871,7 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi imfptr = RNA_pointer_get(&active_input_ptr, "format"); col = uiLayoutColumn(layout, true); - uiItemL(col, IFACE_("Format:"), ICON_NONE); + uiItemL(col, IFACE_("Format:"), ICON_NONE, 0); uiItemR(col, &active_input_ptr, "use_node_format", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, false); @@ -2082,15 +2082,15 @@ static void node_composit_buts_colorcorrection(uiLayout *layout, bContext *UNUSE uiItemR(row, ptr, "blue", 0, NULL, ICON_NONE); row = uiLayoutRow(layout, false); - uiItemL(row, "", ICON_NONE); - uiItemL(row, IFACE_("Saturation"), ICON_NONE); - uiItemL(row, IFACE_("Contrast"), ICON_NONE); - uiItemL(row, IFACE_("Gamma"), ICON_NONE); - uiItemL(row, IFACE_("Gain"), ICON_NONE); - uiItemL(row, IFACE_("Lift"), ICON_NONE); + uiItemL(row, "", ICON_NONE, 0); + uiItemL(row, IFACE_("Saturation"), ICON_NONE, 0); + uiItemL(row, IFACE_("Contrast"), ICON_NONE, 0); + uiItemL(row, IFACE_("Gamma"), ICON_NONE, 0); + uiItemL(row, IFACE_("Gain"), ICON_NONE, 0); + uiItemL(row, IFACE_("Lift"), ICON_NONE, 0); row = uiLayoutRow(layout, false); - uiItemL(row, IFACE_("Master"), ICON_NONE); + uiItemL(row, IFACE_("Master"), ICON_NONE, 0); uiItemR(row, ptr, "master_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE); uiItemR(row, ptr, "master_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE); uiItemR(row, ptr, "master_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE); @@ -2098,7 +2098,7 @@ static void node_composit_buts_colorcorrection(uiLayout *layout, bContext *UNUSE uiItemR(row, ptr, "master_lift", UI_ITEM_R_SLIDER, "", ICON_NONE); row = uiLayoutRow(layout, false); - uiItemL(row, IFACE_("Highlights"), ICON_NONE); + uiItemL(row, IFACE_("Highlights"), ICON_NONE, 0); uiItemR(row, ptr, "highlights_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE); uiItemR(row, ptr, "highlights_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE); uiItemR(row, ptr, "highlights_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE); @@ -2106,7 +2106,7 @@ static void node_composit_buts_colorcorrection(uiLayout *layout, bContext *UNUSE uiItemR(row, ptr, "highlights_lift", UI_ITEM_R_SLIDER, "", ICON_NONE); row = uiLayoutRow(layout, false); - uiItemL(row, IFACE_("Midtones"), ICON_NONE); + uiItemL(row, IFACE_("Midtones"), ICON_NONE, 0); uiItemR(row, ptr, "midtones_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE); uiItemR(row, ptr, "midtones_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE); uiItemR(row, ptr, "midtones_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE); @@ -2114,7 +2114,7 @@ static void node_composit_buts_colorcorrection(uiLayout *layout, bContext *UNUSE uiItemR(row, ptr, "midtones_lift", UI_ITEM_R_SLIDER, "", ICON_NONE); row = uiLayoutRow(layout, false); - uiItemL(row, IFACE_("Shadows"), ICON_NONE); + uiItemL(row, IFACE_("Shadows"), ICON_NONE, 0); uiItemR(row, ptr, "shadows_saturation", UI_ITEM_R_SLIDER, "", ICON_NONE); uiItemR(row, ptr, "shadows_contrast", UI_ITEM_R_SLIDER, "", ICON_NONE); uiItemR(row, ptr, "shadows_gamma", UI_ITEM_R_SLIDER, "", ICON_NONE); @@ -2135,31 +2135,31 @@ static void node_composit_buts_colorcorrection_ex(uiLayout *layout, bContext *UN uiItemR(row, ptr, "green", 0, NULL, ICON_NONE); uiItemR(row, ptr, "blue", 0, NULL, ICON_NONE); row = layout; - uiItemL(row, IFACE_("Saturation"), ICON_NONE); + uiItemL(row, IFACE_("Saturation"), ICON_NONE, 0); uiItemR(row, ptr, "master_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "highlights_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "midtones_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "shadows_saturation", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemL(row, IFACE_("Contrast"), ICON_NONE); + uiItemL(row, IFACE_("Contrast"), ICON_NONE, 0); uiItemR(row, ptr, "master_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "highlights_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "midtones_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "shadows_contrast", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemL(row, IFACE_("Gamma"), ICON_NONE); + uiItemL(row, IFACE_("Gamma"), ICON_NONE, 0); uiItemR(row, ptr, "master_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "highlights_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "midtones_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "shadows_gamma", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemL(row, IFACE_("Gain"), ICON_NONE); + uiItemL(row, IFACE_("Gain"), ICON_NONE, 0); uiItemR(row, ptr, "master_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "highlights_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "midtones_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "shadows_gain", UI_ITEM_R_SLIDER, NULL, ICON_NONE); - uiItemL(row, IFACE_("Lift"), ICON_NONE); + uiItemL(row, IFACE_("Lift"), ICON_NONE, 0); uiItemR(row, ptr, "master_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "highlights_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "midtones_lift", UI_ITEM_R_SLIDER, NULL, ICON_NONE); @@ -2931,7 +2931,7 @@ static void node_template_properties_update(bNodeType *ntype) static void node_socket_undefined_draw(bContext *UNUSED(C), uiLayout *layout, PointerRNA *UNUSED(ptr), PointerRNA *UNUSED(node_ptr), const char *UNUSED(text)) { - uiItemL(layout, IFACE_("Undefined Socket Type"), ICON_ERROR); + uiItemL(layout, IFACE_("Undefined Socket Type"), ICON_ERROR, 0); } static void node_socket_undefined_draw_color(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PointerRNA *UNUSED(node_ptr), float *r_color) @@ -2944,7 +2944,7 @@ static void node_socket_undefined_draw_color(bContext *UNUSED(C), PointerRNA *UN static void node_socket_undefined_interface_draw(bContext *UNUSED(C), uiLayout *layout, PointerRNA *UNUSED(ptr)) { - uiItemL(layout, IFACE_("Undefined Socket Type"), ICON_ERROR); + uiItemL(layout, IFACE_("Undefined Socket Type"), ICON_ERROR, 0); } static void node_socket_undefined_interface_draw_color(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), float *r_color) @@ -3065,7 +3065,7 @@ static void node_file_output_socket_draw(bContext *C, uiLayout *layout, PointerR NodeImageMultiFileSocket *input = sock->storage; RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotLayer, input, &inputptr); - uiItemL(row, input->layer, ICON_NONE); + uiItemL(row, input->layer, ICON_NONE, 0); } else { NodeImageMultiFileSocket *input = sock->storage; @@ -3074,7 +3074,7 @@ static void node_file_output_socket_draw(bContext *C, uiLayout *layout, PointerR uiBlock *block; RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotFile, input, &inputptr); - uiItemL(row, input->path, ICON_NONE); + uiItemL(row, input->path, ICON_NONE, 0); if (!RNA_boolean_get(&inputptr, "use_node_format")) imfptr = RNA_pointer_get(&inputptr, "format"); @@ -3084,7 +3084,7 @@ static void node_file_output_socket_draw(bContext *C, uiLayout *layout, PointerR RNA_property_enum_get(&imfptr, imtype_prop), &imtype_name); block = uiLayoutGetBlock(row); UI_block_emboss_set(block, UI_EMBOSS_PULLDOWN); - uiItemL(row, imtype_name, ICON_NONE); + uiItemL(row, imtype_name, ICON_NONE, 0); UI_block_emboss_set(block, UI_EMBOSS_NONE); } } @@ -3122,7 +3122,7 @@ static void std_node_socket_draw(bContext *C, uiLayout *layout, PointerRNA *ptr, uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_LEFT); /* draw the socket name right of the actual button */ uiItemR(row, ptr, "default_value", 0, "", 0); - uiItemL(row, text, 0); + uiItemL(row, text, ICON_NONE, 0); break; } case SOCK_STRING: @@ -3130,7 +3130,7 @@ static void std_node_socket_draw(bContext *C, uiLayout *layout, PointerRNA *ptr, uiLayout *row = uiLayoutRow(layout, true); /* draw the socket name right of the actual button */ uiItemR(row, ptr, "default_value", 0, "", 0); - uiItemL(row, text, 0); + uiItemL(row, text, ICON_NONE, 0); break; } default: diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c index f0567924edd..78db146e408 100644 --- a/source/blender/editors/space_node/node_buttons.c +++ b/source/blender/editors/space_node/node_buttons.c @@ -90,7 +90,7 @@ static void node_sockets_panel(const bContext *C, Panel *pa) BLI_snprintf(name, sizeof(name), "%s:", sock->name); split = uiLayoutSplit(layout, 0.35f, false); - uiItemL(split, name, ICON_NONE); + uiItemL(split, name, ICON_NONE, 0); uiTemplateNodeLink(split, ntree, node, sock); } } @@ -146,14 +146,14 @@ static void node_tree_interface_panel(const bContext *C, Panel *pa) split = uiLayoutRow(row, true); col = uiLayoutColumn(split, true); - uiItemL(col, IFACE_("Inputs:"), ICON_NONE); + uiItemL(col, IFACE_("Inputs:"), ICON_NONE, 0); uiTemplateList(col, (bContext *)C, "NODE_UL_interface_sockets", "inputs", &ptr, "inputs", &ptr, "active_input", NULL, 0, 0, 0, 0); opptr = uiItemFullO(col, "NODE_OT_tree_socket_add", "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&opptr, "in_out", SOCK_IN); col = uiLayoutColumn(split, true); - uiItemL(col, IFACE_("Outputs:"), ICON_NONE); + uiItemL(col, IFACE_("Outputs:"), ICON_NONE, 0); uiTemplateList(col, (bContext *)C, "NODE_UL_interface_sockets", "outputs", &ptr, "outputs", &ptr, "active_output", NULL, 0, 0, 0, 0); opptr = uiItemFullO(col, "NODE_OT_tree_socket_add", "", ICON_PLUS, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index ec525e684b0..da2a0de0c88 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -510,7 +510,7 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname) column = uiLayoutColumn(layout, 0); UI_block_layout_set_current(block, column); - uiItemL(column, IFACE_(cname), ICON_NODE); + uiItemL(column, IFACE_(cname), ICON_NODE, 0); but = block->buttons.last; first = 0; @@ -581,7 +581,7 @@ static void ui_template_node_link_menu(bContext *C, uiLayout *layout, void *but_ UI_block_layout_set_current(block, column); if (sock->link) { - uiItemL(column, IFACE_("Link"), ICON_NONE); + uiItemL(column, IFACE_("Link"), ICON_NONE, 0); but = block->buttons.last; but->drawflag = UI_BUT_TEXT_LEFT; @@ -701,7 +701,7 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree, uiItemR(row, &inputptr, "show_expanded", UI_ITEM_R_ICON_ONLY, "", icon); } else - uiItemL(row, "", ICON_BLANK1); + uiItemL(row, "", ICON_BLANK1, 0); bt = block->buttons.last; bt->rect.xmax = UI_UNIT_X / 2; @@ -709,13 +709,13 @@ static void ui_node_draw_input(uiLayout *layout, bContext *C, bNodeTree *ntree, UI_block_emboss_set(block, UI_EMBOSS); } - uiItemL(row, label, ICON_NONE); + uiItemL(row, label, ICON_NONE, 0); bt = block->buttons.last; bt->drawflag = UI_BUT_TEXT_LEFT; if (dependency_loop) { row = uiLayoutRow(split, false); - uiItemL(row, IFACE_("Dependency Loop"), ICON_ERROR); + uiItemL(row, IFACE_("Dependency Loop"), ICON_ERROR, 0); } else if (lnode) { /* input linked to a node */ diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 33a5a7ca7b7..15a99aba408 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -986,7 +986,7 @@ static void tselem_draw_icon_uibut(struct DrawIconArg *arg, int icon) /* restrict column clip... it has been coded by simply overdrawing, doesnt work for buttons */ if (arg->x >= arg->xmax) { glEnable(GL_BLEND); - UI_icon_draw_aspect(arg->x, arg->y, icon, 1.0f / UI_DPI_FAC, arg->alpha); + UI_icon_draw_aspect(arg->x, arg->y, icon, 0, 1.0f / UI_DPI_FAC, arg->alpha); glDisable(GL_BLEND); } else { diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index b9c8c98b62f..e008b3dd4e5 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -945,7 +945,7 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) colsub = uiLayoutColumn(split, true); uiItemR(colsub, ptr, "location", 0, NULL, ICON_NONE); colsub = uiLayoutColumn(split, true); - uiItemL(colsub, "", ICON_NONE); + uiItemL(colsub, "", ICON_NONE, 0); uiItemR(colsub, ptr, "lock_location", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE); split = uiLayoutSplit(layout, 0.8f, false); @@ -959,7 +959,7 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) if (RNA_boolean_get(ptr, "lock_rotations_4d")) uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE + UI_ITEM_R_ICON_ONLY, "", ICON_NONE); else - uiItemL(colsub, "", ICON_NONE); + uiItemL(colsub, "", ICON_NONE, 0); uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE); break; case ROT_MODE_AXISANGLE: /* axis angle */ @@ -970,14 +970,14 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) if (RNA_boolean_get(ptr, "lock_rotations_4d")) uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE); else - uiItemL(colsub, "", ICON_NONE); + uiItemL(colsub, "", ICON_NONE, 0); uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE); break; default: /* euler rotations */ colsub = uiLayoutColumn(split, true); uiItemR(colsub, ptr, "rotation_euler", 0, IFACE_("Rotation"), ICON_NONE); colsub = uiLayoutColumn(split, true); - uiItemL(colsub, "", ICON_NONE); + uiItemL(colsub, "", ICON_NONE, 0); uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE); break; } @@ -987,7 +987,7 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) colsub = uiLayoutColumn(split, true); uiItemR(colsub, ptr, "scale", 0, NULL, ICON_NONE); colsub = uiLayoutColumn(split, true); - uiItemL(colsub, "", ICON_NONE); + uiItemL(colsub, "", ICON_NONE, 0); uiItemR(colsub, ptr, "lock_scale", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE); if (ptr->type == &RNA_Object) { @@ -1008,7 +1008,7 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob) pchan = BKE_pose_channel_active(ob); if (!pchan) { - uiItemL(layout, IFACE_("No Bone Active"), ICON_NONE); + uiItemL(layout, IFACE_("No Bone Active"), ICON_NONE, 0); return; } @@ -1032,7 +1032,7 @@ static void v3d_editarmature_buts(uiLayout *layout, Object *ob) ebone = arm->act_edbone; if (!ebone || (ebone->layer & arm->layer) == 0) { - uiItemL(layout, IFACE_("Nothing selected"), ICON_NONE); + uiItemL(layout, IFACE_("Nothing selected"), ICON_NONE, 0); return; } @@ -1081,22 +1081,22 @@ static void v3d_editmetaball_buts(uiLayout *layout, Object *ob) case MB_BALL: break; case MB_CUBE: - uiItemL(col, IFACE_("Size:"), ICON_NONE); + uiItemL(col, IFACE_("Size:"), ICON_NONE, 0); uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE); uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE); uiItemR(col, &ptr, "size_z", 0, "Z", ICON_NONE); break; case MB_TUBE: - uiItemL(col, IFACE_("Size:"), ICON_NONE); + uiItemL(col, IFACE_("Size:"), ICON_NONE, 0); uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE); break; case MB_PLANE: - uiItemL(col, IFACE_("Size:"), ICON_NONE); + uiItemL(col, IFACE_("Size:"), ICON_NONE, 0); uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE); uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE); break; case MB_ELIPSOID: - uiItemL(col, IFACE_("Size:"), ICON_NONE); + uiItemL(col, IFACE_("Size:"), ICON_NONE, 0); uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE); uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE); uiItemR(col, &ptr, "size_z", 0, "Z", ICON_NONE); diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 62f605ab99c..e634f549f0c 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -84,7 +84,7 @@ static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wm { if (op->type->flag & OPTYPE_MACRO) { for (op = op->macro.first; op; op = op->next) { - uiItemL(pa->layout, RNA_struct_ui_name(op->type->srna), ICON_NONE); + uiItemL(pa->layout, RNA_struct_ui_name(op->type->srna), ICON_NONE, 0); view3d_panel_operator_redo_operator(C, pa, op); } } diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 9d55115a14c..8f43320fb09 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -97,7 +97,7 @@ static const char *rna_translate_ui_text(const char *text, const char *text_ctxt static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, const char *text_ctxt, int translate, int icon, int expand, int slider, int toggle, int icon_only, int event, - int full_event, int emboss, int index, int icon_value) + int full_event, int emboss, int index, int icon_value, int icon_frame) { PropertyRNA *prop = RNA_struct_find_property(ptr, propname); int flag = 0; @@ -122,7 +122,7 @@ static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, flag |= (full_event) ? UI_ITEM_R_FULL_EVENT : 0; flag |= (emboss) ? 0 : UI_ITEM_R_NO_BG; - uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon); + uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon, (unsigned short)icon_frame); } static void rna_uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name, @@ -218,7 +218,7 @@ static void rna_uiItemMenuEnumO(uiLayout *layout, bContext *C, const char *opnam } static void rna_uiItemL(uiLayout *layout, const char *name, const char *text_ctxt, int translate, - int icon, int icon_value) + int icon, int icon_value, int icon_frame) { /* Get translated name (label). */ name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate); @@ -227,7 +227,7 @@ static void rna_uiItemL(uiLayout *layout, const char *name, const char *text_ctx icon = icon_value; } - uiItemL(layout, name, icon); + uiItemL(layout, name, icon, (unsigned short)icon_frame); } static void rna_uiItemM(uiLayout *layout, bContext *C, const char *menuname, const char *name, const char *text_ctxt, @@ -530,6 +530,8 @@ void RNA_api_ui_layout(StructRNA *srna) "when set to -1 all array members are used", -2, INT_MAX); /* RNA_NO_INDEX == -1 */ parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED); RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item"); + parm = RNA_def_property(func, "icon_frame", PROP_INT, PROP_UNSIGNED); + RNA_def_property_ui_text(parm, "Icon Frame", "For multi-frame icons, index of frame to show"); func = RNA_def_function(srna, "props_enum", "uiItemsEnumR"); api_ui_item_rna_common(func); @@ -622,6 +624,8 @@ void RNA_api_ui_layout(StructRNA *srna) api_ui_item_common(func); parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED); RNA_def_property_ui_text(parm, "Icon Value", "Override automatic icon of the item"); + parm = RNA_def_property(func, "icon_frame", PROP_INT, PROP_UNSIGNED); + RNA_def_property_ui_text(parm, "Icon Frame", "For multi-frame icons, index of frame to show"); func = RNA_def_function(srna, "menu", "rna_uiItemM"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 3a53906a8e8..b06d942ae37 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -343,7 +343,7 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect) if (rect) drag_rect_minmax(rect, x, y, x + iconsize, y + iconsize); else - UI_icon_draw_aspect(x, y, drag->icon, 1.0f / UI_DPI_FAC, 0.8); + UI_icon_draw_aspect(x, y, drag->icon, 0, 1.0f / UI_DPI_FAC, 0.8); } /* item name */ diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index b9fd4d2e762..d416dc0b471 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1833,7 +1833,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar split = uiLayoutSplit(layout, 0.0f, false); col = uiLayoutColumn(split, false); - uiItemL(col, IFACE_("Links"), ICON_NONE); + uiItemL(col, IFACE_("Links"), ICON_NONE, 0); #if 0 uiItemStringO(col, IFACE_("Support an Open Animation Movie"), ICON_URL, "WM_OT_url_open", "url", "https://cloud.blender.org/join"); @@ -1858,7 +1858,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION); } uiItemStringO(col, IFACE_("Python API Reference"), ICON_URL, "WM_OT_url_open", "url", url); - uiItemL(col, "", ICON_NONE); + uiItemL(col, "", ICON_NONE, 0); col = uiLayoutColumn(split, false); @@ -1867,7 +1867,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiItemS(col); } - uiItemL(col, IFACE_("Recent"), ICON_NONE); + uiItemL(col, IFACE_("Recent"), ICON_NONE, 0); for (recent = G.recent_files.first, i = 0; (i < 5) && (recent); recent = recent->next, i++) { const char *filename = BLI_path_basename(recent->filepath); uiItemStringO(col, filename, @@ -1877,7 +1877,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiItemS(col); uiItemO(col, NULL, ICON_RECOVER_LAST, "WM_OT_recover_last_session"); - uiItemL(col, "", ICON_NONE); + uiItemL(col, "", ICON_NONE, 0); mt = WM_menutype_find("USERPREF_MT_splash_footer", false); if (mt) { diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index d8a4ddc8d4f..c9285e527f1 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -586,10 +586,10 @@ void uiItemBooleanO(uiLayout *layout, const char *name, int icon, const char *op void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value) RET_NONE void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, float value) RET_NONE void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value) RET_NONE -void uiItemL(struct uiLayout *layout, const char *name, int icon) RET_NONE +void uiItemL(struct uiLayout *layout, const char *name, int icon, const unsigned short icon_frame) RET_NONE void uiItemM(uiLayout *layout, struct bContext *C, const char *menuname, const char *name, int icon) RET_NONE void uiItemS(struct uiLayout *layout) RET_NONE -void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon) RET_NONE +void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon, const unsigned short icon_frame) RET_NONE void uiLayoutSetContextPointer(uiLayout *layout, const char *name, struct PointerRNA *ptr) RET_NONE const char *uiLayoutIntrospect(uiLayout *layout) RET_NULL void UI_reinit_font(void) RET_NONE |