aboutsummaryrefslogtreecommitdiff
path: root/osc_inspector_nk.c
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-11-15 11:24:38 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-11-15 11:24:38 +0100
commit26ac34c803be2b7808cb8172f4e16f491c8154a3 (patch)
tree5ac62b14173fc59c7b99f9c3f8c67653082adf2e /osc_inspector_nk.c
parentefafd15669088308f554939265a5d3879b2d0750 (diff)
downloadsherlock.lv2-26ac34c803be2b7808cb8172f4e16f491c8154a3.tar.xz
fix padding.
Diffstat (limited to 'osc_inspector_nk.c')
-rw-r--r--osc_inspector_nk.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/osc_inspector_nk.c b/osc_inspector_nk.c
index 990ada0..b6966d2 100644
--- a/osc_inspector_nk.c
+++ b/osc_inspector_nk.c
@@ -282,10 +282,13 @@ _osc_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data
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);
{
@@ -321,8 +324,9 @@ _osc_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data
}
}
- 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;
@@ -363,9 +367,9 @@ _osc_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data
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;