Add UI Menubar Enable setting

This commit is contained in:
twinaphex 2015-01-17 01:29:15 +01:00
parent 7f53ca4ab5
commit 4428fe21cd
6 changed files with 30 additions and 8 deletions

View File

@ -179,6 +179,11 @@ struct settings
bool force_srgb_disable;
} video;
struct
{
bool menubar_enable;
} ui;
#ifdef HAVE_MENU
struct
{

View File

@ -586,7 +586,7 @@ static bool d3d_construct(d3d_video_t *d3d,
);
#if defined(HAVE_WINDOW) && !defined(_XBOX)
if (!info->fullscreen)
if (!info->fullscreen && g_settings.ui.menubar_enable)
{
RECT rc_temp = {0, 0, win_height, 0x7FFF};
SetMenu(d3d->hWnd, LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_MENU)));

View File

@ -98,6 +98,7 @@ LRESULT CALLBACK WindowProc(HWND hWnd, UINT message,
}
return 0;
case WM_COMMAND:
if (g_settings.ui.menubar_enable)
{
d3d_video_t *d3d = (d3d_video_t*)driver.video_data;
HWND d3dr = d3d->hWnd;

View File

@ -271,11 +271,13 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
}
return 0;
case WM_COMMAND:
{
LRESULT ret = win32_menu_loop(g_hwnd, wparam);
}
if (g_settings.ui.menubar_enable)
{
LRESULT ret = win32_menu_loop(g_hwnd, wparam);
}
break;
}
if (dinput_handle_message(dinput_wgl, message, wparam, lparam))
return 0;
return DefWindowProc(hwnd, message, wparam, lparam);
@ -509,7 +511,7 @@ static bool gfx_ctx_wgl_set_video_mode(void *data,
if (!fullscreen || windowed_full)
{
if (!fullscreen)
if (!fullscreen && g_settings.ui.menubar_enable)
{
RECT rc_temp = {0, 0, height, 0x7FFF};
SetMenu(g_hwnd, LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_MENU)));

View File

@ -1287,6 +1287,7 @@ static bool config_load_file(const char *path, bool set_defaults)
*g_settings.libretro = '\0';
}
CONFIG_GET_BOOL(ui.menubar_enable, "ui_menubar_enable");
CONFIG_GET_BOOL(fps_show, "fps_show");
CONFIG_GET_BOOL(fps_monitor_enable, "fps_monitor_enable");
CONFIG_GET_BOOL(load_dummy_on_core_shutdown, "load_dummy_on_core_shutdown");
@ -1769,6 +1770,7 @@ bool config_save_file(const char *path)
config_set_bool(conf, "load_dummy_on_core_shutdown",
g_settings.load_dummy_on_core_shutdown);
config_set_bool(conf, "fps_show", g_settings.fps_show);
config_set_bool(conf, "ui_menubar_enable", g_settings.ui.menubar_enable);
config_set_bool(conf, "fps_monitor_enable", g_settings.fps_monitor_enable);
config_set_path(conf, "libretro_path", g_settings.libretro);
config_set_path(conf, "libretro_directory", g_settings.libretro_directory);

View File

@ -5326,7 +5326,7 @@ static bool setting_data_append_list_ui_options(
CONFIG_BOOL(
g_settings.video.disable_composition,
"video_disable_composition",
"Window Compositing Disable",
"Window Compositing Disable Hint",
disable_composition,
"OFF",
"ON",
@ -5340,7 +5340,7 @@ static bool setting_data_append_list_ui_options(
CONFIG_BOOL(
g_settings.pause_nonactive,
"pause_nonactive",
"Window Unfocus Pause",
"Window Unfocus Pause Hint",
pause_nonactive,
"OFF",
"ON",
@ -5349,6 +5349,18 @@ static bool setting_data_append_list_ui_options(
general_write_handler,
general_read_handler);
CONFIG_BOOL(
g_settings.ui.menubar_enable,
"ui_menubar_enable",
"Menubar Enable Hint",
true,
"OFF",
"ON",
group_info.name,
subgroup_info.name,
general_write_handler,
general_read_handler);
END_SUB_GROUP(list, list_info);
END_GROUP(list, list_info);