diff options
author | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2016-11-15 11:24:38 +0100 |
---|---|---|
committer | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2016-11-15 11:24:38 +0100 |
commit | 26ac34c803be2b7808cb8172f4e16f491c8154a3 (patch) | |
tree | 5ac62b14173fc59c7b99f9c3f8c67653082adf2e /midi_inspector_nk.c | |
parent | efafd15669088308f554939265a5d3879b2d0750 (diff) | |
download | sherlock.lv2-26ac34c803be2b7808cb8172f4e16f491c8154a3.tar.xz |
fix padding.
Diffstat (limited to 'midi_inspector_nk.c')
-rw-r--r-- | midi_inspector_nk.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/midi_inspector_nk.c b/midi_inspector_nk.c index 077ad53..92a4c69 100644 --- a/midi_inspector_nk.c +++ b/midi_inspector_nk.c @@ -202,10 +202,13 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat plughandle_t *handle = data; const float widget_h = handle->dy; + struct nk_style *style = &ctx->style; + const struct nk_vec2 window_padding = style->window.padding; if(nk_begin(ctx, "Window", wbounds, NK_WINDOW_NO_SCROLLBAR)) { nk_window_set_bounds(ctx, wbounds); + struct nk_panel *panel= nk_window_get_panel(ctx); nk_layout_row_dynamic(ctx, widget_h, 3); { @@ -241,8 +244,9 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat } } - nk_layout_row_dynamic(ctx, wbounds.h - 2*widget_h, 1); - if(nk_group_begin(ctx, "Events", 0)) + const float body_h = panel->bounds.h - 4*window_padding.y - 2*widget_h; + nk_layout_row_dynamic(ctx, body_h, 1); + if(nk_group_begin(ctx, "Events", NK_WINDOW_BORDER)) { uint32_t counter = 0; @@ -470,9 +474,9 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat handle->count = counter; - const struct nk_panel *panel = nk_window_get_panel(ctx); if(handle->bottom) { + panel= nk_window_get_panel(ctx); panel->offset->y = panel->at_y; handle->bottom = false; |