From 749433f20bc5bd893fee0c9fcb2d20578a67d224 Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Fri, 26 Apr 2024 16:29:46 +0200 Subject: [PATCH] UI: Add tooltips with node description to node titles These were already displayed in the node add menu. But it can also be useful to see node descriptions when opening existing projects. Pull Request: https://projects.blender.org/blender/blender/pulls/119705 --- source/blender/editors/interface/interface_query.cc | 4 +++- source/blender/editors/space_node/node_draw.cc | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/interface/interface_query.cc b/source/blender/editors/interface/interface_query.cc index b4a0be021b7..6163fce4968 100644 --- a/source/blender/editors/interface/interface_query.cc +++ b/source/blender/editors/interface/interface_query.cc @@ -68,7 +68,9 @@ bool ui_but_is_interactive_ex(const uiBut *but, const bool labeledit, const bool if (but->type == UI_BTYPE_LABEL) { if (for_tooltip) { /* It's important labels are considered interactive for the purpose of showing tooltip. */ - if (!ui_but_drag_is_draggable(but) && but->tip_func == nullptr) { + if (!ui_but_drag_is_draggable(but) && but->tip_func == nullptr && + (but->tip == nullptr || but->tip[0] == '\0')) + { return false; } } diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 35507d363a7..e101f0f986c 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -3424,7 +3424,8 @@ static void node_draw_basis(const bContext &C, nullptr, 0, 0, - ""); + TIP_(node.typeinfo->ui_description)); + if (node.flag & NODE_MUTED) { UI_but_flag_enable(but, UI_BUT_INACTIVE); } @@ -3661,7 +3662,7 @@ static void node_draw_hidden(const bContext &C, nullptr, 0, 0, - ""); + TIP_(node.typeinfo->ui_description)); /* Outline. */ {