Merge pull request #9630 from jdgleaver/glui-updates

(GLUI) Menu improvements (Round 3)
This commit is contained in:
Twinaphex 2019-10-24 02:03:26 +02:00 committed by GitHub
commit bf122a33e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 1068 additions and 309 deletions

View File

@ -114,9 +114,29 @@
#endif
#ifdef HAVE_MATERIALUI
/* Show icons to the left of each menu entry */
#define DEFAULT_MATERIALUI_ICONS_ENABLE true
#endif
/* Material UI colour theme */
#define DEFAULT_MATERIALUI_THEME MATERIALUI_THEME_OZONE_DARK
/* Type of animation to use when performing menu transitions
* > 'Auto' follows Material UI standards:
* - Slide when switching between parent menus (tabs)
* - Fade when changing levels in a menu
* Note: Not wrapping this with a HAVE_MATERIALUI ifdef
* because there's too much baggage involved... */
#define DEFAULT_MATERIALUI_TRANSITION_ANIM MATERIALUI_TRANSITION_ANIM_AUTO
/* Adjust menu padding etc. to better fit the
* screen when using landscape layouts */
#if defined(RARCH_MOBILE)
#define DEFAULT_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT false
#else
#define DEFAULT_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT true
#endif
#define DEFAULT_CRT_SWITCH_RESOLUTION CRT_SWITCH_NONE
#define DEFAULT_CRT_SWITCH_RESOLUTION_SUPER 2560

View File

@ -1556,6 +1556,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("menu_show_advanced_settings", &settings->bools.menu_show_advanced_settings, true, DEFAULT_SHOW_ADVANCED_SETTINGS, false);
#ifdef HAVE_MATERIALUI
SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, DEFAULT_MATERIALUI_ICONS_ENABLE, false);
SETTING_BOOL("materialui_optimize_landscape_layout", &settings->bools.menu_materialui_optimize_landscape_layout, true, DEFAULT_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT, false);
#endif
#ifdef HAVE_RGUI
SETTING_BOOL("rgui_background_filler_thickness_enable", &settings->bools.menu_rgui_background_filler_thickness_enable, true, true, false);
@ -1808,7 +1809,8 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
SETTING_UINT("menu_font_color_blue", &settings->uints.menu_font_color_blue, true, menu_font_color_blue, false);
SETTING_UINT("menu_xmb_thumbnail_scale_factor", &settings->uints.menu_xmb_thumbnail_scale_factor, true, xmb_thumbnail_scale_factor, false);
#endif
SETTING_UINT("materialui_menu_color_theme", &settings->uints.menu_materialui_color_theme, true, MATERIALUI_THEME_BLUE, false);
SETTING_UINT("materialui_menu_color_theme", &settings->uints.menu_materialui_color_theme, true, DEFAULT_MATERIALUI_THEME, false);
SETTING_UINT("materialui_menu_transition_animation", &settings->uints.menu_materialui_transition_animation, true, DEFAULT_MATERIALUI_TRANSITION_ANIM, false);
SETTING_UINT("menu_shader_pipeline", &settings->uints.menu_xmb_shader_pipeline, true, DEFAULT_MENU_SHADER_PIPELINE, false);
#ifdef HAVE_OZONE
SETTING_UINT("ozone_menu_color_theme", &settings->uints.menu_ozone_color_theme, true, 1, false);

View File

@ -186,6 +186,7 @@ typedef struct settings
bool menu_show_video_layout;
#endif
bool menu_materialui_icons_enable;
bool menu_materialui_optimize_landscape_layout;
bool menu_rgui_background_filler_thickness_enable;
bool menu_rgui_border_filler_thickness_enable;
bool menu_rgui_border_filler_enable;
@ -532,6 +533,7 @@ typedef struct settings
unsigned menu_xmb_color_theme;
unsigned menu_xmb_thumbnail_scale_factor;
unsigned menu_materialui_color_theme;
unsigned menu_materialui_transition_animation;
unsigned menu_ozone_color_theme;
unsigned menu_font_color_red;
unsigned menu_font_color_green;

View File

@ -727,6 +727,8 @@ MSG_HASH(MENU_ENUM_LABEL_OZONE_SCROLL_CONTENT_METADATA,
"ozone_scroll_content_metadata")
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME,
"materialui_menu_color_theme")
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_MENU_TRANSITION_ANIMATION,
"materialui_menu_transition_animation")
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_MENU_FOOTER_OPACITY,
"materialui_menu_footer_opacity")
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_MENU_HEADER_OPACITY,
@ -1663,6 +1665,8 @@ MSG_HASH(MENU_ENUM_LABEL_GOTO_VIDEO,
"goto_video")
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE,
"materialui_icons_enable")
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
"materialui_optimize_landscape_layout")
MSG_HASH(MENU_ENUM_LABEL_RENAME_ENTRY,
"rename_entry")
MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE,

View File

@ -1746,6 +1746,42 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_OZONE_DARK,
"Ozone Dark"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_NORD,
"Nord"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_GRUVBOX_DARK,
"Gruvbox Dark"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_SOLARIZED_DARK,
"Solarized Dark"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIMATION,
"Menu Transition Animation"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_MATERIALUI_MENU_TRANSITION_ANIMATION,
"Enable smooth animation effects when navigating between different levels of the menu."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_AUTO,
"Auto"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_FADE,
"Fade"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_SLIDE,
"Slide"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_NONE,
"OFF"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_FOOTER_OPACITY,
"Footer Opacity"
@ -6895,6 +6931,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_MATERIALUI_ICONS_ENABLE,
"Show icons at the left of the menu entries."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
"Optimize Landscape Layout"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
"Automatically adjust menu layout to better fit the screen when using landscape display orientations."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_XMB_MAIN_MENU_ENABLE_SETTINGS,
"Settings Tab"

View File

@ -198,6 +198,7 @@ default_sublabel_macro(action_bind_sublabel_netplay_settings, MENU_
default_sublabel_macro(action_bind_sublabel_user_bind_settings, MENU_ENUM_SUBLABEL_INPUT_USER_BINDS)
default_sublabel_macro(action_bind_sublabel_input_hotkey_settings, MENU_ENUM_SUBLABEL_INPUT_HOTKEY_BINDS)
default_sublabel_macro(action_bind_sublabel_materialui_icons_enable, MENU_ENUM_SUBLABEL_MATERIALUI_ICONS_ENABLE)
default_sublabel_macro(action_bind_sublabel_materialui_optimize_landscape_layout, MENU_ENUM_SUBLABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT)
default_sublabel_macro(action_bind_sublabel_add_content_list, MENU_ENUM_SUBLABEL_ADD_CONTENT_LIST)
default_sublabel_macro(action_bind_sublabel_video_frame_delay, MENU_ENUM_SUBLABEL_VIDEO_FRAME_DELAY)
default_sublabel_macro(action_bind_sublabel_video_shader_delay, MENU_ENUM_SUBLABEL_VIDEO_SHADER_DELAY)
@ -486,6 +487,7 @@ default_sublabel_macro(action_bind_sublabel_xmb_shadows_enable,
default_sublabel_macro(action_bind_sublabel_xmb_vertical_thumbnails, MENU_ENUM_SUBLABEL_XMB_VERTICAL_THUMBNAILS)
default_sublabel_macro(action_bind_sublabel_menu_xmb_thumbnail_scale_factor, MENU_ENUM_SUBLABEL_MENU_XMB_THUMBNAIL_SCALE_FACTOR)
default_sublabel_macro(action_bind_sublabel_menu_color_theme, MENU_ENUM_SUBLABEL_MATERIALUI_MENU_COLOR_THEME)
default_sublabel_macro(action_bind_sublabel_materialui_menu_transition_animation, MENU_ENUM_SUBLABEL_MATERIALUI_MENU_TRANSITION_ANIMATION)
default_sublabel_macro(action_bind_sublabel_ozone_menu_color_theme, MENU_ENUM_SUBLABEL_OZONE_MENU_COLOR_THEME)
default_sublabel_macro(action_bind_sublabel_ozone_collapse_sidebar, MENU_ENUM_SUBLABEL_OZONE_COLLAPSE_SIDEBAR)
default_sublabel_macro(action_bind_sublabel_ozone_truncate_playlist_name, MENU_ENUM_SUBLABEL_OZONE_TRUNCATE_PLAYLIST_NAME)
@ -1249,6 +1251,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_icons_enable);
break;
case MENU_ENUM_LABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_optimize_landscape_layout);
break;
case MENU_ENUM_LABEL_VIDEO_VIEWPORT_CUSTOM_HEIGHT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_viewport_custom_height);
break;
@ -1709,6 +1714,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_XMB_MENU_COLOR_THEME:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_color_theme);
break;
case MENU_ENUM_LABEL_MATERIALUI_MENU_TRANSITION_ANIMATION:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_materialui_menu_transition_animation);
break;
case MENU_ENUM_LABEL_XMB_SHADOWS_ENABLE:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_xmb_shadows_enable);
break;

File diff suppressed because it is too large Load Diff

View File

@ -154,9 +154,21 @@ enum materialui_color_theme
MATERIALUI_THEME_MATERIALUI,
MATERIALUI_THEME_MATERIALUI_DARK,
MATERIALUI_THEME_OZONE_DARK,
MATERIALUI_THEME_NORD,
MATERIALUI_THEME_GRUVBOX_DARK,
MATERIALUI_THEME_SOLARIZED_DARK,
MATERIALUI_THEME_LAST
};
enum materialui_transition_animation
{
MATERIALUI_TRANSITION_ANIM_AUTO = 0,
MATERIALUI_TRANSITION_ANIM_FADE,
MATERIALUI_TRANSITION_ANIM_SLIDE,
MATERIALUI_TRANSITION_ANIM_NONE,
MATERIALUI_TRANSITION_ANIM_LAST
};
enum xmb_color_theme
{
XMB_THEME_LEGACY_RED = 0,

View File

@ -5446,7 +5446,9 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct
{MENU_ENUM_LABEL_OZONE_COLLAPSE_SIDEBAR, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_OZONE_TRUNCATE_PLAYLIST_NAME, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME, PARSE_ONLY_UINT},
{MENU_ENUM_LABEL_MATERIALUI_MENU_TRANSITION_ANIMATION, PARSE_ONLY_UINT},
{MENU_ENUM_LABEL_MATERIALUI_MENU_HEADER_OPACITY, PARSE_ONLY_FLOAT},
{MENU_ENUM_LABEL_MATERIALUI_MENU_FOOTER_OPACITY, PARSE_ONLY_FLOAT},
{MENU_ENUM_LABEL_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME, PARSE_ONLY_BOOL },

View File

@ -3868,6 +3868,55 @@ static void setting_get_string_representation_uint_materialui_menu_color_theme(
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_OZONE_DARK), len);
break;
case MATERIALUI_THEME_NORD:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_NORD), len);
break;
case MATERIALUI_THEME_GRUVBOX_DARK:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_GRUVBOX_DARK), len);
break;
case MATERIALUI_THEME_SOLARIZED_DARK:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_SOLARIZED_DARK), len);
break;
default:
break;
}
}
static void setting_get_string_representation_uint_materialui_menu_transition_animation(
rarch_setting_t *setting,
char *s, size_t len)
{
if (!setting)
return;
switch (*setting->value.target.unsigned_integer)
{
case MATERIALUI_TRANSITION_ANIM_AUTO:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_AUTO), len);
break;
case MATERIALUI_TRANSITION_ANIM_FADE:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_FADE), len);
break;
case MATERIALUI_TRANSITION_ANIM_SLIDE:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_SLIDE), len);
break;
case MATERIALUI_TRANSITION_ANIM_NONE:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_NONE), len);
break;
default:
break;
}
@ -12864,7 +12913,7 @@ static bool setting_append_list(
&settings->uints.menu_materialui_color_theme,
MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME,
MATERIALUI_THEME_BLUE,
DEFAULT_MATERIALUI_THEME,
&group_info,
&subgroup_info,
parent_group,
@ -12876,6 +12925,38 @@ static bool setting_append_list(
menu_settings_list_current_add_range(list, list_info, 0, MATERIALUI_THEME_LAST-1, 1, true, true);
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_COMBOBOX;
CONFIG_UINT(
list, list_info,
&settings->uints.menu_materialui_transition_animation,
MENU_ENUM_LABEL_MATERIALUI_MENU_TRANSITION_ANIMATION,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIMATION,
DEFAULT_MATERIALUI_TRANSITION_ANIM,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_uint_materialui_menu_transition_animation;
menu_settings_list_current_add_range(list, list_info, 0, MATERIALUI_TRANSITION_ANIM_LAST-1, 1, true, true);
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_COMBOBOX;
CONFIG_BOOL(
list, list_info,
&settings->bools.menu_materialui_optimize_landscape_layout,
MENU_ENUM_LABEL_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
MENU_ENUM_LABEL_VALUE_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
DEFAULT_MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT,
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);
/* TODO: These should be removed entirely, but just
* comment out for now in case users complain...
CONFIG_FLOAT(

View File

@ -517,6 +517,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_AUTO,
MENU_LABEL(MATERIALUI_ICONS_ENABLE),
MENU_LABEL(MATERIALUI_OPTIMIZE_LANDSCAPE_LAYOUT),
MENU_ENUM_LABEL_VALUE_RGUI_MENU_COLOR_THEME_CUSTOM,
MENU_ENUM_LABEL_VALUE_RGUI_MENU_COLOR_THEME_CLASSIC_RED,
@ -602,6 +603,15 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_MATERIALUI,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_MATERIALUI_DARK,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_OZONE_DARK,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_NORD,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_GRUVBOX_DARK,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_COLOR_THEME_SOLARIZED_DARK,
MENU_LABEL(MATERIALUI_MENU_TRANSITION_ANIMATION),
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_AUTO,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_FADE,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_SLIDE,
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_NONE,
MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_LATE,
MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_NORMAL,