Lines Matching refs:style
105 /// NK_INCLUDE_COMMAND_USERDATA | Defining this adds a userdata pointer into each command. Can be useful for example if you want to provide custom shaders depending on the used widget. Can be combined with the style structures.
517 /// They are used for window, memory, input, style, stack, commands and time management and need
3132 NK_API int nk_button_symbol_label_styled(struct nk_context *ctx, const struct nk_style_button *style, enum nk_symbol_type symbol, const char *title, nk_flags align);
5439 /* The style modifier stack can be used to temporarily change a
5445 * nk_style_push_style_item(ctx, &ctx->style.button.normal, nk_style_item_color(nk_rgb(255,0,0)));
5446 * nk_style_push_style_item(ctx, &ctx->style.button.hover, nk_style_item_color(nk_rgb(255,0,0)));
5447 * nk_style_push_style_item(ctx, &ctx->style.button.active, nk_style_item_color(nk_rgb(255,0,0)));
5448 * nk_style_push_vec2(ctx, &cx->style.button.padding, nk_vec2(2,2));
5573 struct nk_style style;
5896 NK_LIB struct nk_vec2 nk_panel_get_padding(const struct nk_style *style, enum nk_panel_type type);
5897 NK_LIB float nk_panel_get_border(const struct nk_style *style, nk_flags flags, enum nk_panel_type type);
5898 NK_LIB struct nk_color nk_panel_get_border_color(const struct nk_style *style, enum nk_panel_type type);
5905 NK_LIB float nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel_type type, float total_space, int columns);
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);
5928 NK_LIB int nk_do_button(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, const struct nk_style_button *style, const struct nk_input *in, enum nk_button_behavior behavior, struct nk_rect *content);
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);
5946 NK_LIB void nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, int active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font);
5947 NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, int active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font);
5948 NK_LIB int nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, int *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, const struct nk_user_font *font);
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);
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);
5963 NK_LIB float nk_do_scrollbarv(nk_flags *state, struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling, float offset, float target, float step, float button_pixel_inc, const struct nk_style_scrollbar *style, struct nk_input *in, const struct nk_user_font *font);
5964 NK_LIB float nk_do_scrollbarh(nk_flags *state, struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling, float offset, float target, float step, float button_pixel_inc, const struct nk_style_scrollbar *style, struct nk_input *in, const struct nk_user_font *font);
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);
5972 NK_LIB void nk_edit_draw_text(struct nk_command_buffer *out, const struct nk_style_edit *style, float pos_x, float pos_y, float x_offset, const char *text, int byte_len, float row_height, const struct nk_user_font *font, struct nk_color background, struct nk_color foreground, int is_selected);
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);
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);
6014 NK_LIB void nk_do_property(nk_flags *ws, struct nk_command_buffer *out, struct nk_rect property, const char *name, struct nk_property_variant *variant, float inc_per_pixel, char *buffer, int *len, int *state, int *cursor, int *select_begin, int *select_end, const struct nk_style_property *style, enum nk_property_filter filter, struct nk_input *in, const struct nk_user_font *font, struct nk_text_edit *text_edit, enum nk_button_behavior behavior);
14275 struct nk_style *style;
14292 style = &ctx->style;
14296 text = &style->text;
14301 button = &style->button;
14322 button = &style->contextual_button;
14342 button = &style->menu_button;
14362 toggle = &style->checkbox;
14381 toggle = &style->option;
14400 select = &style->selectable;
14423 slider = &style->slider;
14448 button = &style->slider.inc_button;
14465 style->slider.dec_button = style->slider.inc_button;
14468 prog = &style->progress;
14488 scroll = &style->scrollh;
14509 style->scrollv = style->scrollh;
14512 button = &style->scrollh.inc_button;
14529 style->scrollh.dec_button = style->scrollh.inc_button;
14530 style->scrollv.inc_button = style->scrollh.inc_button;
14531 style->scrollv.dec_button = style->scrollh.inc_button;
14534 edit = &style->edit;
14552 edit->scrollbar = style->scrollv;
14560 property = &style->property;
14579 button = &style->property.dec_button;
14597 style->property.inc_button = style->property.dec_button;
14600 edit = &style->property.edit;
14623 chart = &style->chart;
14634 combo = &style->combo;
14652 button = &style->combo.button;
14672 tab = &style->tab;
14685 button = &style->tab.tab_minimize_button;
14703 style->tab.tab_maximize_button =*button;
14706 button = &style->tab.node_minimize_button;
14724 style->tab.node_maximize_button =*button;
14727 win = &style->window;
14743 button = &style->window.header.close_button;
14763 button = &style->window.header.minimize_button;
14819 struct nk_style *style;
14823 style = &ctx->style;
14824 style->font = font;
14844 element->address = &ctx->style.font;
14845 element->old_value = ctx->style.font;
14846 ctx->style.font = font;
14914 struct nk_style *style;
14917 style = &ctx->style;
14918 if (style->cursors[c]) {
14919 style->cursor_active = style->cursors[c];
14927 ctx->style.cursor_visible = nk_true;
14932 ctx->style.cursor_visible = nk_false;
14938 struct nk_style *style;
14941 style = &ctx->style;
14942 style->cursors[cursor] = c;
14948 struct nk_style *style;
14951 style = &ctx->style;
14953 style->cursors[i] = &cursors[i];
14954 style->cursor_visible = nk_true;
14974 if (font) ctx->style.font = font;
15054 nk_zero(&ctx->style, sizeof(ctx->style));
15081 ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
15212 if (!ctx->style.cursor_active)
15213 ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
15214 if (ctx->style.cursor_active && !ctx->input.mouse.grabbed && ctx->style.cursor_visible) {
15216 const struct nk_cursor *cursor = ctx->style.cursor_active;
15555 nk_panel_get_padding(const struct nk_style *style, enum nk_panel_type type)
15559 case NK_PANEL_WINDOW: return style->window.padding;
15560 case NK_PANEL_GROUP: return style->window.group_padding;
15561 case NK_PANEL_POPUP: return style->window.popup_padding;
15562 case NK_PANEL_CONTEXTUAL: return style->window.contextual_padding;
15563 case NK_PANEL_COMBO: return style->window.combo_padding;
15564 case NK_PANEL_MENU: return style->window.menu_padding;
15565 case NK_PANEL_TOOLTIP: return style->window.menu_padding;}
15568 nk_panel_get_border(const struct nk_style *style, nk_flags flags,
15574 case NK_PANEL_WINDOW: return style->window.border;
15575 case NK_PANEL_GROUP: return style->window.group_border;
15576 case NK_PANEL_POPUP: return style->window.popup_border;
15577 case NK_PANEL_CONTEXTUAL: return style->window.contextual_border;
15578 case NK_PANEL_COMBO: return style->window.combo_border;
15579 case NK_PANEL_MENU: return style->window.menu_border;
15580 case NK_PANEL_TOOLTIP: return style->window.menu_border;
15584 nk_panel_get_border_color(const struct nk_style *style, enum nk_panel_type type)
15588 case NK_PANEL_WINDOW: return style->window.border_color;
15589 case NK_PANEL_GROUP: return style->window.group_border_color;
15590 case NK_PANEL_POPUP: return style->window.popup_border_color;
15591 case NK_PANEL_CONTEXTUAL: return style->window.contextual_border_color;
15592 case NK_PANEL_COMBO: return style->window.combo_border_color;
15593 case NK_PANEL_MENU: return style->window.menu_border_color;
15594 case NK_PANEL_TOOLTIP: return style->window.menu_border_color;}
15613 const struct nk_style *style;
15630 style = &ctx->style;
15631 font = style->font;
15639 /* pull style configuration into local stack */
15640 scrollbar_size = style->window.scrollbar_size;
15641 panel_padding = nk_panel_get_padding(style, panel_type);
15655 header.h = font->height + 2.0f * style->window.header.padding.y;
15656 header.h += 2.0f * style->window.header.label_padding.y;
15669 ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_MOVE];
15680 layout->border = nk_panel_get_border(style, win->flags, panel_type);
15716 header.h = font->height + 2.0f * style->window.header.padding.y;
15717 header.h += (2.0f * style->window.header.label_padding.y);
15727 background = &style->window.header.active;
15728 text.text = style->window.header.label_active;
15730 background = &style->window.header.hover;
15731 text.text = style->window.header.label_hover;
15733 background = &style->window.header.normal;
15734 text.text = style->window.header.label_normal;
15749 button.y = header.y + style->window.header.padding.y;
15750 button.h = header.h - 2 * style->window.header.padding.y;
15754 if (style->window.header.align == NK_HEADER_RIGHT) {
15755 button.x = (header.w + header.x) - (button.w + style->window.header.padding.x);
15756 header.w -= button.w + style->window.header.spacing.x + style->window.header.padding.x;
15758 button.x = header.x + style->window.header.padding.x;
15759 header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
15763 style->window.header.close_symbol, NK_BUTTON_DEFAULT,
15764 &style->window.header.close_button, in, style->font) && !(win->flags & NK_WINDOW_ROM))
15774 if (style->window.header.align == NK_HEADER_RIGHT) {
15777 button.x -= style->window.header.padding.x;
15778 header.w -= style->window.header.padding.x;
15780 header.w -= button.w + style->window.header.spacing.x;
15783 header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
15786 style->window.header.maximize_symbol: style->window.header.minimize_symbol,
15787 NK_BUTTON_DEFAULT, &style->window.header.minimize_button, in, style->font) && !(win->flags & NK_WINDOW_ROM))
15799 label.x = header.x + style->window.header.padding.x;
15800 label.x += style->window.header.label_padding.x;
15801 label.y = header.y + style->window.header.label_padding.y;
15802 label.h = font->height + 2 * style->window.header.label_padding.y;
15803 label.w = t + 2 * style->window.header.spacing.x;
15815 if (style->window.fixed_background.type == NK_STYLE_ITEM_IMAGE)
15816 nk_draw_image(out, body, &style->window.fixed_background.data.image, nk_white);
15817 else nk_fill_rect(out, body, 0, style->window.fixed_background.data.color);
15835 const struct nk_style *style;
15849 style = &ctx->style;
15856 scrollbar_size = style->window.scrollbar_size;
15857 panel_padding = nk_panel_get_padding(style, layout->type);
15875 nk_fill_rect(out, empty_space, 0, style->window.background);
15882 nk_fill_rect(out, empty_space, 0, style->window.background);
15891 nk_fill_rect(out, empty_space, 0, style->window.background);
15899 nk_fill_rect(out, empty_space, 0, style->window.background);
15966 &ctx->style.scrollv, in, style->font);
15985 &ctx->style.scrollh, in, style->font);
16003 struct nk_color border_color = nk_panel_get_border_color(style, layout->type);
16005 ? (style->window.border + window->bounds.y + layout->header_height)
16029 {const struct nk_style_item *item = &style->window.scaler;
16045 struct nk_vec2 window_size = style->window.min_size;
16072 ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT];
16271 struct nk_style *style;
16279 NK_ASSERT(ctx->style.font && ctx->style.font->width && "if this triggers you forgot to add a font");
16285 style = &ctx->style;
16341 float h = ctx->style.font->height + 2.0f * style->window.header.padding.y +
16342 (2.0f * style->window.header.label_padding.y);
16580 header.h = ctx->style.font->height + 2 * ctx->style.window.header.padding.y;
17130 const struct nk_style *style;
17142 style = &ctx->style;
17143 state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
17148 text, len, alignment, NK_BUTTON_DEFAULT, &style->contextual_button, in, style->font)) {
17165 const struct nk_style *style;
17177 style = &ctx->style;
17178 state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
17183 img, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)){
17201 const struct nk_style *style;
17213 style = &ctx->style;
17214 state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
17219 symbol, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)) {
17261 struct nk_vec2 padding = nk_panel_get_padding(&ctx->style, panel->type);
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;
17409 title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font))
17439 img, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in))
17464 sym, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font))
17489 header, img, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
17490 ctx->style.font, in))
17522 header, sym, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
17523 ctx->style.font, in)) is_clicked = nk_true;
17613 layout->row.min_height = ctx->style.font->height;
17614 layout->row.min_height += ctx->style.text.padding.y*2;
17615 layout->row.min_height += ctx->style.window.min_row_height_padding*2;
17618 nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel_type type,
17628 spacing = style->window.spacing;
17629 padding = nk_panel_get_padding(style, type);
17642 const struct nk_style *style;
17656 style = &ctx->style;
17658 color = style->window.background;
17659 item_spacing = style->window.spacing;
17969 float space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
18147 struct nk_vec2 spacing = ctx->style.window.spacing;
18156 const struct nk_style *style;
18174 style = &ctx->style;
18177 spacing = style->window.spacing;
18178 padding = nk_panel_get_padding(style, layout->type);
18179 panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
18355 const struct nk_style *style;
18380 style = &ctx->style;
18381 item_spacing = style->window.spacing;
18384 row_height = style->font->height + 2 * style->tab.padding.y;
18391 const struct nk_style_item *background = &style->tab.background;
18397 nk_fill_rect(out, header, 0, style->tab.border_color);
18398 nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
18399 style->tab.rounding, background->data.color);
18401 } else text.background = style->window.background;
18409 /* select correct button style */
18411 symbol = style->tab.sym_maximize;
18413 button = &style->tab.tab_maximize_button;
18414 else button = &style->tab.node_maximize_button;
18416 symbol = style->tab.sym_minimize;
18418 button = &style->tab.tab_minimize_button;
18419 else button = &style->tab.node_minimize_button;
18423 sym.w = sym.h = style->font->height;
18424 sym.y = header.y + style->tab.padding.y;
18425 sym.x = header.x + style->tab.padding.x;
18427 button, 0, style->font);
18433 sym.w = style->font->height + style->tab.spacing.x;}
18441 label.w = header.w - (sym.w + item_spacing.y + style->tab.indent);
18442 label.h = style->font->height;
18443 text.text = style->tab.text;
18446 NK_TEXT_LEFT, style->font);}
18450 layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent;
18451 layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent);
18452 layout->bounds.w -= (style->tab.indent + style->window.padding.x);
18505 layout->at_x -= ctx->style.tab.indent + ctx->style.window.padding.x;
18506 layout->bounds.w += ctx->style.tab.indent + ctx->style.window.padding.x;
18536 const struct nk_style *style;
18565 style = &ctx->style;
18566 item_spacing = style->window.spacing;
18567 padding = style->selectable.padding;
18570 row_height = style->font->height + 2 * style->tab.padding.y;
18577 const struct nk_style_item *background = &style->tab.background;
18583 nk_fill_rect(out, header, 0, style->tab.border_color);
18584 nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
18585 style->tab.rounding, background->data.color);
18587 } else text.background = style->window.background;
18592 /* select correct button style */
18594 symbol = style->tab.sym_maximize;
18596 button = &style->tab.tab_maximize_button;
18597 else button = &style->tab.node_maximize_button;
18599 symbol = style->tab.sym_minimize;
18601 button = &style->tab.tab_minimize_button;
18602 else button = &style->tab.node_minimize_button;
18605 sym.w = sym.h = style->font->height;
18606 sym.y = header.y + style->tab.padding.y;
18607 sym.x = header.x + style->tab.padding.x;
18608 if (nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT, button, in, style->font))
18616 text_width = style->font->width(style->font->userdata, style->font->height, title, text_len);
18622 label.w = NK_MIN(header.w - (sym.w + item_spacing.y + style->tab.indent), text_width);
18623 label.h = style->font->height;
18627 selected, img, &style->selectable, in, style->font);
18629 selected, &style->selectable, in, style->font);
18633 layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent;
18634 layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent);
18635 layout->bounds.w -= (style->tab.indent + style->window.padding.x);
18766 panel_padding = nk_panel_get_padding(&ctx->style, NK_PANEL_GROUP);
18778 pan.bounds.w += ctx->style.window.scrollbar_size.x;
18779 pan.bounds.h += ctx->style.window.scrollbar_size.y;
18940 const struct nk_style *style;
18949 style = &ctx->style;
18950 item_spacing = style->window.spacing;
19190 struct nk_style *style;
19202 style = &ctx->style;
19206 panel_padding = nk_panel_get_padding(style, layout->type);
19347 const struct nk_style *style;
19359 style = &ctx->style;
19361 item_padding = style->text.padding;
19365 text.background = style->window.background;
19367 nk_widget_text(&win->buffer, bounds, str, len, &text, alignment, style->font);
19374 const struct nk_style *style;
19386 style = &ctx->style;
19388 item_padding = style->text.padding;
19392 text.background = style->window.background;
19394 nk_widget_text_wrap(&win->buffer, bounds, str, len, &text, style->font);
19511 nk_text_colored(ctx, str, len, alignment, ctx->style.text.color);
19518 nk_text_wrap_colored(ctx, str, len, ctx->style.text.color);
19775 const struct nk_style_button *style)
19779 background = &style->hover;
19781 background = &style->active;
19782 else background = &style->normal;
19787 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
19788 nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
19794 const struct nk_style_button *style, const struct nk_input *in,
19798 NK_ASSERT(style);
19801 if (!out || !style)
19805 content->x = r.x + style->padding.x + style->border + style->rounding;
19806 content->y = r.y + style->padding.y + style->border + style->rounding;
19807 content->w = r.w - (2 * style->padding.x + style->border + style->rounding*2);
19808 content->h = r.h - (2 * style->padding.y + style->border + style->rounding*2);
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;
19820 const struct nk_style_button *style, const char *txt, int len,
19825 background = nk_draw_button(out, bounds, state, style);
19830 else text.background = style->text_background;
19832 text.text = style->text_hover;
19834 text.text = style->text_active;
19835 else text.text = style->text_normal;
19844 const struct nk_style_button *style, const struct nk_input *in,
19851 NK_ASSERT(style);
19855 if (!out || !style || !font || !string)
19858 ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
19859 if (style->draw_begin) style->draw_begin(out, style->userdata);
19860 nk_draw_button_text(out, &bounds, &content, *state, style, string, len, align, font);
19861 if (style->draw_end) style->draw_end(out, style->userdata);
19867 nk_flags state, const struct nk_style_button *style,
19874 background = nk_draw_button(out, bounds, state, style);
19877 else bg = style->text_background;
19880 sym = style->text_hover;
19882 sym = style->text_active;
19883 else sym = style->text_normal;
19890 const struct nk_style_button *style, const struct nk_input *in,
19897 NK_ASSERT(style);
19900 if (!out || !style || !font || !state)
19903 ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
19904 if (style->draw_begin) style->draw_begin(out, style->userdata);
19905 nk_draw_button_symbol(out, &bounds, &content, *state, style, symbol, font);
19906 if (style->draw_end) style->draw_end(out, style->userdata);
19912 nk_flags state, const struct nk_style_button *style, const struct nk_image *img)
19914 nk_draw_button(out, bounds, state, style);
19921 const struct nk_style_button *style, const struct nk_input *in)
19927 NK_ASSERT(style);
19929 if (!out || !style || !state)
19932 ret = nk_do_button(state, out, bounds, style, in, b, &content);
19933 content.x += style->image_padding.x;
19934 content.y += style->image_padding.y;
19935 content.w -= 2 * style->image_padding.x;
19936 content.h -= 2 * style->image_padding.y;
19938 if (style->draw_begin) style->draw_begin(out, style->userdata);
19939 nk_draw_button_image(out, &bounds, &content, *state, style, &img);
19940 if (style->draw_end) style->draw_end(out, style->userdata);
19946 const struct nk_rect *symbol, nk_flags state, const struct nk_style_button *style,
19955 background = nk_draw_button(out, bounds, state, style);
19958 else text.background = style->text_background;
19962 sym = style->text_hover;
19963 text.text = style->text_hover;
19965 sym = style->text_active;
19966 text.text = style->text_active;
19968 sym = style->text_normal;
19969 text.text = style->text_normal;
19973 nk_draw_symbol(out, type, *symbol, style->text_background, sym, 0, font);
19980 enum nk_button_behavior behavior, const struct nk_style_button *style,
19987 NK_ASSERT(style);
19990 if (!out || !style || !font)
19993 ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
19997 tri.x = (content.x + content.w) - (2 * style->padding.x + tri.w);
19999 } else tri.x = content.x + 2 * style->padding.x;
20002 if (style->draw_begin) style->draw_begin(out, style->userdata);
20004 *state, style, str, len, symbol, font);
20005 if (style->draw_end) style->draw_end(out, style->userdata);
20011 const struct nk_rect *image, nk_flags state, const struct nk_style_button *style,
20017 background = nk_draw_button(out, bounds, state, style);
20022 else text.background = style->text_background;
20024 text.text = style->text_hover;
20026 text.text = style->text_active;
20027 else text.text = style->text_normal;
20037 enum nk_button_behavior behavior, const struct nk_style_button *style,
20044 NK_ASSERT(style);
20048 if (!out || !font || !style || !str)
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;
20059 icon.x += style->image_padding.x;
20060 icon.y += style->image_padding.y;
20061 icon.w -= 2 * style->image_padding.x;
20062 icon.h -= 2 * style->image_padding.y;
20064 if (style->draw_begin) style->draw_begin(out, style->userdata);
20065 nk_draw_button_text_image(out, &bounds, &content, &icon, *state, style, str, len, font, &img);
20066 if (style->draw_end) style->draw_end(out, style->userdata);
20116 const struct nk_style_button *style, const char *title, int len)
20126 NK_ASSERT(style);
20129 if (!style || !ctx || !ctx->current || !ctx->current->layout) return 0;
20138 title, len, style->text_alignment, ctx->button_behavior,
20139 style, in, ctx->style.font);
20146 return nk_button_text_styled(ctx, &ctx->style.button, title, len);
20149 const struct nk_style_button *style, const char *title)
20151 return nk_button_text_styled(ctx, style, title, nk_strlen(title));
20183 button = ctx->style.button;
20194 const struct nk_style_button *style, enum nk_symbol_type symbol)
20215 symbol, ctx->button_behavior, style, in, ctx->style.font);
20222 return nk_button_symbol_styled(ctx, &ctx->style.button, symbol);
20225 nk_button_image_styled(struct nk_context *ctx, const struct nk_style_button *style,
20248 img, ctx->button_behavior, style, in);
20255 return nk_button_image_styled(ctx, &ctx->style.button, img);
20259 const struct nk_style_button *style, enum nk_symbol_type symbol,
20283 style, ctx->style.font, in);
20291 return nk_button_symbol_text_styled(ctx, &ctx->style.button, symbol, text, len, align);
20299 const struct nk_style_button *style, enum nk_symbol_type symbol,
20302 return nk_button_symbol_text_styled(ctx, style, symbol, title, nk_strlen(title), align);
20306 const struct nk_style_button *style, struct nk_image img, const char *text,
20330 style, ctx->style.font, in);
20336 return nk_button_image_text_styled(ctx, &ctx->style.button,img, text, len, align);
20344 const struct nk_style_button *style, struct nk_image img,
20347 return nk_button_image_text_styled(ctx, style, img, label, nk_strlen(label), text_alignment);
20376 nk_flags state, const struct nk_style_toggle *style, int active,
20387 background = &style->hover;
20388 cursor = &style->cursor_hover;
20389 text.text = style->text_hover;
20391 background = &style->hover;
20392 cursor = &style->cursor_hover;
20393 text.text = style->text_active;
20395 background = &style->normal;
20396 cursor = &style->cursor_normal;
20397 text.text = style->text_normal;
20402 nk_fill_rect(out, *selector, 0, style->border_color);
20403 nk_fill_rect(out, nk_shrink_rect(*selector, style->border), 0, background->data.color);
20413 text.background = style->text_background;
20418 nk_flags state, const struct nk_style_toggle *style, int active,
20429 background = &style->hover;
20430 cursor = &style->cursor_hover;
20431 text.text = style->text_hover;
20433 background = &style->hover;
20434 cursor = &style->cursor_hover;
20435 text.text = style->text_active;
20437 background = &style->normal;
20438 cursor = &style->cursor_normal;
20439 text.text = style->text_normal;
20444 nk_fill_circle(out, *selector, style->border_color);
20445 nk_fill_circle(out, nk_shrink_rect(*selector, style->border), background->data.color);
20455 text.background = style->text_background;
20462 const struct nk_style_toggle *style, const struct nk_input *in,
20471 NK_ASSERT(style);
20474 if (!out || !style || !font || !active)
20477 r.w = NK_MAX(r.w, font->height + 2 * style->padding.x);
20478 r.h = NK_MAX(r.h, font->height + 2 * style->padding.y);
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;
20493 cursor.x = select.x + style->padding.x + style->border;
20494 cursor.y = select.y + style->padding.y + style->border;
20495 cursor.w = select.w - (2 * style->padding.x + 2 * style->border);
20496 cursor.h = select.h - (2 * style->padding.y + 2 * style->border);
20499 label.x = select.x + select.w + style->spacing;
20509 if (style->draw_begin)
20510 style->draw_begin(out, style->userdata);
20512 nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font);
20514 nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font);
20516 if (style->draw_end)
20517 style->draw_end(out, style->userdata);
20531 const struct nk_style *style;
20543 style = &ctx->style;
20550 text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font);
20626 const struct nk_style *style;
20638 style = &ctx->style;
20645 text, len, NK_TOGGLE_OPTION, &style->option, in, style->font);
20682 nk_flags state, const struct nk_style_selectable *style, int active,
20689 text.padding = style->padding;
20694 background = &style->pressed;
20695 text.text = style->text_pressed;
20697 background = &style->hover;
20698 text.text = style->text_hover;
20700 background = &style->normal;
20701 text.text = style->text_normal;
20705 background = &style->pressed_active;
20706 text.text = style->text_pressed_active;
20708 background = &style->hover_active;
20709 text.text = style->text_hover_active;
20711 background = &style->normal_active;
20712 text.text = style->text_normal_active;
20720 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
20732 const struct nk_style_selectable *style, const struct nk_input *in,
20743 NK_ASSERT(style);
20746 if (!state || !out || !str || !len || !value || !style || !font) return 0;
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;
20760 if (style->draw_begin) style->draw_begin(out, style->userdata);
20761 nk_draw_selectable(out, *state, style, *value, &bounds, 0,0,NK_SYMBOL_NONE, str, len, align, font);
20762 if (style->draw_end) style->draw_end(out, style->userdata);
20768 const struct nk_image *img, const struct nk_style_selectable *style,
20780 NK_ASSERT(style);
20783 if (!state || !out || !str || !len || !value || !style || !font) return 0;
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;
20801 icon.x += style->image_padding.x;
20802 icon.y += style->image_padding.y;
20803 icon.w -= 2 * style->image_padding.x;
20804 icon.h -= 2 * style->image_padding.y;
20807 if (style->draw_begin) style->draw_begin(out, style->userdata);
20808 nk_draw_selectable(out, *state, style, *value, &bounds, &icon, img, NK_SYMBOL_NONE, str, len, align, font);
20809 if (style->draw_end) style->draw_end(out, style->userdata);
20815 enum nk_symbol_type sym, const struct nk_style_selectable *style,
20827 NK_ASSERT(style);
20830 if (!state || !out || !str || !len || !value || !style || !font) return 0;
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;
20848 icon.x += style->image_padding.x;
20849 icon.y += style->image_padding.y;
20850 icon.w -= 2 * style->image_padding.x;
20851 icon.h -= 2 * style->image_padding.y;
20854 if (style->draw_begin) style->draw_begin(out, style->userdata);
20855 nk_draw_selectable(out, *state, style, *value, &bounds, &icon, 0, sym, str, len, align, font);
20856 if (style->draw_end) style->draw_end(out, style->userdata);
20867 const struct nk_style *style;
20881 style = &ctx->style;
20887 str, len, align, value, &style->selectable, in, style->font);
20896 const struct nk_style *style;
20910 style = &ctx->style;
20916 str, len, align, value, &img, &style->selectable, in, style->font);
20925 const struct nk_style *style;
20939 style = &ctx->style;
20945 str, len, align, value, sym, &style->selectable, in, style->font);
21047 const struct nk_style_slider *style, const struct nk_rect *bounds,
21063 background = &style->active;
21064 bar_color = style->bar_active;
21065 cursor = &style->cursor_active;
21067 background = &style->hover;
21068 bar_color = style->bar_hover;
21069 cursor = &style->cursor_hover;
21071 background = &style->normal;
21072 bar_color = style->bar_normal;
21073 cursor = &style->cursor_normal;
21081 /* filled background bar style */
21091 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
21092 nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
21096 nk_fill_rect(out, bar, style->rounding, bar_color);
21097 nk_fill_rect(out, fill, style->rounding, style->bar_filled);
21108 const struct nk_style_slider *style, struct nk_input *in,
21121 NK_ASSERT(style);
21123 if (!out || !style)
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;
21135 if (style->show_buttons) {
21144 if (nk_do_button_symbol(&ws, out, button, style->dec_symbol, NK_BUTTON_DEFAULT,
21145 &style->dec_button, in, font))
21150 if (nk_do_button_symbol(&ws, out, button, style->inc_symbol, NK_BUTTON_DEFAULT,
21151 &style->inc_button, in, font))
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;
21178 visual_cursor.h = style->cursor_size.y;
21179 visual_cursor.w = style->cursor_size.x;
21188 if (style->draw_begin) style->draw_begin(out, style->userdata);
21189 nk_draw_slider(out, *state, style, &bounds, &visual_cursor, slider_min, slider_value, slider_max);
21190 if (style->draw_end) style->draw_end(out, style->userdata);
21200 const struct nk_style *style;
21215 style = &ctx->style;
21224 old_value, max_value, value_step, &style->slider, in, style->font);
21290 const struct nk_style_progress *style, const struct nk_rect *bounds,
21301 background = &style->active;
21302 cursor = &style->cursor_active;
21304 background = &style->hover;
21305 cursor = &style->cursor_hover;
21307 background = &style->normal;
21308 cursor = &style->cursor_normal;
21313 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
21314 nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
21319 nk_fill_rect(out, *scursor, style->rounding, cursor->data.color);
21320 nk_stroke_rect(out, *scursor, style->rounding, style->border, style->border_color);
21327 const struct nk_style_progress *style, struct nk_input *in)
21333 NK_ASSERT(style);
21335 if (!out || !style) return 0;
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));
21349 if (style->draw_begin) style->draw_begin(out, style->userdata);
21350 nk_draw_progress(out, *state, style, &bounds, &cursor, value, max);
21351 if (style->draw_end) style->draw_end(out, style->userdata);
21359 const struct nk_style *style;
21374 style = &ctx->style;
21382 *cur, max, is_modifyable, &style->progress, in);
21479 const struct nk_style_scrollbar *style, const struct nk_rect *bounds,
21487 background = &style->active;
21488 cursor = &style->cursor_active;
21490 background = &style->hover;
21491 cursor = &style->cursor_hover;
21493 background = &style->normal;
21494 cursor = &style->cursor_normal;
21499 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
21500 nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
21507 nk_fill_rect(out, *scroll, style->rounding_cursor, cursor->data.color);
21508 nk_stroke_rect(out, *scroll, style->rounding_cursor, style->border_cursor, style->cursor_border_color);
21515 const struct nk_style_scrollbar *style, struct nk_input *in,
21528 NK_ASSERT(style);
21530 if (!out || !style) return 0;
21537 if (style->show_buttons) {
21551 if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
21552 NK_BUTTON_REPEATER, &style->dec_button, in, font))
21557 if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
21558 NK_BUTTON_REPEATER, &style->inc_button, in, font))
21572 cursor.h = NK_MAX((scroll_ratio * scroll.h) - (2*style->border + 2*style->padding.y), 0);
21573 cursor.y = scroll.y + (scroll_off * scroll.h) + style->border + style->padding.y;
21574 cursor.w = scroll.w - (2 * style->border + 2 * style->padding.x);
21575 cursor.x = scroll.x + style->border + style->padding.x;
21592 cursor.y = scroll.y + (scroll_off * scroll.h) + style->border_cursor + style->padding.y;
21595 if (style->draw_begin) style->draw_begin(out, style->userdata);
21596 nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
21597 if (style->draw_end) style->draw_end(out, style->userdata);
21604 const struct nk_style_scrollbar *style, struct nk_input *in,
21617 NK_ASSERT(style);
21618 if (!out || !style) return 0;
21626 if (style->show_buttons) {
21639 if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
21640 NK_BUTTON_REPEATER, &style->dec_button, in, font))
21645 if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
21646 NK_BUTTON_REPEATER, &style->inc_button, in, font))
21660 cursor.w = (scroll_ratio * scroll.w) - (2*style->border + 2*style->padding.x);
21661 cursor.x = scroll.x + (scroll_off * scroll.w) + style->border + style->padding.x;
21662 cursor.h = scroll.h - (2 * style->border + 2 * style->padding.y);
21663 cursor.y = scroll.y + style->border + style->padding.y;
21683 if (style->draw_begin) style->draw_begin(out, style->userdata);
21684 nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
21685 if (style->draw_end) style->draw_end(out, style->userdata);
22792 const struct nk_style_edit *style, float pos_x, float pos_y,
22799 NK_ASSERT(style);
22800 if (!text || !byte_len || !out || !style) return;
22873 struct nk_text_edit *edit, const struct nk_style_edit *style,
22888 NK_ASSERT(style);
22889 if (!state || !out || !style)
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);
22898 area.w = NK_MAX(0, area.w - style->scrollbar_size.x);
22899 row_height = (flags & NK_EDIT_MULTILINE)? font->height + style->row_padding: area.h;
23042 background = &style->active;
23044 background = &style->hover;
23045 else background = &style->normal;
23049 nk_stroke_rect(out, bounds, style->rounding, style->border, style->border_color);
23050 nk_fill_rect(out, bounds, style->rounding, background->data.color);
23053 area.w = NK_MAX(0, area.w - style->cursor_size);
23206 scroll.x = (bounds.x + bounds.w - style->border) - style->scrollbar_size.x;
23207 scroll.w = style->scrollbar_size.x;
23215 &style->scrollbar, in, font);
23231 background = &style->active;
23232 text_color = style->text_active;
23233 sel_text_color = style->selected_text_hover;
23234 sel_background_color = style->selected_hover;
23235 cursor_color = style->cursor_hover;
23236 cursor_text_color = style->cursor_text_hover;
23238 background = &style->hover;
23239 text_color = style->text_hover;
23240 sel_text_color = style->selected_text_hover;
23241 sel_background_color = style->selected_hover;
23242 cursor_text_color = style->cursor_text_hover;
23243 cursor_color = style->cursor_hover;
23245 background = &style->normal;
23246 text_color = style->text_normal;
23247 sel_text_color = style->selected_text_normal;
23248 sel_background_color = style->selected_normal;
23249 cursor_color = style->cursor_normal;
23250 cursor_text_color = style->cursor_text_normal;
23261 nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
23270 nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
23281 nk_edit_draw_text(out, style,
23296 nk_edit_draw_text(out, style,
23312 cursor.w = style->cursor_size;
23350 background = &style->active;
23351 text_color = style->text_active;
23353 background = &style->hover;
23354 text_color = style->text_hover;
23356 background = &style->normal;
23357 text_color = style->text_normal;
23362 nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
23459 struct nk_style *style;
23478 style = &ctx->style;
23502 filter, edit, &style->edit, in, style->font);
23505 ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_TEXT];
23594 nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property *style,
23603 background = &style->active;
23604 text.text = style->label_active;
23606 background = &style->hover;
23607 text.text = style->label_hover;
23609 background = &style->normal;
23610 text.text = style->label_normal;
23619 nk_fill_rect(out, *bounds, style->rounding, background->data.color);
23620 nk_stroke_rect(out, *bounds, style->rounding, style->border, background->data.color);
23633 const struct nk_style_property *style,
23659 left.x = property.x + style->border + style->padding.x;
23660 left.y = property.y + style->border + property.h/2.0f - left.h/2;
23665 label.x = left.x + left.w + style->padding.x;
23666 label.w = (float)size + 2 * style->padding.x;
23667 label.y = property.y + style->border + style->padding.y;
23668 label.h = property.h - (2 * style->border + 2 * style->padding.y);
23674 right.x = property.x + property.w - (right.w + style->padding.x);
23679 size += style->edit.cursor_size;
23703 edit.w = (float)size + 2 * style->padding.x;
23705 edit.x = right.x - (edit.w + style->padding.x);
23706 edit.y = property.y + style->border;
23707 edit.h = property.h - (2 * style->border);
23720 if (style->draw_begin) style->draw_begin(out, style->userdata);
23721 nk_draw_property(out, style, &property, &label, *ws, name, name_len, font);
23722 if (style->draw_end) style->draw_end(out, style->userdata);
23725 if (nk_do_button_symbol(ws, out, left, style->sym_left, behavior, &style->dec_button, in, font)) {
23737 if (nk_do_button_symbol(ws, out, right, style->sym_right, behavior, &style->inc_button, in, font)) {
23771 filters[filter], text_edit, &style->edit, (*state == NK_PROPERTY_EDIT) ? in: 0, font);
23844 const struct nk_style *style;
23873 style = &ctx->style;
23907 select_end, &style->property, filter, in, style->font, &ctx->text_edit,
24039 const struct nk_style_chart *style;
24056 config = &ctx->style;
24058 style = &config->chart;
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;
24066 chart->w = NK_MAX(chart->w, 2 * style->padding.x);
24067 chart->h = NK_MAX(chart->h, 2 * style->padding.y);
24080 background = &style->background;
24084 nk_fill_rect(&win->buffer, bounds, style->rounding, style->border_color);
24085 nk_fill_rect(&win->buffer, nk_shrink_rect(bounds, style->border),
24086 style->rounding, style->background.data.color);
24094 return nk_chart_begin_colored(ctx, type, ctx->style.chart.color,
24095 ctx->style.chart.selected_color, count, min_value, max_value);
24124 nk_chart_add_slot_colored(ctx, type, ctx->style.chart.color,
24125 ctx->style.chart.selected_color, count, min_value, max_value);
24527 config = &ctx->style;
24571 body.y = header.y + header.h-ctx->style.window.combo_border;
24592 struct nk_style *style;
24608 style = &ctx->style;
24619 background = &style->combo.active;
24620 text.text = style->combo.label_active;
24622 background = &style->combo.hover;
24623 text.text = style->combo.label_hover;
24625 background = &style->combo.normal;
24626 text.text = style->combo.label_normal;
24633 nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
24634 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
24644 sym = style->combo.sym_hover;
24646 sym = style->combo.sym_active;
24647 else sym = style->combo.sym_normal;
24650 button.w = header.h - 2 * style->combo.button_padding.y;
24651 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
24652 button.y = header.y + style->combo.button_padding.y;
24655 content.x = button.x + style->combo.button.padding.x;
24656 content.y = button.y + style->combo.button.padding.y;
24657 content.w = button.w - 2 * style->combo.button.padding.x;
24658 content.h = button.h - 2 * style->combo.button.padding.y;
24662 label.x = header.x + style->combo.content_padding.x;
24663 label.y = header.y + style->combo.content_padding.y;
24664 label.w = button.x - (style->combo.content_padding.x + style->combo.spacing.x) - label.x;;
24665 label.h = header.h - 2 * style->combo.content_padding.y;
24667 NK_TEXT_LEFT, ctx->style.font);
24671 &ctx->style.combo.button, sym, style->font);
24684 struct nk_style *style;
24699 style = &ctx->style;
24710 background = &style->combo.active;
24712 background = &style->combo.hover;
24713 else background = &style->combo.normal;
24718 nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
24719 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
24728 sym = style->combo.sym_hover;
24730 sym = style->combo.sym_active;
24731 else sym = style->combo.sym_normal;
24734 button.w = header.h - 2 * style->combo.button_padding.y;
24735 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
24736 button.y = header.y + style->combo.button_padding.y;
24739 content.x = button.x + style->combo.button.padding.x;
24740 content.y = button.y + style->combo.button.padding.y;
24741 content.w = button.w - 2 * style->combo.button.padding.x;
24742 content.h = button.h - 2 * style->combo.button.padding.y;
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;
24753 &ctx->style.combo.button, sym, style->font);
24761 struct nk_style *style;
24778 style = &ctx->style;
24789 background = &style->combo.active;
24790 symbol_color = style->combo.symbol_active;
24792 background = &style->combo.hover;
24793 symbol_color = style->combo.symbol_hover;
24795 background = &style->combo.normal;
24796 symbol_color = style->combo.symbol_hover;
24804 nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
24805 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
24814 sym = style->combo.sym_hover;
24816 sym = style->combo.sym_active;
24817 else sym = style->combo.sym_normal;
24820 button.w = header.h - 2 * style->combo.button_padding.y;
24821 button.x = (header.x + header.w - header.h) - style->combo.button_padding.y;
24822 button.y = header.y + style->combo.button_padding.y;
24825 content.x = button.x + style->combo.button.padding.x;
24826 content.y = button.y + style->combo.button.padding.y;
24827 content.w = button.w - 2 * style->combo.button.padding.x;
24828 content.h = button.h - 2 * style->combo.button.padding.y;
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;
24836 1.0f, style->font);
24840 &ctx->style.combo.button, sym, style->font);
24849 struct nk_style *style;
24866 style = &ctx->style;
24876 background = &style->combo.active;
24877 symbol_color = style->combo.symbol_active;
24878 text.text = style->combo.label_active;
24880 background = &style->combo.hover;
24881 symbol_color = style->combo.symbol_hover;
24882 text.text = style->combo.label_hover;
24884 background = &style->combo.normal;
24885 symbol_color = style->combo.symbol_normal;
24886 text.text = style->combo.label_normal;
24893 nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
24894 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
24904 sym = style->combo.sym_hover;
24906 sym = style->combo.sym_active;
24907 else sym = style->combo.sym_normal;
24910 button.w = header.h - 2 * style->combo.button_padding.y;
24911 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
24912 button.y = header.y + style->combo.button_padding.y;
24915 content.x = button.x + style->combo.button.padding.x;
24916 content.y = button.y + style->combo.button.padding.y;
24917 content.w = button.w - 2 * style->combo.button.padding.x;
24918 content.h = button.h - 2 * style->combo.button.padding.y;
24920 &ctx->style.combo.button, sym, style->font);
24923 image.x = header.x + style->combo.content_padding.x;
24924 image.y = header.y + style->combo.content_padding.y;
24925 image.h = header.h - 2 * style->combo.content_padding.y;
24928 1.0f, style->font);
24932 label.x = image.x + image.w + style->combo.spacing.x + style->combo.content_padding.x;
24933 label.y = header.y + style->combo.content_padding.y;
24934 label.w = (button.x - style->combo.content_padding.x) - label.x;
24935 label.h = header.h - 2 * style->combo.content_padding.y;
24936 nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
24944 struct nk_style *style;
24959 style = &ctx->style;
24970 background = &style->combo.active;
24972 background = &style->combo.hover;
24973 else background = &style->combo.normal;
24978 nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
24979 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
24988 sym = style->combo.sym_hover;
24990 sym = style->combo.sym_active;
24991 else sym = style->combo.sym_normal;
24994 button.w = header.h - 2 * style->combo.button_padding.y;
24995 button.x = (header.x + header.w - header.h) - style->combo.button_padding.y;
24996 button.y = header.y + style->combo.button_padding.y;
24999 content.x = button.x + style->combo.button.padding.x;
25000 content.y = button.y + style->combo.button.padding.y;
25001 content.w = button.w - 2 * style->combo.button.padding.x;
25002 content.h = button.h - 2 * style->combo.button.padding.y;
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;
25013 &ctx->style.combo.button, sym, style->font);
25022 struct nk_style *style;
25038 style = &ctx->style;
25048 background = &style->combo.active;
25049 text.text = style->combo.label_active;
25051 background = &style->combo.hover;
25052 text.text = style->combo.label_hover;
25054 background = &style->combo.normal;
25055 text.text = style->combo.label_normal;
25062 nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
25063 nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
25073 sym = style->combo.sym_hover;
25075 sym = style->combo.sym_active;
25076 else sym = style->combo.sym_normal;
25079 button.w = header.h - 2 * style->combo.button_padding.y;
25080 button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
25081 button.y = header.y + style->combo.button_padding.y;
25084 content.x = button.x + style->combo.button.padding.x;
25085 content.y = button.y + style->combo.button.padding.y;
25086 content.w = button.w - 2 * style->combo.button.padding.x;
25087 content.h = button.h - 2 * style->combo.button.padding.y;
25089 &ctx->style.combo.button, sym, style->font);
25092 image.x = header.x + style->combo.content_padding.x;
25093 image.y = header.y + style->combo.content_padding.y;
25094 image.h = header.h - 2 * style->combo.content_padding.y;
25100 label.x = image.x + image.w + style->combo.spacing.x + style->combo.content_padding.x;
25101 label.y = header.y + style->combo.content_padding.y;
25102 label.w = (button.x - style->combo.content_padding.x) - label.x;
25103 label.h = header.h - 2 * style->combo.content_padding.y;
25104 nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
25177 item_spacing = ctx->style.window.spacing;
25178 window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
25210 item_spacing = ctx->style.window.spacing;
25211 window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
25263 item_spacing = ctx->style.window.spacing;
25264 window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
25368 const struct nk_style *style;
25383 style = &ctx->style;
25384 padding = style->window.padding;
25388 text_width = style->font->width(style->font->userdata,
25389 style->font->height, text, text_len);
25391 text_height = (style->font->height + 2 * padding.y);
25495 /// - 2018/01/07 (3.00.1) - Started to change documentation style.
25573 /// pass in a style struct to change buttons visual.
25672 /// - 2016/08/26 (1.10.0) - Added stacks for temporary style/UI changes in code.
25730 /// - 2016/08/03 (1.04.0) - Added additional window padding style attributes for