Cleanup: Nodes: Remove unnecessary socket tooltip check #120492

Merged
Hans Goudey merged 1 commits from mod_moder/blender:allways_show_socket_tooltip into main 2024-04-11 00:21:48 +02:00
1 changed files with 0 additions and 25 deletions

View File

@ -1579,20 +1579,6 @@ static std::optional<std::string> create_socket_inspection_string(
return str;
}
static bool node_socket_has_tooltip(const bNodeTree &ntree, const bNodeSocket &socket)
{
if (ntree.type == NTREE_GEOMETRY) {
return true;
}
if (socket.runtime->declaration != nullptr) {
const nodes::SocketDeclaration &socket_decl = *socket.runtime->declaration;
return !socket_decl.description.empty();
}
return false;
}
static std::string node_socket_get_tooltip(const SpaceNode *snode,
const bNodeTree &ntree,
const bNodeSocket &socket)
@ -1651,9 +1637,6 @@ static void node_socket_add_tooltip_in_node_editor(const bNodeTree &ntree,
const bNodeSocket &sock,
uiLayout &layout)
{
if (!node_socket_has_tooltip(ntree, sock)) {
return;
}
uiLayoutSetTooltipFunc(
&layout,
[](bContext *C, void *argN, const char * /*tip*/) {
@ -1670,10 +1653,6 @@ static void node_socket_add_tooltip_in_node_editor(const bNodeTree &ntree,
void node_socket_add_tooltip(const bNodeTree &ntree, const bNodeSocket &sock, uiLayout &layout)
{
if (!node_socket_has_tooltip(ntree, sock)) {
return;
}
struct SocketTooltipData {
const bNodeTree *ntree;
const bNodeSocket *socket;
@ -1727,10 +1706,6 @@ static void node_socket_draw_nested(const bContext &C,
size_id,
outline_col_id);
if (!node_socket_has_tooltip(ntree, sock)) {
return;
}
/* Ideally sockets themselves should be buttons, but they aren't currently. So add an invisible
* button on top of them for the tooltip. */
const eUIEmbossType old_emboss = UI_block_emboss_get(&block);