mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
ozone: add a setting to have the sidebar always collapsed
This commit is contained in:
parent
be47416f84
commit
279a2d58db
@ -282,6 +282,10 @@ static bool menu_use_preferred_system_color_theme = true;
|
||||
static bool menu_use_preferred_system_color_theme = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OZONE
|
||||
static bool ozone_collapse_sidebar = false;
|
||||
#endif
|
||||
|
||||
static bool quick_menu_show_take_screenshot = true;
|
||||
static bool quick_menu_show_save_load_state = true;
|
||||
static bool quick_menu_show_undo_save_load_state = true;
|
||||
|
@ -1586,6 +1586,10 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("quit_press_twice", &settings->bools.quit_press_twice, true, quit_press_twice, false);
|
||||
SETTING_BOOL("vibrate_on_keypress", &settings->bools.vibrate_on_keypress, true, vibrate_on_keypress, false);
|
||||
|
||||
#ifdef HAVE_OZONE
|
||||
SETTING_BOOL("ozone_collapse_sidebar", &settings->bools.ozone_collapse_sidebar, true, ozone_collapse_sidebar, false);
|
||||
#endif
|
||||
|
||||
*size = count;
|
||||
|
||||
return tmp;
|
||||
|
@ -316,6 +316,9 @@ typedef struct settings
|
||||
|
||||
bool quit_press_twice;
|
||||
bool vibrate_on_keypress;
|
||||
#ifdef HAVE_OZONE
|
||||
bool ozone_collapse_sidebar;
|
||||
#endif
|
||||
} bools;
|
||||
|
||||
struct
|
||||
|
@ -657,6 +657,8 @@ MSG_HASH(MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET,
|
||||
"rgui_menu_theme_preset")
|
||||
MSG_HASH(MENU_ENUM_LABEL_OZONE_MENU_COLOR_THEME,
|
||||
"ozone_menu_color_theme")
|
||||
MSG_HASH(MENU_ENUM_LABEL_OZONE_COLLAPSE_SIDEBAR,
|
||||
"ozone_collapse_sidebar")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME,
|
||||
"materialui_menu_color_theme")
|
||||
MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_MENU_FOOTER_OPACITY,
|
||||
|
@ -8206,6 +8206,14 @@ MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OZONE_MENU_COLOR_THEME,
|
||||
"Select a different color theme."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_COLLAPSE_SIDEBAR,
|
||||
"Collapse the sidebar"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OZONE_COLLAPSE_SIDEBAR,
|
||||
"Have the left sidebar always collapsed."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME,
|
||||
"Use preferred system color theme"
|
||||
|
@ -393,6 +393,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_color_theme, MENU_ENUM_SUBLABEL_MATERIALUI_MENU_COLOR_THEME)
|
||||
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_menu_use_preferred_system_color_theme, MENU_ENUM_SUBLABEL_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_wallpaper_opacity, MENU_ENUM_SUBLABEL_MENU_WALLPAPER_OPACITY)
|
||||
default_sublabel_macro(action_bind_sublabel_menu_framebuffer_opacity, MENU_ENUM_SUBLABEL_MENU_FRAMEBUFFER_OPACITY)
|
||||
@ -1348,6 +1349,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_OZONE_MENU_COLOR_THEME:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_menu_color_theme);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_COLLAPSE_SIDEBAR:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_collapse_sidebar);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME:
|
||||
case MENU_ENUM_LABEL_XMB_MENU_COLOR_THEME:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_color_theme);
|
||||
|
@ -159,6 +159,8 @@ static void *ozone_init(void **userdata, bool video_is_threaded)
|
||||
ozone->sidebar_collapsed = false;
|
||||
ozone->animations.sidebar_text_alpha = 1.0f;
|
||||
|
||||
ozone_sidebar_update_collapse(ozone, false);
|
||||
|
||||
ozone->system_tab_end = 0;
|
||||
ozone->tabs[ozone->system_tab_end] = OZONE_SYSTEM_TAB_MAIN;
|
||||
if (settings->bools.menu_content_show_settings && !settings->bools.kiosk_mode_enable)
|
||||
@ -1305,6 +1307,8 @@ static void ozone_list_open(ozone_handle_t *ozone)
|
||||
/* Sidebar animation */
|
||||
if (ozone->depth == 1)
|
||||
{
|
||||
ozone_sidebar_update_collapse(ozone, false);
|
||||
|
||||
ozone->draw_sidebar = true;
|
||||
|
||||
entry.cb = NULL;
|
||||
|
@ -31,8 +31,6 @@
|
||||
|
||||
#include "../../../configuration.h"
|
||||
|
||||
/* TODO Add an always collapsed sidebar setting */
|
||||
|
||||
enum msg_hash_enums ozone_system_tabs_value[OZONE_SYSTEM_TAB_LAST] = {
|
||||
MENU_ENUM_LABEL_VALUE_MAIN_MENU,
|
||||
MENU_ENUM_LABEL_VALUE_SETTINGS_TAB,
|
||||
@ -334,6 +332,7 @@ static void ozone_sidebar_collapse_end(void *userdata)
|
||||
void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation)
|
||||
{
|
||||
/* Collapse sidebar if needed */
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool is_playlist = ozone_is_playlist(ozone, false);
|
||||
menu_animation_ctx_tag tag = (uintptr_t)NULL;
|
||||
|
||||
@ -344,7 +343,7 @@ void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation)
|
||||
entry.userdata = ozone;
|
||||
entry.duration = ANIMATION_CURSOR_DURATION;
|
||||
|
||||
if (is_playlist && !ozone->sidebar_collapsed)
|
||||
if (settings->bools.ozone_collapse_sidebar || (is_playlist && !ozone->sidebar_collapsed))
|
||||
{
|
||||
if (allow_animation)
|
||||
{
|
||||
@ -393,6 +392,7 @@ void ozone_sidebar_update_collapse(ozone_handle_t *ozone, bool allow_animation)
|
||||
{
|
||||
ozone->animations.sidebar_text_alpha = 1.0f;
|
||||
ozone->dimensions.sidebar_width = ozone->dimensions.sidebar_width_normal;
|
||||
ozone->sidebar_collapsed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6183,6 +6183,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
|
||||
MENU_ENUM_LABEL_OZONE_MENU_COLOR_THEME,
|
||||
PARSE_ONLY_UINT, false) == 0)
|
||||
count++;
|
||||
if (menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_OZONE_COLLAPSE_SIDEBAR,
|
||||
PARSE_ONLY_BOOL, false) == 0)
|
||||
count++;
|
||||
if (menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE,
|
||||
PARSE_ONLY_BOOL, false) == 0)
|
||||
|
@ -9123,6 +9123,21 @@ static bool setting_append_list(
|
||||
(*list)[list_info->index - 1].get_string_representation =
|
||||
&setting_get_string_representation_uint_ozone_menu_color_theme;
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 1, 1, true, true);
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.ozone_collapse_sidebar,
|
||||
MENU_ENUM_LABEL_OZONE_COLLAPSE_SIDEBAR,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_COLLAPSE_SIDEBAR,
|
||||
ozone_collapse_sidebar,
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -907,6 +907,7 @@ enum msg_hash_enums
|
||||
MENU_LABEL(RGUI_MENU_THEME_PRESET),
|
||||
MENU_LABEL(XMB_MENU_COLOR_THEME),
|
||||
MENU_LABEL(OZONE_MENU_COLOR_THEME),
|
||||
MENU_LABEL(OZONE_COLLAPSE_SIDEBAR),
|
||||
MENU_LABEL(MATERIALUI_MENU_COLOR_THEME),
|
||||
MENU_LABEL(QUICK_MENU_OVERRIDE_OPTIONS),
|
||||
MENU_LABEL(QUICK_MENU_SHOW_TAKE_SCREENSHOT),
|
||||
|
Loading…
x
Reference in New Issue
Block a user