diff --git a/demo/overview.c b/demo/overview.c index 5d8dadc..5d1f335 100644 --- a/demo/overview.c +++ b/demo/overview.c @@ -16,6 +16,11 @@ overview(struct nk_context *ctx) static enum nk_style_header_align header_align = NK_HEADER_RIGHT; static int show_app_about = nk_false; +#ifdef INCLUDE_STYLE + static const char* themes[] = {"Black", "White", "Red", "Blue", "Dark"}; + static int current_theme = 0; +#endif + /* window flags */ window_flags = 0; ctx->style.window.header.align = header_align; @@ -129,6 +134,18 @@ overview(struct nk_context *ctx) } else show_app_about = nk_false; } +#ifdef INCLUDE_STYLE + /* style selector */ + nk_layout_row_static(ctx, 25, 200, 1); + { + int new_theme = nk_combo(ctx, themes, NK_LEN(themes), current_theme, 25, nk_vec2(200, 200)); + if (new_theme != current_theme) { + current_theme = new_theme; + set_style(ctx, current_theme); + } + } +#endif + /* window flags */ if (nk_tree_push(ctx, NK_TREE_TAB, "Window", NK_MINIMIZED)) { nk_layout_row_dynamic(ctx, 30, 2); diff --git a/demo/xcb_cairo/main.c b/demo/xcb_cairo/main.c index 03e6631..cdedd57 100644 --- a/demo/xcb_cairo/main.c +++ b/demo/xcb_cairo/main.c @@ -86,6 +86,8 @@ main(void) nk_init_default(ctx, font); #ifdef INCLUDE_STYLE + set_style(ctx, THEME_BLACK); + /*nk_style_push_float(ctx, &ctx->style.window.rounding, 20.0f);*/ /*set_style(ctx, THEME_WHITE);*/ /*set_style(ctx, THEME_RED);*/ /*set_style(ctx, THEME_BLUE);*/