diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-10-31 20:30:30 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-10-31 20:31:27 +0300 |
commit | c6466ed0d2fc86d3a0c92acd07a154249921eaa6 (patch) | |
tree | 909fc45f507a35b99d5fabf03b619077038da590 /source/blender | |
parent | 11803637926c9e04010c52062fcf0b98c4c3fa6a (diff) |
UI: tweak usage of duplicate/add icon for consistency.
Still difficult to know when exactly the operator will duplicate and when
it will add a new one. Some open a menu with different choices too.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 0ed835bac19..b469d87f737 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -623,13 +623,14 @@ static uiBut *template_id_def_new_but( if (newop) { but = uiDefIconTextButO( - block, but_type, newop, WM_OP_INVOKE_DEFAULT, (id) ? ICON_DUPLICATE : ICON_ADD, + block, but_type, newop, WM_OP_INVOKE_DEFAULT, (id && !use_tab_but) ? ICON_DUPLICATE : ICON_ADD, (id) ? "" : CTX_IFACE_(template_id_context(type), "New"), 0, 0, w, but_height, NULL); UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_ADD_NEW)); } else { but = uiDefIconTextBut( - block, but_type, 0, (id) ? ICON_DUPLICATE : ICON_ADD, (id) ? "" : CTX_IFACE_(template_id_context(type), "New"), + block, but_type, 0, (id && !use_tab_but) ? ICON_DUPLICATE : ICON_ADD, + (id) ? "" : CTX_IFACE_(template_id_context(type), "New"), 0, 0, w, but_height, NULL, 0, 0, 0, 0, NULL); UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_ADD_NEW)); } @@ -1164,7 +1165,7 @@ static void template_search_buttons( template_search_add_button_searchmenu(C, layout, block, template_search, editable, false); template_search_add_button_name(block, &active_ptr, type); - template_search_add_button_operator(block, newop, WM_OP_INVOKE_DEFAULT, ICON_ADD, editable); + template_search_add_button_operator(block, newop, WM_OP_INVOKE_DEFAULT, ICON_DUPLICATE, editable); template_search_add_button_operator(block, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, editable); UI_block_align_end(block); |