Merge branch 'inolen-master'
This commit is contained in:
commit
4abd29f2ed
21
nuklear.h
21
nuklear.h
@ -15633,10 +15633,13 @@ nk_panel_begin(struct nk_context *ctx, const char *title)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* calculate window footer height */
|
/* calculate window footer height */
|
||||||
if (!(win->flags & NK_WINDOW_NONBLOCK) &&
|
layout->footer_h = 0;
|
||||||
(!(win->flags & NK_WINDOW_NO_SCROLLBAR) || (win->flags & NK_WINDOW_SCALABLE)))
|
if (!(win->flags & NK_WINDOW_NONBLOCK)) {
|
||||||
layout->footer_h = scaler_size.y + style->window.footer_padding.y;
|
if (!(win->flags & NK_WINDOW_NO_SCROLLBAR))
|
||||||
else layout->footer_h = 0;
|
layout->footer_h = scrollbar_size.y + style->window.footer_padding.y;
|
||||||
|
if (win->flags & NK_WINDOW_SCALABLE)
|
||||||
|
layout->footer_h = NK_MAX(layout->footer_h, scaler_size.y + style->window.footer_padding.y);
|
||||||
|
}
|
||||||
|
|
||||||
/* calculate the window size */
|
/* calculate the window size */
|
||||||
if (!(win->flags & NK_WINDOW_NO_SCROLLBAR))
|
if (!(win->flags & NK_WINDOW_NO_SCROLLBAR))
|
||||||
@ -15737,13 +15740,13 @@ nk_panel_begin(struct nk_context *ctx, const char *title)
|
|||||||
int text_len = nk_strlen(title);
|
int text_len = nk_strlen(title);
|
||||||
struct nk_rect label = {0,0,0,0};
|
struct nk_rect label = {0,0,0,0};
|
||||||
float t = font->width(font->userdata, font->height, title, text_len);
|
float t = font->width(font->userdata, font->height, title, text_len);
|
||||||
|
text.padding = nk_vec2(0,0);
|
||||||
|
|
||||||
label.x = header.x + style->window.header.padding.x;
|
label.x = header.x + style->window.header.padding.x;
|
||||||
label.x += style->window.header.label_padding.x;
|
label.x += style->window.header.label_padding.x;
|
||||||
label.y = header.y + style->window.header.label_padding.y;
|
label.y = header.y + style->window.header.label_padding.y;
|
||||||
label.h = font->height + 2 * style->window.header.label_padding.y;
|
label.h = font->height + 2 * style->window.header.label_padding.y;
|
||||||
label.w = t + 2 * style->window.header.spacing.x;
|
label.w = t + 2 * style->window.header.spacing.x;
|
||||||
text.padding = nk_vec2(0,0);
|
|
||||||
nk_widget_text(out, label,(const char*)title, text_len, &text,
|
nk_widget_text(out, label,(const char*)title, text_len, &text,
|
||||||
NK_TEXT_LEFT, font);
|
NK_TEXT_LEFT, font);
|
||||||
}
|
}
|
||||||
@ -15968,19 +15971,19 @@ nk_panel_end(struct nk_context *ctx)
|
|||||||
nk_flags state = 0;
|
nk_flags state = 0;
|
||||||
bounds.x = layout->bounds.x + window_padding.x;
|
bounds.x = layout->bounds.x + window_padding.x;
|
||||||
if (layout->flags & NK_WINDOW_SUB) {
|
if (layout->flags & NK_WINDOW_SUB) {
|
||||||
bounds.h = scrollbar_size.x;
|
bounds.h = scrollbar_size.y;
|
||||||
bounds.y = (layout->flags & NK_WINDOW_BORDER) ?
|
bounds.y = (layout->flags & NK_WINDOW_BORDER) ?
|
||||||
layout->bounds.y + layout->border : layout->bounds.y;
|
layout->bounds.y + layout->border : layout->bounds.y;
|
||||||
bounds.y += layout->header_h + layout->menu.h + layout->height;
|
bounds.y += layout->header_h + layout->menu.h + layout->height;
|
||||||
bounds.w = layout->width;
|
bounds.w = layout->width;
|
||||||
} else if (layout->flags & NK_WINDOW_DYNAMIC) {
|
} else if (layout->flags & NK_WINDOW_DYNAMIC) {
|
||||||
bounds.h = NK_MIN(scrollbar_size.x, layout->footer_h);
|
bounds.h = NK_MIN(scrollbar_size.y, layout->footer_h);
|
||||||
bounds.w = layout->bounds.w;
|
bounds.w = layout->bounds.w;
|
||||||
bounds.y = footer.y;
|
bounds.y = footer.y;
|
||||||
} else {
|
} else {
|
||||||
bounds.h = NK_MIN(scrollbar_size.x, layout->footer_h);
|
bounds.h = NK_MIN(scrollbar_size.y, layout->footer_h);
|
||||||
bounds.y = layout->bounds.y + window->bounds.h;
|
bounds.y = layout->bounds.y + window->bounds.h;
|
||||||
bounds.y -= NK_MAX(layout->footer_h, scrollbar_size.x);
|
bounds.y -= NK_MAX(layout->footer_h, scrollbar_size.y);
|
||||||
bounds.w = layout->width - 2 * window_padding.x;
|
bounds.w = layout->width - 2 * window_padding.x;
|
||||||
}
|
}
|
||||||
scroll_offset = layout->offset->x;
|
scroll_offset = layout->offset->x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user