diff options
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | atom_inspector_nk.c | 2 | ||||
-rw-r--r-- | midi_inspector_nk.c | 2 | ||||
-rw-r--r-- | osc_inspector_nk.c | 4 | ||||
-rw-r--r-- | sherlock_nk.c | 14 | ||||
-rw-r--r-- | sherlock_nk.h | 2 |
6 files changed, 16 insertions, 10 deletions
@@ -1 +1 @@ -0.11.2647 +0.11.2661 diff --git a/atom_inspector_nk.c b/atom_inspector_nk.c index a104f0c..35f585c 100644 --- a/atom_inspector_nk.c +++ b/atom_inspector_nk.c @@ -93,7 +93,7 @@ _atom_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat { plughandle_t *handle = data; - const float widget_h = 20; + const float widget_h = handle->dy; bool ttl_dirty = false; if(nk_begin(ctx, "Window", wbounds, NK_WINDOW_NO_SCROLLBAR)) diff --git a/midi_inspector_nk.c b/midi_inspector_nk.c index 6bfd123..077ad53 100644 --- a/midi_inspector_nk.c +++ b/midi_inspector_nk.c @@ -201,7 +201,7 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat { plughandle_t *handle = data; - const float widget_h = 20; + const float widget_h = handle->dy; if(nk_begin(ctx, "Window", wbounds, NK_WINDOW_NO_SCROLLBAR)) { diff --git a/osc_inspector_nk.c b/osc_inspector_nk.c index f5cd54b..990ada0 100644 --- a/osc_inspector_nk.c +++ b/osc_inspector_nk.c @@ -218,7 +218,7 @@ _osc_packet(plughandle_t *handle, struct nk_context *ctx, const LV2_Atom_Object static void _osc_bundle(plughandle_t *handle, struct nk_context *ctx, const LV2_Atom_Object *obj, float offset) { - const float widget_h = 20; //FIXME + const float widget_h = handle->dy; const LV2_Atom_Object *timetag = NULL; const LV2_Atom_Tuple *items = NULL; @@ -281,7 +281,7 @@ _osc_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data { plughandle_t *handle = data; - const float widget_h = 20; + const float widget_h = handle->dy; if(nk_begin(ctx, "Window", wbounds, NK_WINDOW_NO_SCROLLBAR)) { diff --git a/sherlock_nk.c b/sherlock_nk.c index 61fbb75..a0386a9 100644 --- a/sherlock_nk.c +++ b/sherlock_nk.c @@ -266,8 +266,12 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri, return NULL; } + const char *NK_SCALE = getenv("NK_SCALE"); + const float scale = NK_SCALE ? atof(NK_SCALE) : 1.f; + handle->dy = 20.f * scale; + nk_pugl_config_t *cfg = &handle->win.cfg; - cfg->height = 700; + cfg->height = 700 * scale; cfg->resizable = true; cfg->ignore = false; cfg->class = "sherlock_inspector"; @@ -276,17 +280,17 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri, cfg->data = handle; if(!strcmp(plugin_uri, SHERLOCK_MIDI_INSPECTOR_URI)) { - cfg->width = 600; + cfg->width = 600 * scale; cfg->expose = _midi_inspector_expose; } else if(!strcmp(plugin_uri, SHERLOCK_ATOM_INSPECTOR_URI)) { - cfg->width = 1200; + cfg->width = 1200 * scale; cfg->expose = _atom_inspector_expose; } else if(!strcmp(plugin_uri, SHERLOCK_OSC_INSPECTOR_URI)) { - cfg->width = 600; + cfg->width = 600 * scale; cfg->expose = _osc_inspector_expose; } @@ -295,7 +299,7 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri, path = NULL; cfg->font.face = path; - cfg->font.size = 13; + cfg->font.size = 13 * scale; *(intptr_t *)widget = nk_pugl_init(&handle->win); nk_pugl_show(&handle->win); diff --git a/sherlock_nk.h b/sherlock_nk.h index bf2bd7b..136a5b9 100644 --- a/sherlock_nk.h +++ b/sherlock_nk.h @@ -67,6 +67,8 @@ struct _plughandle_t { Sratom *sratom; const char *base_uri; + + float dy; }; extern const char *max_items [5]; |