# HG changeset patch # User Michael Pavone # Date 1525231171 25200 # Node ID f66290afae655e230b4f53eae6afc39880ecf913 # Parent aaa28c9bf67dc369f4944ff2c02007dc4e79f6de Add some basic scaling to rest of UI diff -r aaa28c9bf67d -r f66290afae65 nuklear_ui/blastem_nuklear.c --- a/nuklear_ui/blastem_nuklear.c Tue May 01 19:27:17 2018 -0700 +++ b/nuklear_ui/blastem_nuklear.c Tue May 01 20:19:31 2018 -0700 @@ -77,10 +77,10 @@ uint32_t width = render_width(); uint32_t height = render_height(); if (nk_begin(context, "Load ROM", nk_rect(0, 0, width, height), 0)) { - nk_layout_row_static(context, height - 100, width - 60, 1); + nk_layout_row_static(context, height - context->style.font->height * 3, width - 60, 1); int32_t old_selected = selected_entry; if (nk_group_begin(context, "Select ROM", NK_WINDOW_BORDER | NK_WINDOW_TITLE)) { - nk_layout_row_static(context, 28, width-100, 1); + nk_layout_row_static(context, context->style.font->height - 2, width-100, 1); for (int32_t i = 0; i < num_entries; i++) { if (entries[i].name[0] == '.' && entries[i].name[1] != '.') { @@ -99,7 +99,7 @@ } nk_group_end(context); } - nk_layout_row_static(context, 52, width > 600 ? 300 : width / 2, 2); + nk_layout_row_static(context, context->style.font->height * 1.75, width > 600 ? 300 : width / 2, 2); if (nk_button_label(context, "Back")) { pop_view(); } @@ -174,21 +174,21 @@ uint32_t width = render_width(); uint32_t height = render_height(); if (nk_begin(context, "About", nk_rect(0, 0, width, height), 0)) { - nk_layout_row_static(context, 30, width-40, 1); + nk_layout_row_static(context, context->style.font->height, width-40, 1); for (uint32_t i = 0; i < NUM_LINES; i++) { nk_label(context, lines[i], NK_TEXT_LEFT); } - nk_layout_row_static(context, height - 80 - 34*NUM_LINES, width-40, 1); + nk_layout_row_static(context, height - (context->style.font->height * 2 + 20) - (context->style.font->height +4)*NUM_LINES, width-40, 1); if (nk_group_begin(context, "Special Thanks", NK_WINDOW_TITLE)) { - nk_layout_row_static(context, 30, width - 80, 1); + nk_layout_row_static(context, context->style.font->height, width - 80, 1); for (uint32_t i = 0; i < NUM_THANKS; i++) { nk_label(context, thanks[i], NK_TEXT_LEFT); } nk_group_end(context); } - nk_layout_row_static(context, 52, width/3, 1); + nk_layout_row_static(context, context->style.font->height * 1.75, width/3, 1); if (nk_button_label(context, "Back")) { pop_view(); } @@ -209,9 +209,9 @@ uint32_t width = render_width(); uint32_t height = render_height(); if (nk_begin(context, "Slot Picker", nk_rect(0, 0, width, height), 0)) { - nk_layout_row_static(context, height - 100, width - 60, 1); + nk_layout_row_static(context, height - context->style.font->height * 3, width - 60, 1); if (nk_group_begin(context, "Select Save Slot", NK_WINDOW_BORDER | NK_WINDOW_TITLE)) { - nk_layout_row_static(context, 28, width-100, 1); + nk_layout_row_static(context, context->style.font->height - 2, width-100, 1); if (!slots) { slots = get_slot_info(current_system, &num_slots); } @@ -225,7 +225,7 @@ } nk_group_end(context); } - nk_layout_row_static(context, 52, width > 600 ? 300 : width / 2, 2); + nk_layout_row_static(context, context->style.font->height * 1.75, width > 600 ? 300 : width / 2, 2); if (nk_button_label(context, "Back")) { pop_view(); }