Lines Matching defs:bounds

1469 /// int nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags);
1482 NK_API int nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags);
1488 /// int nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags);
1502 NK_API int nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags);
1858 /// void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds);
1867 NK_API void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds);
2473 /// void nk_layout_space_push(struct nk_context *ctx, struct nk_rect bounds);
2481 NK_API void nk_layout_space_push(struct nk_context*, struct nk_rect bounds);
3468 NK_API int nk_popup_begin(struct nk_context*, enum nk_popup_type, const char*, nk_flags, struct nk_rect bounds);
5329 struct nk_rect bounds;
5415 struct nk_rect bounds;
5909 NK_LIB void nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx, struct nk_window *win, int modify);
5910 NK_LIB void nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx);
5911 NK_LIB void nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx);
5927 NK_LIB const struct nk_style_item* nk_draw_button(struct nk_command_buffer *out, const struct nk_rect *bounds, nk_flags state, const struct nk_style_button *style);
5929 NK_LIB void nk_draw_button_text(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, const char *txt, int len, nk_flags text_alignment, const struct nk_user_font *font);
5930 NK_LIB int nk_do_button_text(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *string, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_input *in, const struct nk_user_font *font);
5931 NK_LIB void nk_draw_button_symbol(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, enum nk_symbol_type type, const struct nk_user_font *font);
5932 NK_LIB int nk_do_button_symbol(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, enum nk_symbol_type symbol, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_input *in, const struct nk_user_font *font);
5933 NK_LIB void nk_draw_button_image(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, const struct nk_image *img);
5934 NK_LIB int nk_do_button_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, struct nk_image img, enum nk_button_behavior b, const struct nk_style_button *style, const struct nk_input *in);
5935 NK_LIB void nk_draw_button_text_symbol(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *label, const struct nk_rect *symbol, nk_flags state, const struct nk_style_button *style, const char *str, int len, enum nk_symbol_type type, const struct nk_user_font *font);
5936 NK_LIB int nk_do_button_text_symbol(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, enum nk_symbol_type symbol, const char *str, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_user_font *font, const struct nk_input *in);
5937 NK_LIB void nk_draw_button_text_image(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *label, const struct nk_rect *image, nk_flags state, const struct nk_style_button *style, const char *str, int len, const struct nk_user_font *font, const struct nk_image *img);
5938 NK_LIB int nk_do_button_text_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, struct nk_image img, const char* str, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_user_font *font, const struct nk_input *in);
5952 NK_LIB void nk_draw_progress(struct nk_command_buffer *out, nk_flags state, const struct nk_style_progress *style, const struct nk_rect *bounds, const struct nk_rect *scursor, nk_size value, nk_size max);
5953 NK_LIB nk_size nk_do_progress(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, nk_size value, nk_size max, int modifiable, const struct nk_style_progress *style, struct nk_input *in);
5956 NK_LIB float nk_slider_behavior(nk_flags *state, struct nk_rect *logical_cursor, struct nk_rect *visual_cursor, struct nk_input *in, struct nk_rect bounds, float slider_min, float slider_max, float slider_value, float slider_step, float slider_steps);
5957 NK_LIB void nk_draw_slider(struct nk_command_buffer *out, nk_flags state, const struct nk_style_slider *style, const struct nk_rect *bounds, const struct nk_rect *visual_cursor, float min, float value, float max);
5958 NK_LIB float nk_do_slider(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, float min, float val, float max, float step, const struct nk_style_slider *style, struct nk_input *in, const struct nk_user_font *font);
5962 NK_LIB void nk_draw_scrollbar(struct nk_command_buffer *out, nk_flags state, const struct nk_style_scrollbar *style, const struct nk_rect *bounds, const struct nk_rect *scroll);
5967 NK_LIB void nk_draw_selectable(struct nk_command_buffer *out, nk_flags state, const struct nk_style_selectable *style, int active, const struct nk_rect *bounds, const struct nk_rect *icon, const struct nk_image *img, enum nk_symbol_type sym, const char *string, int len, nk_flags align, const struct nk_user_font *font);
5968 NK_LIB int nk_do_selectable(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, const struct nk_style_selectable *style, const struct nk_input *in, const struct nk_user_font *font);
5969 NK_LIB int nk_do_selectable_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, const struct nk_image *img, const struct nk_style_selectable *style, const struct nk_input *in, const struct nk_user_font *font);
5973 NK_LIB nk_flags nk_do_edit(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, nk_flags flags, nk_plugin_filter filter, struct nk_text_edit *edit, const struct nk_style_edit *style, struct nk_input *in, const struct nk_user_font *font);
5976 NK_LIB int nk_color_picker_behavior(nk_flags *state, const struct nk_rect *bounds, const struct nk_rect *matrix, const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar, struct nk_colorf *color, const struct nk_input *in);
5978 NK_LIB int nk_do_color_picker(nk_flags *state, struct nk_command_buffer *out, struct nk_colorf *col, enum nk_color_format fmt, struct nk_rect bounds, struct nk_vec2 padding, const struct nk_input *in, const struct nk_user_font *font);
6013 NK_LIB void nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property *style, const struct nk_rect *bounds, const struct nk_rect *label, nk_flags state, const char *name, int len, const struct nk_user_font *font);
9185 /* make sure text fits inside bounds */
12914 /* query glyph bounds from stb_truetype */
15651 header.x = win->bounds.x;
15652 header.y = win->bounds.y;
15653 header.w = win->bounds.w;
15665 win->bounds.x = win->bounds.x + in->mouse.delta.x;
15666 win->bounds.y = win->bounds.y + in->mouse.delta.y;
15676 layout->bounds = win->bounds;
15677 layout->bounds.x += panel_padding.x;
15678 layout->bounds.w -= 2*panel_padding.x;
15681 layout->bounds = nk_shrink_rect(layout->bounds, layout->border);
15683 layout->at_y = layout->bounds.y;
15684 layout->at_x = layout->bounds.x;
15697 layout->bounds.w -= scrollbar_size.x;
15702 layout->bounds.h -= layout->footer_height;
15712 /* calculate header bounds */
15713 header.x = win->bounds.x;
15714 header.y = win->bounds.y;
15715 header.w = win->bounds.w;
15721 layout->bounds.y += header.h;
15722 layout->bounds.h -= header.h;
15811 body.x = win->bounds.x;
15812 body.w = win->bounds.w;
15813 body.y = (win->bounds.y + layout->header_height);
15814 body.h = (win->bounds.h - layout->header_height);
15822 layout->clip = layout->bounds;
15867 if (layout->at_y < (layout->bounds.y + layout->bounds.h))
15868 layout->bounds.h = layout->at_y - layout->bounds.y;
15871 empty_space.x = window->bounds.x;
15872 empty_space.y = layout->bounds.y;
15874 empty_space.w = window->bounds.w;
15878 empty_space.x = window->bounds.x;
15879 empty_space.y = layout->bounds.y;
15881 empty_space.h = layout->bounds.h;
15885 empty_space.x = layout->bounds.x + layout->bounds.w;
15886 empty_space.y = layout->bounds.y;
15888 empty_space.h = layout->bounds.h;
15895 empty_space.x = window->bounds.x;
15896 empty_space.y = layout->bounds.y + layout->bounds.h;
15897 empty_space.w = window->bounds.w;
15930 if (nk_input_is_mouse_hovering_rect(in, layout->bounds) &&
15931 NK_INTERSECT(layout->bounds.x, layout->bounds.y, layout->bounds.w, layout->bounds.h,
15955 scroll.x = layout->bounds.x + layout->bounds.w + panel_padding.x;
15956 scroll.y = layout->bounds.y;
15958 scroll.h = layout->bounds.h;
15974 scroll.x = layout->bounds.x;
15975 scroll.y = layout->bounds.y + layout->bounds.h;
15976 scroll.w = layout->bounds.w;
16005 ? (style->window.border + window->bounds.y + layout->header_height)
16007 ? (layout->bounds.y + layout->bounds.h + layout->footer_height)
16008 : (window->bounds.y + window->bounds.h));
16009 struct nk_rect b = window->bounds;
16010 b.h = padding_y - window->bounds.y;
16017 /* calculate scaler bounds */
16021 scaler.y = layout->bounds.y + layout->bounds.h;
16023 scaler.x = layout->bounds.x - panel_padding.x * 0.5f;
16024 else scaler.x = layout->bounds.x + layout->bounds.w + panel_padding.x;
16054 window->bounds.x += in->mouse.delta.x;
16057 if (window->bounds.w + delta_x >= window_size.x) {
16059 window->bounds.w = window->bounds.w + delta_x;
16065 if (window_size.y < window->bounds.h + in->mouse.delta.y) {
16067 window->bounds.h = window->bounds.h + in->mouse.delta.y;
16262 struct nk_rect bounds, nk_flags flags)
16264 return nk_begin_titled(ctx, title, title, bounds, flags);
16268 struct nk_rect bounds, nk_flags flags)
16302 win->bounds = bounds;
16315 win->bounds = bounds;
16344 win->bounds: nk_rect(win->bounds.x, win->bounds.y, win->bounds.w, h);
16354 iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h);
16361 NK_INTERSECT(win->bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
16362 iter->popup.win->bounds.x, iter->popup.win->bounds.y,
16363 iter->popup.win->bounds.w, iter->popup.win->bounds.h))
16375 iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h);
16382 iter->popup.win->bounds.x, iter->popup.win->bounds.y,
16383 iter->popup.win->bounds.w, iter->popup.win->bounds.h))
16444 return ctx->current->bounds;
16452 return nk_vec2(ctx->current->bounds.x, ctx->current->bounds.y);
16460 return nk_vec2(ctx->current->bounds.w, ctx->current->bounds.h);
16468 return ctx->current->bounds.w;
16476 return ctx->current->bounds.h;
16562 return nk_input_is_mouse_hovering_rect(&ctx->input, ctx->current->bounds);
16575 if (iter->popup.active && iter->popup.win && nk_input_is_mouse_hovering_rect(&ctx->input, iter->popup.win->bounds))
16579 struct nk_rect header = iter->bounds;
16583 } else if (nk_input_is_mouse_hovering_rect(&ctx->input, iter->bounds)) {
16682 const char *name, struct nk_rect bounds)
16690 win->bounds = bounds;
16698 win->bounds.x = pos.x;
16699 win->bounds.y = pos.y;
16707 win->bounds.w = size.x;
16708 win->bounds.h = size.y;
16853 popup->bounds = rect;
16950 popup->bounds = body;
17106 body.x = popup->bounds.x;
17107 body.y = popup->bounds.y;
17132 struct nk_rect bounds;
17143 state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
17147 if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds,
17167 struct nk_rect bounds;
17178 state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
17182 if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer, bounds,
17203 struct nk_rect bounds;
17214 state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
17218 if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds,
17260 if (panel->at_y < (panel->bounds.y + panel->bounds.h)) {
17262 body = panel->bounds;
17264 body.h = (panel->bounds.y + panel->bounds.h) - body.y;
17298 NK_ASSERT(layout->at_y == layout->bounds.y);
17319 layout->menu.w = layout->bounds.w;
17344 layout->bounds.y += layout->menu.h + ctx->style.window.spacing.y + layout->row.height;
17345 layout->bounds.h -= layout->menu.h + ctx->style.window.spacing.y + layout->row.height;
17349 layout->at_y = layout->bounds.y - layout->row.height;
17351 layout->clip.y = layout->bounds.y;
17352 layout->clip.h = layout->bounds.h;
17682 background.x = win->bounds.x;
17683 background.w = win->bounds.w;
17720 return NK_CLAMP(0.0f, pixel_width/win->bounds.x, 1.0f);
17970 layout->bounds.w, layout->row.columns);
18075 ret.w = layout->bounds.w - NK_MAX(layout->at_x - layout->bounds.x,0);
18152 nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
18175 NK_ASSERT(bounds);
18180 layout->bounds.w, layout->row.columns);
18207 bounds->x = layout->at_x + (layout->bounds.w * layout->row.item.x);
18208 bounds->x -= (float)*layout->offset_x;
18209 bounds->y = layout->at_y + (layout->row.height * layout->row.item.y);
18210 bounds->y -= (float)*layout->offset_y;
18211 bounds->w = layout->bounds.w * layout->row.item.w + NK_FRAC(bounds->x);
18212 bounds->h = layout->row.height * layout->row.item.h + NK_FRAC(bounds->y);
18247 bounds->x = layout->at_x + layout->row.item.x;
18248 bounds->w = layout->row.item.w;
18249 if (((bounds->x + bounds->w) > layout->max_x) && modify)
18250 layout->max_x = (bounds->x + bounds->w);
18251 bounds->x -= (float)*layout->offset_x;
18252 bounds->y = layout->at_y + layout->row.item.y;
18253 bounds->y -= (float)*layout->offset_y;
18254 bounds->h = layout->row.item.h;
18279 /* set the bounds of the newly allocated widget */
18280 bounds->w = item_width;
18281 bounds->h = layout->row.height - spacing.y;
18282 bounds->y = layout->at_y - (float)*layout->offset_y;
18283 bounds->x = layout->at_x + item_offset + item_spacing + padding.x;
18284 if (((bounds->x + bounds->w) > layout->max_x) && modify)
18285 layout->max_x = bounds->x + bounds->w;
18286 bounds->x -= (float)*layout->offset_x;
18289 nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx)
18307 nk_layout_widget_space(bounds, ctx, win, nk_true);
18311 nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx)
18332 nk_layout_widget_space(bounds, ctx, win, nk_false);
18334 bounds->x -= layout->row.item_offset;
18383 /* calculate header bounds and draw background */
18451 layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent);
18452 layout->bounds.w -= (style->tab.indent + style->window.padding.x);
18506 layout->bounds.w += ctx->style.tab.indent + ctx->style.window.padding.x;
18569 /* calculate header bounds and draw background */
18634 layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent);
18635 layout->bounds.w -= (style->tab.indent + style->window.padding.x);
18695 struct nk_rect bounds;
18700 nk_panel_alloc_space(&bounds, ctx);
18702 if (!NK_INTERSECT(c->x, c->y, c->w, c->h, bounds.x, bounds.y, bounds.w, bounds.h) &&
18711 panel.bounds = bounds;
18767 pan.bounds.y = g->bounds.y - (g->header_height + g->menu.h);
18768 pan.bounds.x = g->bounds.x - panel_padding.x;
18769 pan.bounds.w = g->bounds.w + 2 * panel_padding.x;
18770 pan.bounds.h = g->bounds.h + g->header_height + g->menu.h;
18772 pan.bounds.x -= g->border;
18773 pan.bounds.y -= g->border;
18774 pan.bounds.w += 2*g->border;
18775 pan.bounds.h += 2*g->border;
18778 pan.bounds.w += ctx->style.window.scrollbar_size.x;
18779 pan.bounds.h += ctx->style.window.scrollbar_size.y;
18790 nk_unify(&clip, &parent->clip, pan.bounds.x, pan.bounds.y,
18791 pan.bounds.x + pan.bounds.w, pan.bounds.y + pan.bounds.h + panel_padding.x);
18799 g->bounds = pan.bounds;
18997 layout->at_y = layout->bounds.y + (float)view->total_height;
19014 struct nk_rect bounds;
19019 nk_layout_peek(&bounds, ctx);
19020 return bounds;
19025 struct nk_rect bounds;
19031 nk_layout_peek(&bounds, ctx);
19032 return nk_vec2(bounds.x, bounds.y);
19037 struct nk_rect bounds;
19043 nk_layout_peek(&bounds, ctx);
19044 return nk_vec2(bounds.w, bounds.h);
19049 struct nk_rect bounds;
19055 nk_layout_peek(&bounds, ctx);
19056 return bounds.w;
19061 struct nk_rect bounds;
19067 nk_layout_peek(&bounds, ctx);
19068 return bounds.h;
19074 struct nk_rect bounds;
19086 nk_layout_peek(&bounds, ctx);
19087 nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
19088 if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
19090 return nk_input_is_mouse_hovering_rect(&ctx->input, bounds);
19096 struct nk_rect bounds;
19108 nk_layout_peek(&bounds, ctx);
19109 nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
19110 if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
19112 return nk_input_mouse_clicked(&ctx->input, btn, bounds);
19118 struct nk_rect bounds;
19130 nk_layout_peek(&bounds, ctx);
19131 nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
19132 if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
19134 return nk_input_has_mouse_click_down_in_rect(&ctx->input, btn, bounds, down);
19137 nk_widget(struct nk_rect *bounds, const struct nk_context *ctx)
19151 nk_panel_alloc_space(bounds, ctx);
19167 bounds->x = (float)((int)bounds->x);
19168 bounds->y = (float)((int)bounds->y);
19169 bounds->w = (float)((int)bounds->w);
19170 bounds->h = (float)((int)bounds->h);
19177 nk_unify(&v, &c, bounds->x, bounds->y, bounds->x + bounds->w, bounds->y + bounds->h);
19178 if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds->x, bounds->y, bounds->w, bounds->h))
19185 nk_widget_fitting(struct nk_rect *bounds, struct nk_context *ctx,
19188 /* update the bounds to stand without padding */
19204 state = nk_widget(bounds, ctx);
19208 bounds->w += panel_padding.x;
19209 bounds->x -= panel_padding.x;
19210 } else bounds->x -= item_padding.x;
19213 bounds->w += panel_padding.x;
19214 else bounds->w += item_padding.x;
19350 struct nk_rect bounds;
19360 nk_panel_alloc_space(&bounds, ctx);
19367 nk_widget_text(&win->buffer, bounds, str, len, &text, alignment, style->font);
19377 struct nk_rect bounds;
19387 nk_panel_alloc_space(&bounds, ctx);
19394 nk_widget_text_wrap(&win->buffer, bounds, str, len, &text, style->font);
19656 struct nk_rect bounds;
19664 if (!nk_widget(&bounds, ctx)) return;
19665 nk_draw_image(&win->buffer, bounds, &img, nk_white);
19671 struct nk_rect bounds;
19679 if (!nk_widget(&bounds, ctx)) return;
19680 nk_draw_image(&win->buffer, bounds, &img, col);
19774 const struct nk_rect *bounds, nk_flags state,
19785 nk_draw_image(out, *bounds, &background->data.image, nk_white);
19787 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
19788 nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
19797 struct nk_rect bounds;
19811 bounds.x = r.x - style->touch_padding.x;
19812 bounds.y = r.y - style->touch_padding.y;
19813 bounds.w = r.w + 2 * style->touch_padding.x;
19814 bounds.h = r.h + 2 * style->touch_padding.y;
19815 return nk_button_behavior(state, bounds, in, behavior);
19819 const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state,
19825 background = nk_draw_button(out, bounds, state, style);
19842 struct nk_command_buffer *out, struct nk_rect bounds,
19858 ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
19860 nk_draw_button_text(out, &bounds, &content, *state, style, string, len, align, font);
19866 const struct nk_rect *bounds, const struct nk_rect *content,
19874 background = nk_draw_button(out, bounds, state, style);
19888 struct nk_command_buffer *out, struct nk_rect bounds,
19903 ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
19905 nk_draw_button_symbol(out, &bounds, &content, *state, style, symbol, font);
19911 const struct nk_rect *bounds, const struct nk_rect *content,
19914 nk_draw_button(out, bounds, state, style);
19919 struct nk_command_buffer *out, struct nk_rect bounds,
19932 ret = nk_do_button(state, out, bounds, style, in, b, &content);
19939 nk_draw_button_image(out, &bounds, &content, *state, style, &img);
19945 const struct nk_rect *bounds, const struct nk_rect *label,
19955 background = nk_draw_button(out, bounds, state, style);
19978 struct nk_command_buffer *out, struct nk_rect bounds,
19993 ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
20003 nk_draw_button_text_symbol(out, &bounds, &content, &tri,
20010 const struct nk_rect *bounds, const struct nk_rect *label,
20017 background = nk_draw_button(out, bounds, state, style);
20035 struct nk_command_buffer *out, struct nk_rect bounds,
20051 ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
20052 icon.y = bounds.y + style->padding.y;
20053 icon.w = icon.h = bounds.h - 2 * style->padding.y;
20055 icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
20057 } else icon.x = bounds.x + 2 * style->padding.x;
20065 nk_draw_button_text_image(out, &bounds, &content, &icon, *state, style, str, len, font, &img);
20122 struct nk_rect bounds;
20133 state = nk_widget(&bounds, ctx);
20137 return nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds,
20166 struct nk_rect bounds;
20179 state = nk_widget(&bounds, ctx);
20187 ret = nk_do_button(&ctx->last_widget_state, &win->buffer, bounds,
20189 nk_draw_button(&win->buffer, &bounds, ctx->last_widget_state, &button);
20200 struct nk_rect bounds;
20211 state = nk_widget(&bounds, ctx);
20214 return nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, bounds,
20232 struct nk_rect bounds;
20244 state = nk_widget(&bounds, ctx);
20247 return nk_do_button_image(&ctx->last_widget_state, &win->buffer, bounds,
20266 struct nk_rect bounds;
20278 state = nk_widget(&bounds, ctx);
20281 return nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds,
20313 struct nk_rect bounds;
20325 state = nk_widget(&bounds, ctx);
20329 bounds, img, text, len, align, ctx->button_behavior,
20466 struct nk_rect bounds;
20481 bounds.x = r.x - style->touch_padding.x;
20482 bounds.y = r.y - style->touch_padding.y;
20483 bounds.w = r.w + 2 * style->touch_padding.x;
20484 bounds.h = r.h + 2 * style->touch_padding.y;
20492 /* calculate the bounds of the cursor inside the selector */
20506 *active = nk_toggle_behavior(in, bounds, state, *active);
20533 struct nk_rect bounds;
20546 state = nk_widget(&bounds, ctx);
20549 nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &active,
20628 struct nk_rect bounds;
20641 state = nk_widget(&bounds, ctx);
20644 nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &is_active,
20683 const struct nk_rect *bounds,
20717 nk_draw_image(out, *bounds, &background->data.image, nk_white);
20720 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
20727 nk_widget_text(out, *bounds, string, len, &text, align, font);
20731 struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
20750 touch.x = bounds.x - style->touch_padding.x;
20751 touch.y = bounds.y - style->touch_padding.y;
20752 touch.w = bounds.w + style->touch_padding.x * 2;
20753 touch.h = bounds.h + style->touch_padding.y * 2;
20761 nk_draw_selectable(out, *state, style, *value, &bounds, 0,0,NK_SYMBOL_NONE, str, len, align, font);
20767 struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
20787 touch.x = bounds.x - style->touch_padding.x;
20788 touch.y = bounds.y - style->touch_padding.y;
20789 touch.w = bounds.w + style->touch_padding.x * 2;
20790 touch.h = bounds.h + style->touch_padding.y * 2;
20794 icon.y = bounds.y + style->padding.y;
20795 icon.w = icon.h = bounds.h - 2 * style->padding.y;
20797 icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
20799 } else icon.x = bounds.x + 2 * style->padding.x;
20808 nk_draw_selectable(out, *state, style, *value, &bounds, &icon, img, NK_SYMBOL_NONE, str, len, align, font);
20814 struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
20834 touch.x = bounds.x - style->touch_padding.x;
20835 touch.y = bounds.y - style->touch_padding.y;
20836 touch.w = bounds.w + style->touch_padding.x * 2;
20837 touch.h = bounds.h + style->touch_padding.y * 2;
20841 icon.y = bounds.y + style->padding.y;
20842 icon.w = icon.h = bounds.h - 2 * style->padding.y;
20844 icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
20846 } else icon.x = bounds.x + 2 * style->padding.x;
20855 nk_draw_selectable(out, *state, style, *value, &bounds, &icon, 0, sym, str, len, align, font);
20870 struct nk_rect bounds;
20883 state = nk_widget(&bounds, ctx);
20886 return nk_do_selectable(&ctx->last_widget_state, &win->buffer, bounds,
20899 struct nk_rect bounds;
20912 state = nk_widget(&bounds, ctx);
20915 return nk_do_selectable_image(&ctx->last_widget_state, &win->buffer, bounds,
20928 struct nk_rect bounds;
20941 state = nk_widget(&bounds, ctx);
20944 return nk_do_selectable_symbol(&ctx->last_widget_state, &win->buffer, bounds,
21006 struct nk_rect bounds, float slider_min, float slider_max, float slider_value,
21021 const float pxstep = bounds.w / slider_steps;
21030 logical_cursor->x = bounds.x + (logical_cursor->w * ratio);
21036 if (nk_input_is_mouse_hovering_rect(in, bounds))
21039 !nk_input_is_mouse_prev_hovering_rect(in, bounds))
21041 else if (nk_input_is_mouse_prev_hovering_rect(in, bounds))
21047 const struct nk_style_slider *style, const struct nk_rect *bounds,
21076 bar.x = bounds->x;
21077 bar.y = (visual_cursor->y + visual_cursor->h/2) - bounds->h/12;
21078 bar.w = bounds->w;
21079 bar.h = bounds->h/6;
21089 nk_draw_image(out, *bounds, &background->data.image, nk_white);
21091 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
21092 nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
21106 struct nk_command_buffer *out, struct nk_rect bounds,
21126 /* remove padding from slider bounds */
21127 bounds.x = bounds.x + style->padding.x;
21128 bounds.y = bounds.y + style->padding.y;
21129 bounds.h = NK_MAX(bounds.h, 2*style->padding.y);
21130 bounds.w = NK_MAX(bounds.w, 2*style->padding.x + style->cursor_size.x);
21131 bounds.w -= 2 * style->padding.x;
21132 bounds.h -= 2 * style->padding.y;
21138 button.y = bounds.y;
21139 button.w = bounds.h;
21140 button.h = bounds.h;
21143 button.x = bounds.x;
21149 button.x = (bounds.x + bounds.w) - button.w;
21154 bounds.x = bounds.x + button.w + style->spacing.x;
21155 bounds.w = bounds.w - (2*button.w + 2*style->spacing.x);
21159 bounds.x += style->cursor_size.x*0.5f;
21160 bounds.w -= style->cursor_size.x;
21173 logical_cursor.h = bounds.h;
21174 logical_cursor.w = bounds.w / slider_steps;
21175 logical_cursor.x = bounds.x + (logical_cursor.w * cursor_offset);
21176 logical_cursor.y = bounds.y;
21180 visual_cursor.y = (bounds.y + bounds.h*0.5f) - visual_cursor.h*0.5f;
21184 in, bounds, slider_min, slider_max, slider_value, step, slider_steps);
21189 nk_draw_slider(out, *state, style, &bounds, &visual_cursor, slider_min, slider_value, slider_max);
21204 struct nk_rect bounds;
21218 state = nk_widget(&bounds, ctx);
21223 *value = nk_do_slider(&ctx->last_widget_state, &win->buffer, bounds, min_value,
21290 const struct nk_style_progress *style, const struct nk_rect *bounds,
21313 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
21314 nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
21315 } else nk_draw_image(out, *bounds, &background->data.image, nk_white);
21325 struct nk_command_buffer *out, struct nk_rect bounds,
21338 cursor.w = NK_MAX(bounds.w, 2 * style->padding.x + 2 * style->border);
21339 cursor.h = NK_MAX(bounds.h, 2 * style->padding.y + 2 * style->border);
21340 cursor = nk_pad_rect(bounds, nk_vec2(style->padding.x + style->border, style->padding.y + style->border));
21345 prog_value = nk_progress_behavior(state, in, bounds, cursor,max, prog_value, modifiable);
21350 nk_draw_progress(out, *state, style, &bounds, &cursor, value, max);
21362 struct nk_rect bounds;
21376 state = nk_widget(&bounds, ctx);
21381 *cur = nk_do_progress(&ctx->last_widget_state, &win->buffer, bounds,
21479 const struct nk_style_scrollbar *style, const struct nk_rect *bounds,
21499 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
21500 nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
21502 nk_draw_image(out, *bounds, &background->data.image, nk_white);
21571 /* calculate scrollbar cursor bounds */
21659 /* calculate cursor bounds */
22872 struct nk_rect bounds, nk_flags flags, nk_plugin_filter filter,
22893 area.x = bounds.x + style->padding.x + style->border;
22894 area.y = bounds.y + style->padding.y + style->border;
22895 area.w = bounds.w - (2.0f * style->padding.x + 2 * style->border);
22896 area.h = bounds.h - (2.0f * style->padding.y + 2 * style->border);
22907 is_hovered = (char)nk_input_is_mouse_hovering_rect(in, bounds);
22910 bounds.x, bounds.y, bounds.w, bounds.h);
23049 nk_stroke_rect(out, bounds, style->rounding, style->border, style->border_color);
23050 nk_fill_rect(out, bounds, style->rounding, background->data.color);
23051 } else nk_draw_image(out, bounds, &background->data.image, nk_white);}
23206 scroll.x = (bounds.x + bounds.w - style->border) - style->scrollbar_size.x;
23463 struct nk_rect bounds;
23479 state = nk_widget(&bounds, ctx);
23501 ret_flags = nk_do_edit(&ctx->last_widget_state, &win->buffer, bounds, flags,
23595 const struct nk_rect *bounds, const struct nk_rect *label, nk_flags state,
23615 nk_draw_image(out, *bounds, &background->data.image, nk_white);
23619 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
23620 nk_stroke_rect(out, *bounds, style->rounding, style->border, background->data.color);
23846 struct nk_rect bounds;
23874 s = nk_widget(&bounds, ctx);
23905 nk_do_property(&ctx->last_widget_state, &win->buffer, bounds, name,
24042 struct nk_rect bounds = {0, 0, 0, 0};
24049 if (!nk_widget(&bounds, ctx)) {
24062 chart->x = bounds.x + style->padding.x;
24063 chart->y = bounds.y + style->padding.y;
24064 chart->w = bounds.w - 2 * style->padding.x;
24065 chart->h = bounds.h - 2 * style->padding.y;
24082 nk_draw_image(&win->buffer, bounds, &background->data.image, nk_white);
24084 nk_fill_rect(&win->buffer, bounds, style->rounding, style->border_color);
24085 nk_fill_rect(&win->buffer, nk_shrink_rect(bounds, style->border),
24137 struct nk_rect bounds;
24153 bounds.x = g->slots[slot].last.x - 2;
24154 bounds.y = g->slots[slot].last.y - 2;
24155 bounds.w = bounds.h = 4;
24160 ret = nk_input_is_mouse_hovering_rect(i, bounds) ? NK_CHART_HOVERING : 0;
24165 nk_fill_rect(out, bounds, 0, color);
24176 bounds.x = cur.x - 3;
24177 bounds.y = cur.y - 3;
24178 bounds.w = bounds.h = 6;
24182 if (nk_input_is_mouse_hovering_rect(i, bounds)) {
24218 /* calculate bounds of current bar chart entry */
24352 const struct nk_rect *bounds, const struct nk_rect *matrix,
24394 if (nk_input_is_mouse_hovering_rect(in, *bounds))
24396 if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, *bounds))
24398 else if (nk_input_is_mouse_prev_hovering_rect(in, *bounds))
24464 enum nk_color_format fmt, struct nk_rect bounds,
24482 bounds.x += padding.x;
24483 bounds.y += padding.x;
24484 bounds.w -= 2 * padding.x;
24485 bounds.h -= 2 * padding.y;
24487 matrix.x = bounds.x;
24488 matrix.y = bounds.y;
24489 matrix.h = bounds.h;
24490 matrix.w = bounds.w - (3 * padding.x + 2 * bar_w);
24493 hue_bar.y = bounds.y;
24498 alpha_bar.y = bounds.y;
24502 ret = nk_color_picker_behavior(state, &bounds, &matrix, &hue_bar,
24517 struct nk_rect bounds;
24529 state = nk_widget(&bounds, ctx);
24532 return nk_do_color_picker(&ctx->last_widget_state, &win->buffer, color, fmt, bounds,
24724 struct nk_rect bounds;
24745 bounds.h = header.h - 4 * style->combo.content_padding.y;
24746 bounds.y = header.y + 2 * style->combo.content_padding.y;
24747 bounds.x = header.x + 2 * style->combo.content_padding.x;
24748 bounds.w = (button.x - (style->combo.content_padding.x + style->combo.spacing.x)) - bounds.x;
24749 nk_fill_rect(&win->buffer, bounds, 0, color);
24808 struct nk_rect bounds = {0,0,0,0};
24831 bounds.h = header.h - 2 * style->combo.content_padding.y;
24832 bounds.y = header.y + style->combo.content_padding.y;
24833 bounds.x = header.x + style->combo.content_padding.x;
24834 bounds.w = (button.x - style->combo.content_padding.y) - bounds.x;
24835 nk_draw_symbol(&win->buffer, symbol, bounds, sym_background, symbol_color,
24839 nk_draw_button_symbol(&win->buffer, &bounds, &content, ctx->last_widget_state,
24982 struct nk_rect bounds = {0,0,0,0};
25005 bounds.h = header.h - 2 * style->combo.content_padding.y;
25006 bounds.y = header.y + style->combo.content_padding.y;
25007 bounds.x = header.x + style->combo.content_padding.x;
25008 bounds.w = (button.x - style->combo.content_padding.y) - bounds.x;
25009 nk_draw_image(&win->buffer, bounds, &img, nk_white);
25012 nk_draw_button_symbol(&win->buffer, &bounds, &content, ctx->last_widget_state,
25322 struct nk_rect bounds;
25342 bounds.x = (float)x;
25343 bounds.y = (float)y;
25344 bounds.w = (float)w;
25345 bounds.h = (float)h;
25348 "__##Tooltip##__", NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_BORDER, bounds);