Merge pull request from jdgleaver/ozone-themes

(Ozone) Add 'Nord' and 'Gruvbox Dark' themes
This commit is contained in:
Twinaphex 2020-02-24 20:34:06 +01:00 committed by GitHub
commit 2d99847529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 171 additions and 5 deletions

View File

@ -9165,6 +9165,14 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_BASIC_BLACK,
"Basic Black"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_NORD,
"Nord"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_GRUVBOX_DARK,
"Gruvbox Dark"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_OZONE_MENU_COLOR_THEME,
"Select a different color theme."

View File

@ -1179,7 +1179,12 @@ static void ozone_render(void *data,
ozone->cursor_x_old = ozone->pointer.x;
ozone->cursor_y_old = ozone->pointer.y;
pointer_enabled = ozone->cursor_mode && !ozone->show_fullscreen_thumbnails;
/* Pointer is disabled when showing fullscreen
* thumbnails, and when the on-screen keyboard
* is active */
pointer_enabled = ozone->cursor_mode &&
!ozone->show_fullscreen_thumbnails &&
!menu_input_dialog_get_display_kb();
/* Process pointer input, if required */
if (pointer_enabled)

View File

@ -76,9 +76,80 @@ ozone_theme_t ozone_theme_dark = {
"dark"
};
ozone_theme_t ozone_theme_nord = {
/* Background color */
COLOR_HEX_TO_FLOAT(0x2E3440, 1.0f), /* background */
ozone_background_libretro_running_nord, /* background_libretro_running */
/* Float colors for quads and icons */
COLOR_HEX_TO_FLOAT(0xD8DEE9, 1.0f), /* header_footer_separator */
COLOR_HEX_TO_FLOAT(0xECEFF4, 1.0f), /* text */
COLOR_HEX_TO_FLOAT(0x232730, 1.0f), /* selection */
COLOR_HEX_TO_FLOAT(0x73A1BE, 1.0f), /* selection_border */
COLOR_HEX_TO_FLOAT(0x4C566A, 1.0f), /* entries_border */
COLOR_HEX_TO_FLOAT(0xE5E9F0, 1.0f), /* entries_icon */
COLOR_HEX_TO_FLOAT(0xA9C791, 1.0f), /* text_selected */
COLOR_HEX_TO_FLOAT(0x434C5E, 1.0f), /* message_background */
/* RGBA colors for text */
0xECEFF4FF, /* text_rgba */
0xA9C791FF, /* text_selected_rgba */
0x8FBCBBFF, /* text_sublabel_rgba */
/* Sidebar color */
ozone_sidebar_background_nord, /* <TODO> sidebar_background */
ozone_sidebar_gradient_top_nord, /* <TODO> sidebar_top_gradient */
ozone_sidebar_gradient_bottom_nord, /* <TODO> sidebar_bottom_gradient */
/* Fancy cursor colors */
ozone_border_0_nord, /* cursor_border_0 */
ozone_border_1_nord, /* cursor_border_1 */
{0}, /* textures */
"nord" /* name */
};
ozone_theme_t ozone_theme_gruvbox_dark = {
/* Background color */
COLOR_HEX_TO_FLOAT(0x282828, 1.0f), /* background */
ozone_background_libretro_running_gruvbox_dark, /* background_libretro_running */
/* Float colors for quads and icons */
COLOR_HEX_TO_FLOAT(0xD5C4A1, 1.0f), /* header_footer_separator */
COLOR_HEX_TO_FLOAT(0xEBDBB2, 1.0f), /* text */
COLOR_HEX_TO_FLOAT(0x1D2021, 1.0f), /* selection */
COLOR_HEX_TO_FLOAT(0xD75D0E, 1.0f), /* selection_border */
COLOR_HEX_TO_FLOAT(0x665C54, 1.0f), /* entries_border */
COLOR_HEX_TO_FLOAT(0xEBDBB2, 1.0f), /* entries_icon */
COLOR_HEX_TO_FLOAT(0x8EC07C, 1.0f), /* text_selected */
COLOR_HEX_TO_FLOAT(0x32302F, 1.0f), /* message_background */
/* RGBA colors for text */
0xEBDBB2FF, /* text_rgba */
0x8EC07CFF, /* text_selected_rgba */
0xD79921FF, /* text_sublabel_rgba */
/* Sidebar color */
ozone_sidebar_background_gruvbox_dark, /* sidebar_background */
ozone_sidebar_gradient_top_gruvbox_dark, /* sidebar_top_gradient */
ozone_sidebar_gradient_bottom_gruvbox_dark, /* sidebar_bottom_gradient */
/* Fancy cursor colors */
ozone_border_0_gruvbox_dark, /* cursor_border_0 */
ozone_border_1_gruvbox_dark, /* cursor_border_1 */
{0}, /* textures */
"gruvbox_dark" /* name */
};
ozone_theme_t *ozone_themes[] = {
&ozone_theme_light,
&ozone_theme_dark
&ozone_theme_dark,
&ozone_theme_nord,
&ozone_theme_gruvbox_dark
};
unsigned ozone_themes_count = sizeof(ozone_themes) / sizeof(ozone_themes[0]);
@ -101,11 +172,17 @@ void ozone_set_color_theme(ozone_handle_t *ozone, unsigned color_theme)
switch (color_theme)
{
case 0:
theme = &ozone_theme_light;
break;
case 1:
theme = &ozone_theme_dark;
break;
case 0:
theme = &ozone_theme_light;
case 2:
theme = &ozone_theme_nord;
break;
case 3:
theme = &ozone_theme_gruvbox_dark;
break;
default:
break;

View File

@ -85,12 +85,60 @@ static float ozone_sidebar_gradient_bottom_dark[16] = {
0.2, 0.2, 0.2, 1.00,
};
static float ozone_sidebar_background_nord[16] = {
0.2078431f, 0.2352941f, 0.2901961f, 1.0f,
0.2078431f, 0.2352941f, 0.2901961f, 1.0f,
0.2078431f, 0.2352941f, 0.2901961f, 1.0f,
0.2078431f, 0.2352941f, 0.2901961f, 1.0f,
};
static float ozone_sidebar_gradient_top_nord[16] = {
0.2078431f, 0.2352941f, 0.2901961f, 1.0f,
0.2078431f, 0.2352941f, 0.2901961f, 1.0f,
0.1921569f, 0.2196078f, 0.2705882f, 0.9f,
0.1921569f, 0.2196078f, 0.2705882f, 0.9f,
};
static float ozone_sidebar_gradient_bottom_nord[16] = {
0.1921569f, 0.2196078f, 0.2705882f, 0.9f,
0.1921569f, 0.2196078f, 0.2705882f, 0.9f,
0.2078431f, 0.2352941f, 0.2901961f, 1.0f,
0.2078431f, 0.2352941f, 0.2901961f, 1.0f,
};
static float ozone_sidebar_background_gruvbox_dark[16] = {
0.1960784f, 0.1882353f, 0.1843137f, 1.0f,
0.1960784f, 0.1882353f, 0.1843137f, 1.0f,
0.1960784f, 0.1882353f, 0.1843137f, 1.0f,
0.1960784f, 0.1882353f, 0.1843137f, 1.0f,
};
static float ozone_sidebar_gradient_top_gruvbox_dark[16] = {
0.1960784f, 0.1882353f, 0.1843137f, 1.0f,
0.1960784f, 0.1882353f, 0.1843137f, 1.0f,
0.1686275f, 0.1686275f, 0.1686275f, 0.9f,
0.1686275f, 0.1686275f, 0.1686275f, 0.9f,
};
static float ozone_sidebar_gradient_bottom_gruvbox_dark[16] = {
0.1686275f, 0.1686275f, 0.1686275f, 0.9f,
0.1686275f, 0.1686275f, 0.1686275f, 0.9f,
0.1960784f, 0.1882353f, 0.1843137f, 1.0f,
0.1960784f, 0.1882353f, 0.1843137f, 1.0f,
};
static float ozone_border_0_light[16] = COLOR_HEX_TO_FLOAT(0x50EFD9, 1.00);
static float ozone_border_1_light[16] = COLOR_HEX_TO_FLOAT(0x0DB6D5, 1.00);
static float ozone_border_0_dark[16] = COLOR_HEX_TO_FLOAT(0x198AC6, 1.00);
static float ozone_border_1_dark[16] = COLOR_HEX_TO_FLOAT(0x89F1F2, 1.00);
static float ozone_border_0_nord[16] = COLOR_HEX_TO_FLOAT(0x5E81AC, 1.0f);
static float ozone_border_1_nord[16] = COLOR_HEX_TO_FLOAT(0x88C0D0, 1.0f);
static float ozone_border_0_gruvbox_dark[16] = COLOR_HEX_TO_FLOAT(0xAF3A03, 1.0f);
static float ozone_border_1_gruvbox_dark[16] = COLOR_HEX_TO_FLOAT(0xFE8019, 1.0f);
static float ozone_background_libretro_running_light[16] = {
0.690, 0.690, 0.690, 0.75,
0.690, 0.690, 0.690, 0.75,
@ -105,6 +153,20 @@ static float ozone_background_libretro_running_dark[16] = {
0.178, 0.178, 0.178, 1.0,
};
static float ozone_background_libretro_running_nord[16] = {
0.1803922f, 0.2039216f, 0.2509804f, 0.75f,
0.1803922f, 0.2039216f, 0.2509804f, 0.75f,
0.1803922f, 0.2039216f, 0.2509804f, 1.0f,
0.1803922f, 0.2039216f, 0.2509804f, 1.0f,
};
static float ozone_background_libretro_running_gruvbox_dark[16] = {
0.1568627f, 0.1568627f, 0.1568627f, 0.75f,
0.1568627f, 0.1568627f, 0.1568627f, 0.75f,
0.1568627f, 0.1568627f, 0.1568627f, 1.0f,
0.1568627f, 0.1568627f, 0.1568627f, 1.0f,
};
typedef struct ozone_theme
{
/* Background color */
@ -144,6 +206,8 @@ typedef struct ozone_theme
extern ozone_theme_t ozone_theme_light;
extern ozone_theme_t ozone_theme_dark;
extern ozone_theme_t ozone_theme_nord;
extern ozone_theme_t ozone_theme_gruvbox_dark;
extern ozone_theme_t *ozone_themes[];

View File

@ -4215,6 +4215,16 @@ static void setting_get_string_representation_uint_ozone_menu_color_theme(
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_BASIC_BLACK), len);
break;
case 2:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_NORD), len);
break;
case 3:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_GRUVBOX_DARK), len);
break;
case 0:
default:
strlcpy(s,
@ -13767,7 +13777,7 @@ static bool setting_append_list(
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*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);
menu_settings_list_current_add_range(list, list_info, 0, 3, 1, true, true);
(*list)[list_info->index - 1].ui_type = ST_UI_TYPE_UINT_COMBOBOX;
CONFIG_BOOL(

View File

@ -569,6 +569,8 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_BASIC_WHITE,
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_BASIC_BLACK,
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_NORD,
MENU_ENUM_LABEL_VALUE_OZONE_COLOR_THEME_GRUVBOX_DARK,
MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_MONOCHROME,
MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_MONOCHROME_INVERTED,