Ozone: Add options to scale font size
This commit is contained in:
parent
42704b9311
commit
d471cbce8a
|
@ -667,6 +667,14 @@
|
|||
#define DEFAULT_OZONE_COLLAPSE_SIDEBAR false
|
||||
#define DEFAULT_OZONE_SCROLL_CONTENT_METADATA false
|
||||
#define DEFAULT_OZONE_THUMBNAIL_SCALE_FACTOR 1.0f
|
||||
#define DEFAULT_OZONE_FONT_SCALE 0
|
||||
#define DEFAULT_OZONE_FONT_SCALE_FACTOR_GLOBAL 1.0f
|
||||
#define DEFAULT_OZONE_FONT_SCALE_FACTOR_TITLE 1.0f
|
||||
#define DEFAULT_OZONE_FONT_SCALE_FACTOR_SIDEBAR 1.0f
|
||||
#define DEFAULT_OZONE_FONT_SCALE_FACTOR_LABEL 1.0f
|
||||
#define DEFAULT_OZONE_FONT_SCALE_FACTOR_SUBLABEL 1.0f
|
||||
#define DEFAULT_OZONE_FONT_SCALE_FACTOR_TIME 1.0f
|
||||
#define DEFAULT_OZONE_FONT_SCALE_FACTOR_FOOTER 1.0f
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_OZONE) || defined(HAVE_XMB)
|
||||
|
|
|
@ -2305,6 +2305,13 @@ static struct config_float_setting *populate_settings_float(
|
|||
#ifdef HAVE_OZONE
|
||||
SETTING_FLOAT("ozone_thumbnail_scale_factor", &settings->floats.ozone_thumbnail_scale_factor, true, DEFAULT_OZONE_THUMBNAIL_SCALE_FACTOR, false);
|
||||
SETTING_FLOAT("ozone_padding_factor", &settings->floats.ozone_padding_factor, true, DEFAULT_OZONE_PADDING_FACTOR, false);
|
||||
SETTING_FLOAT("ozone_font_scale_factor_global", &settings->floats.ozone_font_scale_factor_global, true, DEFAULT_OZONE_FONT_SCALE_FACTOR_GLOBAL, false);
|
||||
SETTING_FLOAT("ozone_font_scale_factor_title", &settings->floats.ozone_font_scale_factor_title, true, DEFAULT_OZONE_FONT_SCALE_FACTOR_TITLE, false);
|
||||
SETTING_FLOAT("ozone_font_scale_factor_sidebar", &settings->floats.ozone_font_scale_factor_sidebar, true, DEFAULT_OZONE_FONT_SCALE_FACTOR_SIDEBAR, false);
|
||||
SETTING_FLOAT("ozone_font_scale_factor_label", &settings->floats.ozone_font_scale_factor_label, true, DEFAULT_OZONE_FONT_SCALE_FACTOR_LABEL, false);
|
||||
SETTING_FLOAT("ozone_font_scale_factor_sublabel", &settings->floats.ozone_font_scale_factor_sublabel, true, DEFAULT_OZONE_FONT_SCALE_FACTOR_SUBLABEL, false);
|
||||
SETTING_FLOAT("ozone_font_scale_factor_time", &settings->floats.ozone_font_scale_factor_time, true, DEFAULT_OZONE_FONT_SCALE_FACTOR_TIME, false);
|
||||
SETTING_FLOAT("ozone_font_scale_factor_footer", &settings->floats.ozone_font_scale_factor_footer, true, DEFAULT_OZONE_FONT_SCALE_FACTOR_FOOTER, false);
|
||||
#endif
|
||||
#endif /* HAVE_MENU */
|
||||
|
||||
|
@ -2452,6 +2459,7 @@ static struct config_uint_setting *populate_settings_uint(
|
|||
#ifdef HAVE_OZONE
|
||||
SETTING_UINT("ozone_menu_color_theme", &settings->uints.menu_ozone_color_theme, true, DEFAULT_OZONE_COLOR_THEME, false);
|
||||
SETTING_UINT("ozone_header_separator", &settings->uints.menu_ozone_header_separator, true, DEFAULT_OZONE_HEADER_SEPARATOR, false);
|
||||
SETTING_UINT("ozone_font_scale", &settings->uints.menu_ozone_font_scale, true, DEFAULT_OZONE_FONT_SCALE, false);
|
||||
#endif
|
||||
#endif /* HAVE_MENU */
|
||||
|
||||
|
|
|
@ -307,6 +307,7 @@ typedef struct settings
|
|||
unsigned menu_materialui_landscape_layout_optimization;
|
||||
unsigned menu_ozone_color_theme;
|
||||
unsigned menu_ozone_header_separator;
|
||||
unsigned menu_ozone_font_scale;
|
||||
unsigned menu_font_color_red;
|
||||
unsigned menu_font_color_green;
|
||||
unsigned menu_font_color_blue;
|
||||
|
@ -421,6 +422,13 @@ typedef struct settings
|
|||
float menu_screensaver_animation_speed;
|
||||
float ozone_padding_factor;
|
||||
float ozone_thumbnail_scale_factor;
|
||||
float ozone_font_scale_factor_global;
|
||||
float ozone_font_scale_factor_title;
|
||||
float ozone_font_scale_factor_sidebar;
|
||||
float ozone_font_scale_factor_label;
|
||||
float ozone_font_scale_factor_sublabel;
|
||||
float ozone_font_scale_factor_time;
|
||||
float ozone_font_scale_factor_footer;
|
||||
|
||||
float cheevos_appearance_padding_h;
|
||||
float cheevos_appearance_padding_v;
|
||||
|
|
|
@ -12338,6 +12338,78 @@ MSG_HASH(
|
|||
MENU_ENUM_SUBLABEL_OZONE_FONT,
|
||||
"Select a different main font to be used by the menu."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE,
|
||||
"Font Scale"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE,
|
||||
"Define whether the font size in the menu should have its own scaling, and if it should be scaled globally or with separate values for each part of the menu."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_GLOBAL,
|
||||
"Global"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_SEPARATE,
|
||||
"Separate values"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_GLOBAL,
|
||||
"Font Scale Factor"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_GLOBAL,
|
||||
"Scale the font size linearly across the menu."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_TITLE,
|
||||
"Title Font Scale Factor"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_TITLE,
|
||||
"Scale the font size for the title text in the menu header."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_SIDEBAR,
|
||||
"Left Sidebar Font Scale Factor"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_SIDEBAR,
|
||||
"Scale the font size for the text in the left sidebar."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_LABEL,
|
||||
"Labels Font Scale Factor"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_LABEL,
|
||||
"Scale the font size for the labels of menu options and playlist entries. Also affects text size in the help boxes."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_SUBLABEL,
|
||||
"Sublabels Font Scale Factor"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_SUBLABEL,
|
||||
"Scale the font size for the sublabels of menu options and playlist entries."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_TIME,
|
||||
"Timedate Font Scale Factor"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_TIME,
|
||||
"Scale the font size of the time and date indicator in the top-right corner of the menu."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_FOOTER,
|
||||
"Footer Font Scale Factor"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_FOOTER,
|
||||
"Scale the font size of the text in the menu footer. Also affects text size in the right thumbnail sidebar."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_COLLAPSE_SIDEBAR,
|
||||
"Collapse the Sidebar"
|
||||
|
|
|
@ -950,6 +950,14 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_header_separator,
|
|||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_collapse_sidebar, MENU_ENUM_SUBLABEL_OZONE_COLLAPSE_SIDEBAR)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_scroll_content_metadata, MENU_ENUM_SUBLABEL_OZONE_SCROLL_CONTENT_METADATA)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_thumbnail_scale_factor, MENU_ENUM_SUBLABEL_OZONE_THUMBNAIL_SCALE_FACTOR)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_font_scale, MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_font_scale_factor_global, MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_GLOBAL)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_font_scale_factor_title, MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_TITLE)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_font_scale_factor_sidebar, MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_SIDEBAR)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_font_scale_factor_label, MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_LABEL)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_font_scale_factor_sublabel, MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_SUBLABEL)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_font_scale_factor_time, MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_TIME)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_font_scale_factor_footer, MENU_ENUM_SUBLABEL_OZONE_FONT_SCALE_FACTOR_FOOTER)
|
||||
#endif
|
||||
#if defined(HAVE_OZONE) || defined(HAVE_XMB)
|
||||
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_ozone_truncate_playlist_name, MENU_ENUM_SUBLABEL_OZONE_TRUNCATE_PLAYLIST_NAME)
|
||||
|
@ -3248,6 +3256,46 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
|||
case MENU_ENUM_LABEL_OZONE_THUMBNAIL_SCALE_FACTOR:
|
||||
#ifdef HAVE_OZONE
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_thumbnail_scale_factor);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE:
|
||||
#ifdef HAVE_OZONE
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_font_scale);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_GLOBAL:
|
||||
#ifdef HAVE_OZONE
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_font_scale_factor_global);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_TITLE:
|
||||
#ifdef HAVE_OZONE
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_font_scale_factor_title);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_SIDEBAR:
|
||||
#ifdef HAVE_OZONE
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_font_scale_factor_sidebar);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_LABEL:
|
||||
#ifdef HAVE_OZONE
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_font_scale_factor_label);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_SUBLABEL:
|
||||
#ifdef HAVE_OZONE
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_font_scale_factor_sublabel);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_TIME:
|
||||
#ifdef HAVE_OZONE
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_font_scale_factor_time);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_FOOTER:
|
||||
#ifdef HAVE_OZONE
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_font_scale_factor_footer);
|
||||
#endif
|
||||
break;
|
||||
case MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME:
|
||||
|
|
|
@ -573,6 +573,13 @@ struct ozone_handle
|
|||
float last_scale_factor;
|
||||
float last_thumbnail_scale_factor;
|
||||
float last_padding_factor;
|
||||
float last_font_scale_factor_global;
|
||||
float last_font_scale_factor_title;
|
||||
float last_font_scale_factor_sidebar;
|
||||
float last_font_scale_factor_label;
|
||||
float last_font_scale_factor_sublabel;
|
||||
float last_font_scale_factor_time;
|
||||
float last_font_scale_factor_footer;
|
||||
float pure_white[16];
|
||||
|
||||
struct
|
||||
|
@ -9404,6 +9411,14 @@ static void ozone_set_layout(
|
|||
bool font_inited = false;
|
||||
float scale_factor = ozone->last_scale_factor;
|
||||
float padding_factor = settings->floats.ozone_padding_factor;
|
||||
unsigned font_scale = settings->uints.menu_ozone_font_scale;
|
||||
float font_scale_factor_global = (font_scale == 1) ? (settings->floats.ozone_font_scale_factor_global) : 1.0f;
|
||||
float font_scale_factor_title = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_title) : 1.0f;
|
||||
float font_scale_factor_sidebar = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_sidebar) : 1.0f;
|
||||
float font_scale_factor_label = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_label) : 1.0f;
|
||||
float font_scale_factor_sublabel = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_sublabel) : 1.0f;
|
||||
float font_scale_factor_time = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_time) : 1.0f;
|
||||
float font_scale_factor_footer = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_footer) : 1.0f;
|
||||
|
||||
/* Calculate dimensions */
|
||||
ozone->dimensions.header_height = HEADER_HEIGHT * scale_factor;
|
||||
|
@ -9483,7 +9498,7 @@ static void ozone_set_layout(
|
|||
strlcpy(font_path, path_menu_font, sizeof(font_path));
|
||||
|
||||
font_inited = ozone_init_font(&ozone->fonts.title,
|
||||
is_threaded, font_path, FONT_SIZE_TITLE * scale_factor);
|
||||
is_threaded, font_path, FONT_SIZE_TITLE * scale_factor * font_scale_factor_global * font_scale_factor_title);
|
||||
if (!(((ozone->flags & OZONE_FLAG_HAS_ALL_ASSETS) > 0) && font_inited))
|
||||
ozone->flags &= ~OZONE_FLAG_HAS_ALL_ASSETS;
|
||||
|
||||
|
@ -9513,31 +9528,31 @@ static void ozone_set_layout(
|
|||
|
||||
/* Sidebar */
|
||||
font_inited = ozone_init_font(&ozone->fonts.sidebar,
|
||||
is_threaded, font_path, FONT_SIZE_SIDEBAR * scale_factor);
|
||||
is_threaded, font_path, FONT_SIZE_SIDEBAR * scale_factor * font_scale_factor_global * font_scale_factor_sidebar);
|
||||
if (!(((ozone->flags & OZONE_FLAG_HAS_ALL_ASSETS) > 0) && font_inited))
|
||||
ozone->flags &= ~OZONE_FLAG_HAS_ALL_ASSETS;
|
||||
|
||||
/* Entries */
|
||||
font_inited = ozone_init_font(&ozone->fonts.entries_label,
|
||||
is_threaded, font_path, FONT_SIZE_ENTRIES_LABEL * scale_factor);
|
||||
is_threaded, font_path, FONT_SIZE_ENTRIES_LABEL * scale_factor * font_scale_factor_global * font_scale_factor_label);
|
||||
if (!(((ozone->flags & OZONE_FLAG_HAS_ALL_ASSETS) > 0) && font_inited))
|
||||
ozone->flags &= ~OZONE_FLAG_HAS_ALL_ASSETS;
|
||||
|
||||
/* Sublabels */
|
||||
font_inited = ozone_init_font(&ozone->fonts.entries_sublabel,
|
||||
is_threaded, font_path, FONT_SIZE_ENTRIES_SUBLABEL * scale_factor);
|
||||
is_threaded, font_path, FONT_SIZE_ENTRIES_SUBLABEL * scale_factor * font_scale_factor_global * font_scale_factor_sublabel);
|
||||
if (!(((ozone->flags & OZONE_FLAG_HAS_ALL_ASSETS) > 0) && font_inited))
|
||||
ozone->flags &= ~OZONE_FLAG_HAS_ALL_ASSETS;
|
||||
|
||||
/* Time */
|
||||
font_inited = ozone_init_font(&ozone->fonts.time,
|
||||
is_threaded, font_path, FONT_SIZE_TIME * scale_factor);
|
||||
is_threaded, font_path, FONT_SIZE_TIME * scale_factor * font_scale_factor_global * font_scale_factor_time);
|
||||
if (!(((ozone->flags & OZONE_FLAG_HAS_ALL_ASSETS) > 0) && font_inited))
|
||||
ozone->flags &= ~OZONE_FLAG_HAS_ALL_ASSETS;
|
||||
|
||||
/* Footer */
|
||||
font_inited = ozone_init_font(&ozone->fonts.footer,
|
||||
is_threaded, font_path, FONT_SIZE_FOOTER * scale_factor);
|
||||
is_threaded, font_path, FONT_SIZE_FOOTER * scale_factor * font_scale_factor_global * font_scale_factor_footer);
|
||||
if (!(((ozone->flags & OZONE_FLAG_HAS_ALL_ASSETS) > 0) && font_inited))
|
||||
ozone->flags &= ~OZONE_FLAG_HAS_ALL_ASSETS;
|
||||
|
||||
|
@ -10103,6 +10118,13 @@ static void ozone_render(void *data,
|
|||
volatile float scale_factor;
|
||||
volatile float thumbnail_scale_factor;
|
||||
volatile float padding_factor;
|
||||
volatile float font_scale_factor_global;
|
||||
volatile float font_scale_factor_title;
|
||||
volatile float font_scale_factor_sidebar;
|
||||
volatile float font_scale_factor_label;
|
||||
volatile float font_scale_factor_sublabel;
|
||||
volatile float font_scale_factor_time;
|
||||
volatile float font_scale_factor_footer;
|
||||
struct menu_state *menu_st = menu_state_get_ptr();
|
||||
menu_input_t *menu_input = &menu_st->input_state;
|
||||
menu_list_t *menu_list = menu_st->entries.list;
|
||||
|
@ -10114,28 +10136,50 @@ static void ozone_render(void *data,
|
|||
gfx_animation_t *p_anim = anim_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool ozone_collapse_sidebar = settings->bools.ozone_collapse_sidebar;
|
||||
unsigned font_scale = settings->uints.menu_ozone_font_scale;
|
||||
|
||||
if (!ozone)
|
||||
return;
|
||||
|
||||
/* Check whether screen dimensions or menu scale
|
||||
* factor have changed */
|
||||
scale_factor = gfx_display_get_dpi_scale(p_disp, settings,
|
||||
width, height, false, false);
|
||||
thumbnail_scale_factor = settings->floats.ozone_thumbnail_scale_factor;
|
||||
padding_factor = settings->floats.ozone_padding_factor;
|
||||
scale_factor = gfx_display_get_dpi_scale(p_disp, settings,
|
||||
width, height, false, false);
|
||||
thumbnail_scale_factor = settings->floats.ozone_thumbnail_scale_factor;
|
||||
padding_factor = settings->floats.ozone_padding_factor;
|
||||
font_scale_factor_global = (font_scale == 1) ? (settings->floats.ozone_font_scale_factor_global) : 1.0f;
|
||||
font_scale_factor_title = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_title) : 1.0f;
|
||||
font_scale_factor_sidebar = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_sidebar) : 1.0f;
|
||||
font_scale_factor_label = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_label) : 1.0f;
|
||||
font_scale_factor_sublabel = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_sublabel) : 1.0f;
|
||||
font_scale_factor_time = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_time) : 1.0f;
|
||||
font_scale_factor_footer = (font_scale == 2) ? (settings->floats.ozone_font_scale_factor_footer) : 1.0f;
|
||||
|
||||
if ( (scale_factor != ozone->last_scale_factor)
|
||||
|| (thumbnail_scale_factor != ozone->last_thumbnail_scale_factor)
|
||||
|| (padding_factor != ozone->last_padding_factor)
|
||||
|| (font_scale_factor_global != ozone->last_font_scale_factor_global)
|
||||
|| (font_scale_factor_title != ozone->last_font_scale_factor_title)
|
||||
|| (font_scale_factor_sidebar != ozone->last_font_scale_factor_sidebar)
|
||||
|| (font_scale_factor_label != ozone->last_font_scale_factor_label)
|
||||
|| (font_scale_factor_sublabel != ozone->last_font_scale_factor_sublabel)
|
||||
|| (font_scale_factor_time != ozone->last_font_scale_factor_time)
|
||||
|| (font_scale_factor_footer != ozone->last_font_scale_factor_footer)
|
||||
|| (width != ozone->last_width)
|
||||
|| (height != ozone->last_height))
|
||||
{
|
||||
ozone->last_scale_factor = scale_factor;
|
||||
ozone->last_thumbnail_scale_factor = thumbnail_scale_factor;
|
||||
ozone->last_padding_factor = padding_factor;
|
||||
ozone->last_width = width;
|
||||
ozone->last_height = height;
|
||||
ozone->last_scale_factor = scale_factor;
|
||||
ozone->last_thumbnail_scale_factor = thumbnail_scale_factor;
|
||||
ozone->last_padding_factor = padding_factor;
|
||||
ozone->last_font_scale_factor_global = font_scale_factor_global;
|
||||
ozone->last_font_scale_factor_title = font_scale_factor_title;
|
||||
ozone->last_font_scale_factor_sidebar = font_scale_factor_sidebar;
|
||||
ozone->last_font_scale_factor_label = font_scale_factor_label;
|
||||
ozone->last_font_scale_factor_sublabel = font_scale_factor_sublabel;
|
||||
ozone->last_font_scale_factor_time = font_scale_factor_time;
|
||||
ozone->last_font_scale_factor_footer = font_scale_factor_footer;
|
||||
ozone->last_width = width;
|
||||
ozone->last_height = height;
|
||||
|
||||
/* Note: We don't need a full context reset here
|
||||
* > Just rescale layout, and reset frame time counter */
|
||||
|
|
|
@ -447,6 +447,14 @@ enum ozone_header_separator
|
|||
OZONE_HEADER_SEPARATOR_LAST
|
||||
};
|
||||
|
||||
enum ozone_font_scale
|
||||
{
|
||||
OZONE_FONT_SCALE_NONE = 0,
|
||||
OZONE_FONT_SCALE_GLOBAL,
|
||||
OZONE_FONT_SCALE_SEPARATE,
|
||||
OZONE_FONT_SCALE_LAST
|
||||
};
|
||||
|
||||
enum menu_action
|
||||
{
|
||||
MENU_ACTION_NOOP = 0,
|
||||
|
|
|
@ -11732,6 +11732,7 @@ unsigned menu_displaylist_build_list(
|
|||
unsigned menu_rgui_color_theme = settings->uints.menu_rgui_color_theme;
|
||||
unsigned menu_rgui_particle_effect = settings->uints.menu_rgui_particle_effect;
|
||||
unsigned menu_screensaver_timeout = settings->uints.menu_screensaver_timeout;
|
||||
unsigned ozone_font_scale = settings->uints.menu_ozone_font_scale;
|
||||
|
||||
menu_displaylist_build_info_selective_t build_list[] = {
|
||||
{MENU_ENUM_LABEL_MENU_SCALE_FACTOR, PARSE_ONLY_FLOAT, true},
|
||||
|
@ -11795,6 +11796,14 @@ unsigned menu_displaylist_build_list(
|
|||
{MENU_ENUM_LABEL_MENU_THUMBNAIL_BACKGROUND_ENABLE, PARSE_ONLY_BOOL, true},
|
||||
{MENU_ENUM_LABEL_XMB_FONT, PARSE_ONLY_PATH, true},
|
||||
{MENU_ENUM_LABEL_OZONE_FONT, PARSE_ONLY_PATH, true},
|
||||
{MENU_ENUM_LABEL_OZONE_FONT_SCALE, PARSE_ONLY_UINT, true},
|
||||
{MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_GLOBAL, PARSE_ONLY_FLOAT, false},
|
||||
{MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_TITLE, PARSE_ONLY_FLOAT, false},
|
||||
{MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_SIDEBAR, PARSE_ONLY_FLOAT, false},
|
||||
{MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_LABEL, PARSE_ONLY_FLOAT, false},
|
||||
{MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_SUBLABEL, PARSE_ONLY_FLOAT, false},
|
||||
{MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_TIME, PARSE_ONLY_FLOAT, false},
|
||||
{MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_FOOTER, PARSE_ONLY_FLOAT, false},
|
||||
{MENU_ENUM_LABEL_MENU_FONT_COLOR_RED, PARSE_ONLY_UINT, true},
|
||||
{MENU_ENUM_LABEL_MENU_FONT_COLOR_GREEN, PARSE_ONLY_UINT, true},
|
||||
{MENU_ENUM_LABEL_MENU_FONT_COLOR_BLUE, PARSE_ONLY_UINT, true},
|
||||
|
@ -11854,6 +11863,19 @@ unsigned menu_displaylist_build_list(
|
|||
if (!menu_use_preferred_system_color_theme)
|
||||
build_list[i].checked = true;
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_GLOBAL:
|
||||
if (ozone_font_scale == 1)
|
||||
build_list[i].checked = true;
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_TITLE:
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_SIDEBAR:
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_LABEL:
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_SUBLABEL:
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_TIME:
|
||||
case MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_FOOTER:
|
||||
if (ozone_font_scale == 2)
|
||||
build_list[i].checked = true;
|
||||
break;
|
||||
case MENU_ENUM_LABEL_OZONE_SORT_AFTER_TRUNCATE_PLAYLIST_NAME:
|
||||
if (truncate_playlist)
|
||||
build_list[i].checked = true;
|
||||
|
|
|
@ -4713,6 +4713,30 @@ static size_t setting_get_string_representation_uint_ozone_header_separator(
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
static size_t setting_get_string_representation_uint_ozone_font_scale(
|
||||
rarch_setting_t *setting, char *s, size_t len)
|
||||
{
|
||||
if (setting)
|
||||
{
|
||||
switch (*setting->value.target.unsigned_integer)
|
||||
{
|
||||
case OZONE_FONT_SCALE_SEPARATE:
|
||||
return strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_SEPARATE), len);
|
||||
case OZONE_FONT_SCALE_GLOBAL:
|
||||
return strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_GLOBAL), len);
|
||||
case OZONE_FONT_SCALE_NONE:
|
||||
default:
|
||||
return strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_OFF), len);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
|
||||
|
@ -19736,6 +19760,129 @@ static bool setting_append_list(
|
|||
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_REINIT);
|
||||
SETTINGS_DATA_LIST_CURRENT_ADD_FLAGS(list, list_info, SD_FLAG_LAKKA_ADVANCED);
|
||||
|
||||
CONFIG_UINT(
|
||||
list, list_info,
|
||||
&settings->uints.menu_ozone_font_scale,
|
||||
MENU_ENUM_LABEL_OZONE_FONT_SCALE,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE,
|
||||
DEFAULT_OZONE_FONT_SCALE,
|
||||
&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].action_left = setting_uint_action_left_with_refresh;
|
||||
(*list)[list_info->index - 1].action_right = setting_uint_action_right_with_refresh;
|
||||
(*list)[list_info->index - 1].get_string_representation =
|
||||
&setting_get_string_representation_uint_ozone_font_scale;
|
||||
menu_settings_list_current_add_range(list, list_info, 0, OZONE_FONT_SCALE_LAST-1, 1, true, true);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.ozone_font_scale_factor_global,
|
||||
MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_GLOBAL,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_GLOBAL,
|
||||
DEFAULT_OZONE_FONT_SCALE_FACTOR_GLOBAL,
|
||||
"%.2fx",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
menu_settings_list_current_add_range(list, list_info, 0.0, 3.0, 0.05, true, true);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.ozone_font_scale_factor_title,
|
||||
MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_TITLE,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_TITLE,
|
||||
DEFAULT_OZONE_FONT_SCALE_FACTOR_TITLE,
|
||||
"%.2fx",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
menu_settings_list_current_add_range(list, list_info, 0.0, 3.0, 0.05, true, true);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.ozone_font_scale_factor_sidebar,
|
||||
MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_SIDEBAR,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_SIDEBAR,
|
||||
DEFAULT_OZONE_FONT_SCALE_FACTOR_SIDEBAR,
|
||||
"%.2fx",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
menu_settings_list_current_add_range(list, list_info, 0.0, 3.0, 0.05, true, true);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.ozone_font_scale_factor_label,
|
||||
MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_LABEL,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_LABEL,
|
||||
DEFAULT_OZONE_FONT_SCALE_FACTOR_LABEL,
|
||||
"%.2fx",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
menu_settings_list_current_add_range(list, list_info, 0.0, 3.0, 0.05, true, true);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.ozone_font_scale_factor_sublabel,
|
||||
MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_SUBLABEL,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_SUBLABEL,
|
||||
DEFAULT_OZONE_FONT_SCALE_FACTOR_SUBLABEL,
|
||||
"%.2fx",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
menu_settings_list_current_add_range(list, list_info, 0.0, 3.0, 0.05, true, true);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.ozone_font_scale_factor_time,
|
||||
MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_TIME,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_TIME,
|
||||
DEFAULT_OZONE_FONT_SCALE_FACTOR_TIME,
|
||||
"%.2fx",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
menu_settings_list_current_add_range(list, list_info, 0.0, 3.0, 0.05, true, true);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.ozone_font_scale_factor_footer,
|
||||
MENU_ENUM_LABEL_OZONE_FONT_SCALE_FACTOR_FOOTER,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_FACTOR_FOOTER,
|
||||
DEFAULT_OZONE_FONT_SCALE_FACTOR_FOOTER,
|
||||
"%.2fx",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
menu_settings_list_current_add_range(list, list_info, 0.0, 3.0, 0.05, true, true);
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.ozone_scroll_content_metadata,
|
||||
|
|
12
msg_hash.h
12
msg_hash.h
|
@ -741,6 +741,10 @@ enum msg_hash_enums
|
|||
MENU_ENUM_LABEL_VALUE_OZONE_HEADER_SEPARATOR_NORMAL,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_HEADER_SEPARATOR_MAXIMUM,
|
||||
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_NONE,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_GLOBAL,
|
||||
MENU_ENUM_LABEL_VALUE_OZONE_FONT_SCALE_SEPARATE,
|
||||
|
||||
MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_MONOCHROME,
|
||||
MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_MONOCHROME_INVERTED,
|
||||
MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_FLATUI,
|
||||
|
@ -1643,6 +1647,14 @@ enum msg_hash_enums
|
|||
MENU_LABEL(OZONE_HEADER_SEPARATOR),
|
||||
MENU_LABEL(OZONE_COLLAPSE_SIDEBAR),
|
||||
MENU_LABEL(OZONE_FONT),
|
||||
MENU_LABEL(OZONE_FONT_SCALE),
|
||||
MENU_LABEL(OZONE_FONT_SCALE_FACTOR_GLOBAL),
|
||||
MENU_LABEL(OZONE_FONT_SCALE_FACTOR_TITLE),
|
||||
MENU_LABEL(OZONE_FONT_SCALE_FACTOR_SIDEBAR),
|
||||
MENU_LABEL(OZONE_FONT_SCALE_FACTOR_LABEL),
|
||||
MENU_LABEL(OZONE_FONT_SCALE_FACTOR_SUBLABEL),
|
||||
MENU_LABEL(OZONE_FONT_SCALE_FACTOR_TIME),
|
||||
MENU_LABEL(OZONE_FONT_SCALE_FACTOR_FOOTER),
|
||||
MENU_LABEL(OZONE_TRUNCATE_PLAYLIST_NAME),
|
||||
MENU_LABEL(OZONE_SORT_AFTER_TRUNCATE_PLAYLIST_NAME),
|
||||
MENU_LABEL(OZONE_SCROLL_CONTENT_METADATA),
|
||||
|
|
Loading…
Reference in New Issue