aboutsummaryrefslogtreecommitdiff
path: root/atom_inspector_nk.c
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-08-04 15:13:55 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-08-04 15:13:55 +0200
commit6b6a7d06ba18d8d2777797f2274b35bc576ef2a0 (patch)
tree085a354ed62c330970d337b3a8f85a8579d5b8a1 /atom_inspector_nk.c
parent88fdedc539bacb232652871d9beffa272fb94592 (diff)
downloadsherlock.lv2-6b6a7d06ba18d8d2777797f2274b35bc576ef2a0.tar.xz
various fixes.
* patch messages sent on wrong port, etc.
Diffstat (limited to 'atom_inspector_nk.c')
-rw-r--r--atom_inspector_nk.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/atom_inspector_nk.c b/atom_inspector_nk.c
index ed639d3..00d937c 100644
--- a/atom_inspector_nk.c
+++ b/atom_inspector_nk.c
@@ -299,16 +299,35 @@ _atom_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
nk_layout_row_dynamic(ctx, widget_h, 4);
{
- if(nk_checkbox_label(ctx, "overwrite", &handle->state.overwrite))
+ const int32_t state_overwrite = nk_check_label(ctx, "overwrite", handle->state.overwrite);
+ if(state_overwrite != handle->state.overwrite)
+ {
+ handle->state.overwrite = state_overwrite;
_toggle(handle, handle->urid.overwrite, handle->state.overwrite, true);
- if(nk_checkbox_label(ctx, "block", &handle->state.block))
+ }
+
+ const int32_t state_block = nk_check_label(ctx, "block", handle->state.block);
+ if(state_block != handle->state.block)
+ {
+ handle->state.block = state_block;
_toggle(handle, handle->urid.block, handle->state.block, true);
- if(nk_checkbox_label(ctx, "follow", &handle->state.follow))
+ }
+
+ const int32_t state_follow = nk_check_label(ctx, "follow", handle->state.follow);
+ if(state_follow != handle->state.follow)
+ {
+ handle->state.follow = state_follow;
_toggle(handle, handle->urid.follow, handle->state.follow, true);
- if(nk_checkbox_label(ctx, "pretty", &handle->pretty_numbers))
+ }
+
+ const int32_t state_pretty = nk_check_label(ctx, "pretty", handle->state.pretty);
+ if(state_pretty != handle->state.pretty)
{
+ handle->state.pretty = state_pretty;
+ _toggle(handle, handle->urid.pretty, handle->state.pretty, true);
+
handle->ttl_dirty = true;
- sratom_set_pretty_numbers(handle->sratom, handle->pretty_numbers);
+ sratom_set_pretty_numbers(handle->sratom, handle->state.pretty);
}
}