# HG changeset patch # User Michael Pavone # Date 1553753082 25200 # Node ID af14c21939f6b4ad5b652f7691689098796b02c2 # Parent 73a9d06413bcf14a3b9a043aeb49b916c0418920 Add unit to gain label and change color of checkbox selected state to hopefully make it more clear diff -r 73a9d06413bc -r af14c21939f6 nuklear_ui/blastem_nuklear.c --- a/nuklear_ui/blastem_nuklear.c Wed Mar 27 22:23:55 2019 -0700 +++ b/nuklear_ui/blastem_nuklear.c Wed Mar 27 23:04:42 2019 -0700 @@ -1715,7 +1715,7 @@ selected_rate = settings_dropdown(context, "Rate in Hz", rates, num_rates, selected_rate, "audio\0rate\0"); selected_size = settings_dropdown(context, "Buffer Samples", sizes, num_sizes, selected_size, "audio\0buffer\0"); settings_int_input(context, "Lowpass Cutoff Hz", "audio\0lowpass_cutoff\0", "3390"); - settings_float_property(context, "Gain", "Overall", "audio\0gain\0", 0, -30.0f, 30.0f, 0.5f); + settings_float_property(context, "Gain (dB)", "Overall", "audio\0gain\0", 0, -30.0f, 30.0f, 0.5f); settings_float_property(context, "", "FM", "audio\0fm_gain\0", 0, -30.0f, 30.0f, 0.5f); settings_float_property(context, "", "PSG", "audio\0psg_gain\0", 0, -30.0f, 30.0f, 0.5f); selected_dac = settings_dropdown_ex(context, "FM DAC", dac, dac_desc, num_dacs, selected_dac, "audio\0fm_dac\0"); @@ -1968,12 +1968,22 @@ } } +static void style_init(void) +{ + context->style.checkbox.padding.x = render_height() / 120; + context->style.checkbox.padding.y = render_height() / 120; + context->style.checkbox.border = render_height() / 240; + context->style.checkbox.cursor_normal.type = NK_STYLE_ITEM_COLOR; + context->style.checkbox.cursor_normal.data.color = (struct nk_color){ + .r = 255, .g = 128, .b = 0, .a = 255 + }; + context->style.checkbox.cursor_hover = context->style.checkbox.cursor_normal; +} + static void context_created(void) { context = nk_sdl_init(render_get_window()); - context->style.checkbox.padding.x = render_height() / 120; - context->style.checkbox.padding.y = render_height() / 120; - context->style.checkbox.border = render_height() / 240; + style_init(); texture_init(); } @@ -2053,9 +2063,7 @@ void blastem_nuklear_init(uint8_t file_loaded) { context = nk_sdl_init(render_get_window()); - context->style.checkbox.padding.x = render_height() / 120; - context->style.checkbox.padding.y = render_height() / 120; - context->style.checkbox.border = render_height() / 240; + style_init(); controller_360 = load_ui_image("images/360.png"); controller_ps4 = load_ui_image("images/ps4.png");