Merge pull request #8211 from jdgleaver/rgui-lock-aspect

(RGUI) Add 'Lock Menu Aspect Ratio' option
This commit is contained in:
Twinaphex 2019-02-07 20:18:15 +01:00 committed by GitHub
commit d03b472f73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 58 additions and 1 deletions

View File

@ -376,6 +376,8 @@ static bool show_advanced_settings = false;
static unsigned rgui_color_theme = RGUI_THEME_CLASSIC_GREEN;
static unsigned rgui_thumbnail_downscaler = RGUI_THUMB_SCALE_POINT;
static bool rgui_lock_aspect = false;
#else
static bool default_block_config_read = false;
static bool automatically_add_content_to_playlist = false;

View File

@ -1456,6 +1456,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("menu_use_preferred_system_color_theme", &settings->bools.menu_use_preferred_system_color_theme, true, menu_use_preferred_system_color_theme, false);
SETTING_BOOL("content_show_settings", &settings->bools.menu_content_show_settings, true, content_show_settings, false);
SETTING_BOOL("content_show_favorites", &settings->bools.menu_content_show_favorites, true, content_show_favorites, false);
SETTING_BOOL("menu_rgui_lock_aspect", &settings->bools.menu_rgui_lock_aspect, true, rgui_lock_aspect, false);
#ifdef HAVE_IMAGEVIEWER
SETTING_BOOL("content_show_images", &settings->bools.menu_content_show_images, true, content_show_images, false);
#endif

View File

@ -170,6 +170,7 @@ typedef struct settings
bool menu_rgui_background_filler_thickness_enable;
bool menu_rgui_border_filler_thickness_enable;
bool menu_rgui_border_filler_enable;
bool menu_rgui_lock_aspect;
bool menu_xmb_shadows_enable;
bool menu_xmb_vertical_thumbnails;
bool menu_content_show_settings;

View File

@ -1589,6 +1589,8 @@ MSG_HASH(MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"menu_rgui_border_filler_thickness_enable")
MSG_HASH(MENU_ENUM_LABEL_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"menu_rgui_background_filler_thickness_enable")
MSG_HASH(MENU_ENUM_LABEL_MENU_RGUI_LOCK_ASPECT,
"menu_rgui_lock_aspect")
MSG_HASH(MENU_ENUM_LABEL_CONTENT_SHOW_REWIND,
"menu_show_rewind_settings")
MSG_HASH(MENU_ENUM_LABEL_CONTENT_SHOW_LATENCY,

View File

@ -6640,6 +6640,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Background filler thickness"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MENU_RGUI_LOCK_ASPECT,
"Lock Menu Aspect Ratio"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION,
"For CRT displays only. Attempts to use exact core/game resolution and refresh rate."

View File

@ -2227,6 +2227,32 @@ static int rgui_pointer_tap(void *data,
return 0;
}
static void rgui_toggle(void *userdata, bool menu_on)
{
settings_t *settings = config_get_ptr();
if (settings->bools.menu_rgui_lock_aspect)
{
if (menu_on)
{
if (settings->uints.video_aspect_ratio_idx != ASPECT_RATIO_4_3)
{
unsigned aspect_ratio_idx = settings->uints.video_aspect_ratio_idx;
settings->uints.video_aspect_ratio_idx = ASPECT_RATIO_4_3;
video_driver_set_aspect_ratio();
settings->uints.video_aspect_ratio_idx = aspect_ratio_idx;
}
}
else
{
if (settings->uints.video_aspect_ratio_idx != ASPECT_RATIO_4_3)
{
video_driver_set_aspect_ratio();
}
}
}
}
menu_ctx_driver_t menu_ctx_rgui = {
rgui_set_texture,
rgui_set_message,
@ -2238,7 +2264,7 @@ menu_ctx_driver_t menu_ctx_rgui = {
NULL,
NULL,
rgui_populate_entries,
NULL,
rgui_toggle,
rgui_navigation_clear,
NULL,
NULL,

View File

@ -6012,6 +6012,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
MENU_ENUM_LABEL_MENU_LINEAR_FILTER,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_MENU_RGUI_LOCK_ASPECT,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_MENU_HORIZONTAL_ANIMATION,
PARSE_ONLY_BOOL, false) == 0)

View File

@ -7963,6 +7963,22 @@ static bool setting_append_list(
SD_FLAG_NONE
);
CONFIG_BOOL(
list, list_info,
&settings->bools.menu_rgui_lock_aspect,
MENU_ENUM_LABEL_MENU_RGUI_LOCK_ASPECT,
MENU_ENUM_LABEL_VALUE_MENU_RGUI_LOCK_ASPECT,
true,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler,
SD_FLAG_NONE
);
CONFIG_UINT(
list, list_info,
&settings->uints.menu_rgui_color_theme,

View File

@ -856,6 +856,7 @@ enum msg_hash_enums
MENU_LABEL(MENU_RGUI_BORDER_FILLER_ENABLE),
MENU_LABEL(MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE),
MENU_LABEL(MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE),
MENU_LABEL(MENU_RGUI_LOCK_ASPECT),
MENU_LABEL(MENU_LINEAR_FILTER),
MENU_LABEL(MENU_HORIZONTAL_ANIMATION),
MENU_LABEL(NAVIGATION_WRAPAROUND),