Commit 1ec862e8 authored by Hanspeter Portner's avatar Hanspeter Portner

nk: always start with light row after frame row.

parent 9581f0d8
Pipeline #22689036 passed with stages
in 4 minutes and 39 seconds
......@@ -111,6 +111,25 @@ _set_string(struct nk_str *str, uint32_t size, const char *body)
nk_str_append_text_utf8(str, from, end-from);
}
static inline void
_shadow(struct nk_context *ctx, bool *shadow)
{
if(*shadow)
{
struct nk_style *style = &ctx->style;
const struct nk_vec2 group_padding = style->window.group_padding;
struct nk_command_buffer *canvas = nk_window_get_canvas(ctx);
struct nk_rect b = nk_widget_bounds(ctx);
b.x -= group_padding.x;
b.w *= 10;
b.w += 5*group_padding.x;
nk_fill_rect(canvas, b, 0.f, nk_rgb(0x28, 0x28, 0x28));
}
*shadow = !*shadow;
}
void
_atom_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data)
{
......@@ -236,14 +255,7 @@ _atom_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
const float entry [4] = {0.1, 0.65, 0.15, 0.1};
nk_layout_row(ctx, NK_DYNAMIC, widget_h, 4, entry);
{
if(l % 2 == 0)
{
struct nk_rect b = nk_widget_bounds(ctx);
b.x -= group_padding.x;
b.w *= 10;
b.w += 8*group_padding.x;
nk_fill_rect(canvas, b, 0.f, nk_rgb(0x28, 0x28, 0x28));
}
_shadow(ctx, &handle->shadow);
nk_labelf_colored(ctx, NK_TEXT_LEFT, yellow, "+%04"PRIi64, frames);
if(nk_select_label(ctx, uri, NK_TEXT_LEFT, handle->selected == body))
......
......@@ -271,6 +271,8 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
nk_labelf_colored(ctx, NK_TEXT_LEFT, orange, "@%"PRIi64, itm->frame.offset);
nk_labelf_colored(ctx, NK_TEXT_CENTERED, green, "-%"PRIu32"-", itm->frame.counter);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, violet, "%"PRIi32, itm->frame.nsamples);
handle->shadow = false;
} break;
case ITEM_TYPE_EVENT:
......
......@@ -352,6 +352,8 @@ _osc_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data
nk_labelf_colored(ctx, NK_TEXT_LEFT, orange, "@%"PRIi64, itm->frame.offset);
nk_labelf_colored(ctx, NK_TEXT_CENTERED, green, "-%"PRIu32"-", itm->frame.counter);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, violet, "%"PRIi32, itm->frame.nsamples);
handle->shadow = false;
} break;
case ITEM_TYPE_EVENT:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment