aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-08-06 19:16:58 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-08-06 19:16:58 +0200
commit764fc4f9a640d7b5a7c616f1f61f4f45ed48d25d (patch)
treeb8c8b30a20fc7f18f51b4717d585bddcc41de7fb /plugins
parent1be08da413b964cdd89e440bd885eea3f9c0849c (diff)
downloadsynthpod-764fc4f9a640d7b5a7c616f1f61f4f45ed48d25d.zip
synthpod-764fc4f9a640d7b5a7c616f1f61f4f45ed48d25d.tar.gz
synthpod-764fc4f9a640d7b5a7c616f1f61f4f45ed48d25d.tar.bz2
synthpod-764fc4f9a640d7b5a7c616f1f61f4f45ed48d25d.tar.xz
nk: show node sub-text instead of tooltip.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/synthpod_common_nk.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index e912e09..7aa7d42 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -7173,9 +7173,22 @@ _expose_mod_conn(plughandle_t *handle, struct nk_context *ctx, struct nk_rect sp
{
snprintf(tmp, sizeof(tmp), "%s || %s", source_name, sink_name);
}
-#if 0 //FIXME
- nk_tooltip(ctx, tmp);
-#endif
+
+ const size_t tmp_len = strlen(tmp);
+
+ const struct nk_user_font *font = ctx->style.font;
+
+ const float fh = font->height;
+ const float fy = body.y + body.h + fh/2;
+ const float fw = font->width(font->userdata, font->height, tmp, tmp_len);
+ const struct nk_rect body2 = {
+ .x = body.x + (body.w - fw)/2,
+ .y = fy,
+ .w = fw,
+ .h = fh
+ };
+ nk_draw_text(canvas, body2, tmp, tmp_len, font,
+ style->normal.data.color, style->text_normal);
}
}
}