From 5314fc0b004ba65c7decd96707ee58209d840842 Mon Sep 17 00:00:00 2001 From: dankan1890 Date: Sun, 20 Mar 2016 15:48:15 +0100 Subject: [PATCH] Proper drawing of the panels arrows for vertical orientation. (nw) --- src/emu/ui/auditmenu.cpp | 10 +++-- src/emu/ui/auditmenu.h | 10 +++-- src/emu/ui/cmdrender.h | 21 +++++---- src/emu/ui/ctrlmenu.cpp | 4 +- src/emu/ui/custmenu.cpp | 20 +++++---- src/emu/ui/datmenu.cpp | 33 +++++++------- src/emu/ui/menu.cpp | 39 +++++------------ src/emu/ui/selgame.cpp | 94 +++++++--------------------------------- src/emu/ui/selsoft.cpp | 24 +++++----- 9 files changed, 94 insertions(+), 161 deletions(-) diff --git a/src/emu/ui/auditmenu.cpp b/src/emu/ui/auditmenu.cpp index a4d7de4779b..5d6ce8fa8d1 100644 --- a/src/emu/ui/auditmenu.cpp +++ b/src/emu/ui/auditmenu.cpp @@ -84,8 +84,12 @@ bool sorted_game_list(const game_driver *x, const game_driver *y) // ctor / dtor //------------------------------------------------- -ui_menu_audit::ui_menu_audit(running_machine &machine, render_container *container, std::vector &availablesorted, std::vector &unavailablesorted, int _audit_mode) - : ui_menu(machine, container), m_availablesorted(availablesorted), m_unavailablesorted(unavailablesorted), m_audit_mode(_audit_mode), m_first(true) +ui_menu_audit::ui_menu_audit(running_machine &machine, render_container *container, vptr_game &availablesorted, vptr_game &unavailablesorted, int _audit_mode) + : ui_menu(machine, container) + , m_availablesorted(availablesorted) + , m_unavailablesorted(unavailablesorted) + , m_audit_mode(_audit_mode) + , m_first(true) { if (m_audit_mode == 2) { @@ -115,7 +119,7 @@ void ui_menu_audit::handle() if (m_audit_mode == 1) { - std::vector::iterator iter = m_unavailablesorted.begin(); + vptr_game::iterator iter = m_unavailablesorted.begin(); while (iter != m_unavailablesorted.end()) { driver_enumerator enumerator(machine().options(), (*iter)->name); diff --git a/src/emu/ui/auditmenu.h b/src/emu/ui/auditmenu.h index ba8c5e80631..b63bbb6507b 100644 --- a/src/emu/ui/auditmenu.h +++ b/src/emu/ui/auditmenu.h @@ -16,22 +16,26 @@ //------------------------------------------------- // class audit menu //------------------------------------------------- +using vptr_game = std::vector; class ui_menu_audit : public ui_menu { public: - ui_menu_audit(running_machine &machine, render_container *container, std::vector &availablesorted, std::vector &unavailablesorted, int audit_mode); + ui_menu_audit(running_machine &machine, render_container *container, vptr_game &availablesorted, vptr_game &unavailablesorted, int audit_mode); virtual ~ui_menu_audit(); virtual void populate() override; virtual void handle() override; private: - std::vector &m_availablesorted; - std::vector &m_unavailablesorted; + vptr_game &m_availablesorted; + vptr_game &m_unavailablesorted; int m_audit_mode; void save_available_machines(); bool m_first; }; +inline int cs_stricmp(const char *s1, const char *s2); +bool sorted_game_list(const game_driver *x, const game_driver *y); + #endif /* __UI_AUDIT_H__ */ diff --git a/src/emu/ui/cmdrender.h b/src/emu/ui/cmdrender.h index b8d0eb1571b..130fed0a272 100644 --- a/src/emu/ui/cmdrender.h +++ b/src/emu/ui/cmdrender.h @@ -4,7 +4,7 @@ ui/cmdrender.h - UI rendfont. + UI command render fonts. ***************************************************************************/ @@ -14,7 +14,6 @@ void convert_command_glyph(std::string &str) { int j; - const char *s = str.c_str(); int len = str.length(); int buflen = (len + 2) * 2; char *d = global_alloc_array(char, buflen); @@ -23,16 +22,16 @@ void convert_command_glyph(std::string &str) { fix_command_t *fixcmd = nullptr; unicode_char uchar; - int ucharcount = uchar_from_utf8(&uchar, s + i, len - i); + int ucharcount = uchar_from_utf8(&uchar, str.substr(i).c_str(), len - i); if (ucharcount == -1) break; else if (ucharcount != 1) goto process_next; - else if (s[i] == '\n') + else if (str[i] == '\n') uchar = '\n'; - else if (s[i] == COMMAND_CONVERT_TEXT) + else if (str[i] == COMMAND_CONVERT_TEXT) { - if (s[i] == s[i + 1]) + if (str[i] == str[i + 1]) ++i; else { @@ -42,7 +41,7 @@ void convert_command_glyph(std::string &str) if (!fixtext->glyph_str_len) fixtext->glyph_str_len = strlen(fixtext->glyph_str); - if (strncmp(fixtext->glyph_str, s + i + 1, fixtext->glyph_str_len) == 0) + if (strncmp(fixtext->glyph_str, str.substr(i + 1).c_str(), fixtext->glyph_str_len) == 0) { uchar = fixtext->glyph_code + COMMAND_UNICODE; i += strlen(fixtext->glyph_str); @@ -51,19 +50,19 @@ void convert_command_glyph(std::string &str) } } } - else if (s[i] == COMMAND_DEFAULT_TEXT) + else if (str[i] == COMMAND_DEFAULT_TEXT) fixcmd = default_text; - else if (s[i] == COMMAND_EXPAND_TEXT) + else if (str[i] == COMMAND_EXPAND_TEXT) fixcmd = expand_text; if (fixcmd) { - if (s[i] == s[i + 1]) + if (str[i] == str[i + 1]) i++; else { for (; fixcmd->glyph_code; ++fixcmd) - if (s[i + 1] == fixcmd->glyph_char) + if (str[i + 1] == fixcmd->glyph_char) { uchar = fixcmd->glyph_code + COMMAND_UNICODE; ++i; diff --git a/src/emu/ui/ctrlmenu.cpp b/src/emu/ui/ctrlmenu.cpp index d3d743f552e..0fc7304a550 100644 --- a/src/emu/ui/ctrlmenu.cpp +++ b/src/emu/ui/ctrlmenu.cpp @@ -104,7 +104,7 @@ void ui_menu_controller_mapping::custom_render(void *selectedref, float top, flo ui_manager &mui = machine().ui(); mui.draw_text_full(container, _("Device Mapping"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); @@ -124,7 +124,7 @@ void ui_menu_controller_mapping::custom_render(void *selectedref, float top, flo // draw the text within it mui.draw_text_full(container, _("Device Mapping"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } diff --git a/src/emu/ui/custmenu.cpp b/src/emu/ui/custmenu.cpp index fb833c93c51..fad9b2d5ea0 100644 --- a/src/emu/ui/custmenu.cpp +++ b/src/emu/ui/custmenu.cpp @@ -22,10 +22,11 @@ //------------------------------------------------- // ctor / dtor //------------------------------------------------- -ui_menu_custom_filter::ui_menu_custom_filter(running_machine &machine, render_container *container, bool _single_menu) : ui_menu(machine, container) +ui_menu_custom_filter::ui_menu_custom_filter(running_machine &machine, render_container *container, bool _single_menu) + : ui_menu(machine, container) + , m_single_menu(_single_menu) + , m_added(false) { - m_single_menu = _single_menu; - m_added = false; } ui_menu_custom_filter::~ui_menu_custom_filter() @@ -208,7 +209,7 @@ void ui_menu_custom_filter::custom_render(void *selectedref, float top, float bo // get the size of the text mui.draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += (2.0f * UI_BOX_LR_BORDER) + 0.01f; float maxwidth = MAX(width, origx2 - origx1); @@ -228,7 +229,7 @@ void ui_menu_custom_filter::custom_render(void *selectedref, float top, float bo // draw the text within it mui.draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } //------------------------------------------------- @@ -266,7 +267,10 @@ void ui_menu_custom_filter::save_custom_filters() // ctor / dtor //------------------------------------------------- ui_menu_swcustom_filter::ui_menu_swcustom_filter(running_machine &machine, render_container *container, const game_driver *_driver, s_filter &_filter) : - ui_menu(machine, container), m_added(false), m_filter(_filter), m_driver(_driver) + ui_menu(machine, container) + , m_added(false) + , m_filter(_filter) + , m_driver(_driver) { } @@ -521,7 +525,7 @@ void ui_menu_swcustom_filter::custom_render(void *selectedref, float top, float // get the size of the text mui.draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += (2.0f * UI_BOX_LR_BORDER) + 0.01f; float maxwidth = MAX(width, origx2 - origx1); @@ -541,7 +545,7 @@ void ui_menu_swcustom_filter::custom_render(void *selectedref, float top, float // draw the text within it mui.draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } //------------------------------------------------- diff --git a/src/emu/ui/datmenu.cpp b/src/emu/ui/datmenu.cpp index f5808ac81eb..e26d79d236d 100644 --- a/src/emu/ui/datmenu.cpp +++ b/src/emu/ui/datmenu.cpp @@ -22,7 +22,12 @@ // ctor / dtor //------------------------------------------------- -ui_menu_dats_view::ui_menu_dats_view(running_machine &machine, render_container *container, const game_driver *driver) : ui_menu(machine, container) +ui_menu_dats_view::ui_menu_dats_view(running_machine &machine, render_container *container, const game_driver *driver) + : ui_menu(machine, container) + , m_actual(0) + , m_driver((driver == nullptr) ? &machine.system() : driver) + , m_issoft(false) + { image_interface_iterator iter(machine.root_device()); for (device_image_interface *image = iter.first(); image != nullptr; image = iter.next()) @@ -35,9 +40,6 @@ ui_menu_dats_view::ui_menu_dats_view(running_machine &machine, render_container m_parent = strensure(image->software_entry()->parentname()); } } - m_driver = (driver == nullptr) ? &machine.system() : driver; - m_actual = 0; - m_issoft = false; init_items(); } @@ -46,17 +48,18 @@ ui_menu_dats_view::ui_menu_dats_view(running_machine &machine, render_container // ctor //------------------------------------------------- -ui_menu_dats_view::ui_menu_dats_view(running_machine &machine, render_container *container, ui_software_info *swinfo, const game_driver *driver) : ui_menu(machine, container) -{ - m_list = swinfo->listname; - m_short = swinfo->shortname; - m_long = swinfo->longname; - m_parent = swinfo->parentname; - m_driver = (driver == nullptr) ? &machine.system() : driver; - m_swinfo = swinfo; - m_actual = 0; - m_issoft = true; +ui_menu_dats_view::ui_menu_dats_view(running_machine &machine, render_container *container, ui_software_info *swinfo, const game_driver *driver) + : ui_menu(machine, container) + , m_actual(0) + , m_driver((driver == nullptr) ? &machine.system() : driver) + , m_swinfo(swinfo) + , m_list(swinfo->listname) + , m_short(swinfo->shortname) + , m_long(swinfo->longname) + , m_parent(swinfo->parentname) + , m_issoft(true) +{ if (machine.datfile().has_software(m_list, m_short, m_parent)) m_items_list.emplace_back(_("Software History"), UI_HISTORY_LOAD, machine.datfile().rev_history()); if (swinfo != nullptr && !swinfo->usage.empty()) @@ -213,7 +216,7 @@ void ui_menu_dats_view::custom_render(void *selectedref, float top, float bottom // draw the text within it mui.draw_text_full(container, revision.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } //------------------------------------------------- diff --git a/src/emu/ui/menu.cpp b/src/emu/ui/menu.cpp index cee5d132eb1..2ba38b0bb41 100644 --- a/src/emu/ui/menu.cpp +++ b/src/emu/ui/menu.cpp @@ -1647,43 +1647,24 @@ void ui_menu::get_title_search(std::string &snaptext, std::string &searchstr) snaptext.assign(_(arts_info[ui_globals::curimage_view].title)); // get search path + std::string addpath; if (ui_globals::curimage_view == SNAPSHOT_VIEW) + { + emu_options moptions; searchstr = machine().options().value(arts_info[ui_globals::curimage_view].path); + addpath = moptions.value(arts_info[ui_globals::curimage_view].path); + } else + { + ui_options moptions; searchstr = machine().ui().options().value(arts_info[ui_globals::curimage_view].path); + addpath = moptions.value(arts_info[ui_globals::curimage_view].path); + } std::string tmp(searchstr); path_iterator path(tmp.c_str()); - std::string curpath, addpath; - - if (ui_globals::curimage_view != SNAPSHOT_VIEW) - { - ui_options moptions; - for (ui_options::entry *f_entry = moptions.first(); f_entry != nullptr; f_entry = f_entry->next()) - { - const char *name = f_entry->name(); - if (name && strlen(name) && !strcmp(arts_info[ui_globals::curimage_view].path, f_entry->name())) - { - addpath = f_entry->default_value(); - break; - } - } - } - else - { - emu_options moptions; - for (emu_options::entry *f_entry = moptions.first(); f_entry != nullptr; f_entry = f_entry->next()) - { - const char *name = f_entry->name(); - if (name && strlen(name) && !strcmp(arts_info[ui_globals::curimage_view].path, f_entry->name())) - { - addpath = f_entry->default_value(); - break; - } - } - } path_iterator path_iter(addpath.c_str()); - std::string c_path; + std::string c_path, curpath; // iterate over path and add path for zipped formats while (path.next(curpath)) diff --git a/src/emu/ui/selgame.cpp b/src/emu/ui/selgame.cpp index 39480dd0b79..a823635c286 100644 --- a/src/emu/ui/selgame.cpp +++ b/src/emu/ui/selgame.cpp @@ -46,70 +46,6 @@ static const char *dats_info[] = { std::vector ui_menu_select_game::m_sortedlist; int ui_menu_select_game::m_isabios = 0; -//------------------------------------------------- -// sort -//------------------------------------------------- - -inline int c_stricmp(const char *s1, const char *s2) -{ - for (;;) - { - int c1 = tolower((UINT8)*s1++); - int c2 = tolower((UINT8)*s2++); - if (c1 == 0 || c1 != c2) - return c1 - c2; - } -} - -bool sort_game_list(const game_driver *x, const game_driver *y) -{ - bool clonex = strcmp(x->parent, "0"); - bool cloney = strcmp(y->parent, "0"); - - if (!clonex && !cloney) - return (c_stricmp(x->description, y->description) < 0); - - int cx = -1, cy = -1; - if (clonex) - { - cx = driver_list::find(x->parent); - if (cx == -1 || (driver_list::driver(cx).flags & MACHINE_IS_BIOS_ROOT) != 0) - clonex = false; - } - - if (cloney) - { - cy = driver_list::find(y->parent); - if (cy == -1 || (driver_list::driver(cy).flags & MACHINE_IS_BIOS_ROOT) != 0) - cloney = false; - } - - if (!clonex && !cloney) - return (c_stricmp(x->description, y->description) < 0); - - else if (clonex && cloney) - { - if (!c_stricmp(x->parent, y->parent)) - return (c_stricmp(x->description, y->description) < 0); - else - return (c_stricmp(driver_list::driver(cx).description, driver_list::driver(cy).description) < 0); - } - else if (!clonex && cloney) - { - if (!c_stricmp(x->name, y->parent)) - return true; - else - return (c_stricmp(x->description, driver_list::driver(cy).description) < 0); - } - else - { - if (!c_stricmp(x->parent, y->name)) - return false; - else - return (c_stricmp(driver_list::driver(cx).description, y->description) < 0); - } -} - //------------------------------------------------- // ctor //------------------------------------------------- @@ -776,7 +712,7 @@ void ui_menu_select_game::build_available_list() } // sort - std::stable_sort(m_availsortedlist.begin(), m_availsortedlist.end(), sort_game_list); + std::stable_sort(m_availsortedlist.begin(), m_availsortedlist.end(), sorted_game_list); // now build the unavailable list for (int x = 0; x < m_total; ++x) @@ -784,7 +720,7 @@ void ui_menu_select_game::build_available_list() m_unavailsortedlist.push_back(&driver_list::driver(x)); // sort - std::stable_sort(m_unavailsortedlist.begin(), m_unavailsortedlist.end(), sort_game_list); + std::stable_sort(m_unavailsortedlist.begin(), m_unavailsortedlist.end(), sorted_game_list); } //------------------------------------------------- @@ -1513,7 +1449,7 @@ void ui_menu_select_game::build_category() for (auto actual : temp_filter) m_tmp.push_back(&driver_list::driver(actual)); - std::stable_sort(m_tmp.begin(), m_tmp.end(), sort_game_list); + std::stable_sort(m_tmp.begin(), m_tmp.end(), sorted_game_list); m_displaylist = m_tmp; } @@ -1697,7 +1633,7 @@ void ui_menu_select_game::init_sorted_list() // sort manufacturers - years and driver std::stable_sort(c_mnfct::ui.begin(), c_mnfct::ui.end()); std::stable_sort(c_year::ui.begin(), c_year::ui.end()); - std::stable_sort(m_sortedlist.begin(), m_sortedlist.end(), sort_game_list); + std::stable_sort(m_sortedlist.begin(), m_sortedlist.end(), sorted_game_list); } //------------------------------------------------- @@ -1925,14 +1861,15 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y x2 = x1 + 2.0f * UI_BOX_LR_BORDER; y1 = origy1; y2 = origy2; - float lr_arrow_width = 0.4f * line_height * machine().render().ui_aspect(); + float space = x2 - x1; + float lr_arrow_width = 0.4f * space * machine().render().ui_aspect(); rgb_t fgcolor = UI_TEXT_COLOR; // set left-right arrows dimension float ar_x0 = 0.5f * (x2 + x1) - 0.5f * lr_arrow_width; - float ar_y0 = 0.5f * (y2 + y1) + 0.1f * line_height; + float ar_y0 = 0.5f * (y2 + y1) + 0.1f * space; float ar_x1 = ar_x0 + lr_arrow_width; - float ar_y1 = 0.5f * (y2 + y1) + 0.9f * line_height; + float ar_y1 = 0.5f * (y2 + y1) + 0.9f * space; mui.draw_outlined_box(container, x1, y1, x2, y2, rgb_t(0xEF, 0x12, 0x47, 0x7B)); @@ -1947,14 +1884,15 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y } else { - float lr_arrow_width = 0.4f * line_height * machine().render().ui_aspect(); + float space = x2 - x1; + float lr_arrow_width = 0.4f * space * machine().render().ui_aspect(); rgb_t fgcolor = UI_TEXT_COLOR; // set left-right arrows dimension float ar_x0 = 0.5f * (x2 + x1) - 0.5f * lr_arrow_width; - float ar_y0 = 0.5f * (y2 + y1) + 0.1f * line_height; + float ar_y0 = 0.5f * (y2 + y1) + 0.1f * space; float ar_x1 = ar_x0 + lr_arrow_width; - float ar_y1 = 0.5f * (y2 + y1) + 0.9f * line_height; + float ar_y1 = 0.5f * (y2 + y1) + 0.9f * space; mui.draw_outlined_box(container, x1, y1, x2, y2, rgb_t(0xEF, 0x12, 0x47, 0x7B)); @@ -2291,17 +2229,17 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or void ui_menu_select_game::draw_right_panel(void *selectedref, float origx1, float origy1, float origx2, float origy2) { ui_manager &mui = machine().ui(); - float line_height = mui.get_line_height(); - float lr_arrow_width = 0.4f * line_height * machine().render().ui_aspect(); rgb_t fgcolor = UI_TEXT_COLOR; bool hide = (ui_globals::panels_status == HIDE_RIGHT_PANEL || ui_globals::panels_status == HIDE_BOTH); float x2 = (hide) ? origx2 : origx1 + 2.0f * UI_BOX_LR_BORDER; + float space = x2 - origx1; + float lr_arrow_width = 0.4f * space * machine().render().ui_aspect(); // set left-right arrows dimension float ar_x0 = 0.5f * (x2 + origx1) - 0.5f * lr_arrow_width; - float ar_y0 = 0.5f * (origy2 + origy1) + 0.1f * line_height; + float ar_y0 = 0.5f * (origy2 + origy1) + 0.1f * space; float ar_x1 = ar_x0 + lr_arrow_width; - float ar_y1 = 0.5f * (origy2 + origy1) + 0.9f * line_height; + float ar_y1 = 0.5f * (origy2 + origy1) + 0.9f * space; //machine().ui().draw_outlined_box(container, origx1, origy1, origx2, origy2, UI_BACKGROUND_COLOR); mui.draw_outlined_box(container, origx1, origy1, origx2, origy2, rgb_t(0xEF, 0x12, 0x47, 0x7B)); diff --git a/src/emu/ui/selsoft.cpp b/src/emu/ui/selsoft.cpp index b20a35415f0..07172c25306 100644 --- a/src/emu/ui/selsoft.cpp +++ b/src/emu/ui/selsoft.cpp @@ -1500,15 +1500,15 @@ float ui_menu_select_software::draw_left_panel(float x1, float y1, float x2, flo x2 = x1 + 2.0f * UI_BOX_LR_BORDER; y1 = origy1; y2 = origy2; - line_height = mui.get_line_height(); - float lr_arrow_width = 0.4f * line_height * machine().render().ui_aspect(); + float space = x2 - x1; + float lr_arrow_width = 0.4f * space * machine().render().ui_aspect(); rgb_t fgcolor = UI_TEXT_COLOR; // set left-right arrows dimension float ar_x0 = 0.5f * (x2 + x1) - 0.5f * lr_arrow_width; - float ar_y0 = 0.5f * (y2 + y1) + 0.1f * line_height; + float ar_y0 = 0.5f * (y2 + y1) + 0.1f * space; float ar_x1 = ar_x0 + lr_arrow_width; - float ar_y1 = 0.5f * (y2 + y1) + 0.9f * line_height; + float ar_y1 = 0.5f * (y2 + y1) + 0.9f * space; //machine().ui().draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR); mui.draw_outlined_box(container, x1, y1, x2, y2, rgb_t(0xEF, 0x12, 0x47, 0x7B)); @@ -1524,15 +1524,15 @@ float ui_menu_select_software::draw_left_panel(float x1, float y1, float x2, flo } else { - float line_height = mui.get_line_height(); - float lr_arrow_width = 0.4f * line_height * machine().render().ui_aspect(); + float space = x2 - x1; + float lr_arrow_width = 0.4f * space * machine().render().ui_aspect(); rgb_t fgcolor = UI_TEXT_COLOR; // set left-right arrows dimension float ar_x0 = 0.5f * (x2 + x1) - 0.5f * lr_arrow_width; - float ar_y0 = 0.5f * (y2 + y1) + 0.1f * line_height; + float ar_y0 = 0.5f * (y2 + y1) + 0.1f * space; float ar_x1 = ar_x0 + lr_arrow_width; - float ar_y1 = 0.5f * (y2 + y1) + 0.9f * line_height; + float ar_y1 = 0.5f * (y2 + y1) + 0.9f * space; //machine().ui().draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR); mui.draw_outlined_box(container, x1, y1, x2, y2, rgb_t(0xEF, 0x12, 0x47, 0x7B)); @@ -1885,17 +1885,17 @@ void ui_menu_select_software::arts_render(void *selectedref, float origx1, float void ui_menu_select_software::draw_right_panel(void *selectedref, float origx1, float origy1, float origx2, float origy2) { ui_manager &mui = machine().ui(); - float line_height = mui.get_line_height(); - float lr_arrow_width = 0.4f * line_height * machine().render().ui_aspect(); rgb_t fgcolor = UI_TEXT_COLOR; bool hide = (ui_globals::panels_status == HIDE_RIGHT_PANEL || ui_globals::panels_status == HIDE_BOTH); float x2 = (hide) ? origx2 : origx1 + 2.0f * UI_BOX_LR_BORDER; + float space = x2 - origx1; + float lr_arrow_width = 0.4f * space * machine().render().ui_aspect(); // set left-right arrows dimension float ar_x0 = 0.5f * (x2 + origx1) - 0.5f * lr_arrow_width; - float ar_y0 = 0.5f * (origy2 + origy1) + 0.1f * line_height; + float ar_y0 = 0.5f * (origy2 + origy1) + 0.1f * space; float ar_x1 = ar_x0 + lr_arrow_width; - float ar_y1 = 0.5f * (origy2 + origy1) + 0.9f * line_height; + float ar_y1 = 0.5f * (origy2 + origy1) + 0.9f * space; //machine().ui().draw_outlined_box(container, origx1, origy1, origx2, origy2, UI_BACKGROUND_COLOR); mui.draw_outlined_box(container, origx1, origy1, origx2, origy2, rgb_t(0xEF, 0x12, 0x47, 0x7B));