From 54c45bd54e026d10646eb386c85452ae094f5dee Mon Sep 17 00:00:00 2001 From: jdgleaver Date: Thu, 15 Apr 2021 12:31:33 +0100 Subject: [PATCH] (RGUI) Add option to disable menu transparency --- config.def.h | 1 + configuration.c | 1 + configuration.h | 1 + intl/msg_hash_lbl.h | 4 + intl/msg_hash_us.h | 8 + menu/cbs/menu_cbs_sublabel.c | 4 + menu/drivers/rgui.c | 674 ++++++++++++++++++++++++++++++----- menu/menu_displaylist.c | 12 +- menu/menu_setting.c | 23 ++ msg_hash.h | 1 + 10 files changed, 635 insertions(+), 94 deletions(-) diff --git a/config.def.h b/config.def.h index b7518420a2..56999e908e 100644 --- a/config.def.h +++ b/config.def.h @@ -669,6 +669,7 @@ static const float menu_header_opacity = 1.000; #define DEFAULT_SHOW_ADVANCED_SETTINGS false #define DEFAULT_RGUI_COLOR_THEME RGUI_THEME_CLASSIC_GREEN +#define DEFAULT_RGUI_TRANSPARENCY true static const bool rgui_inline_thumbnails = false; static const bool rgui_swap_thumbnails = false; diff --git a/configuration.c b/configuration.c index ce58499661..f27376525b 100644 --- a/configuration.c +++ b/configuration.c @@ -1666,6 +1666,7 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("rgui_background_filler_thickness_enable", &settings->bools.menu_rgui_background_filler_thickness_enable, true, true, false); SETTING_BOOL("rgui_border_filler_thickness_enable", &settings->bools.menu_rgui_border_filler_thickness_enable, true, true, false); SETTING_BOOL("rgui_border_filler_enable", &settings->bools.menu_rgui_border_filler_enable, true, true, false); + SETTING_BOOL("menu_rgui_transparency", &settings->bools.menu_rgui_transparency, true, DEFAULT_RGUI_TRANSPARENCY, false); SETTING_BOOL("menu_rgui_shadows", &settings->bools.menu_rgui_shadows, true, rgui_shadows, false); SETTING_BOOL("menu_rgui_full_width_layout", &settings->bools.menu_rgui_full_width_layout, true, rgui_full_width_layout, false); SETTING_BOOL("rgui_inline_thumbnails", &settings->bools.menu_rgui_inline_thumbnails, true, rgui_inline_thumbnails, false); diff --git a/configuration.h b/configuration.h index 4c7dcd6bfe..e03455679b 100644 --- a/configuration.h +++ b/configuration.h @@ -610,6 +610,7 @@ typedef struct settings bool menu_rgui_border_filler_thickness_enable; bool menu_rgui_border_filler_enable; bool menu_rgui_full_width_layout; + bool menu_rgui_transparency; bool menu_rgui_shadows; bool menu_rgui_inline_thumbnails; bool menu_rgui_swap_thumbnails; diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index a2e27a1440..dca4d8c9ce 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -4148,6 +4148,10 @@ MSG_HASH( MENU_ENUM_LABEL_MENU_RGUI_FULL_WIDTH_LAYOUT, "menu_rgui_full_width_layout" ) +MSG_HASH( + MENU_ENUM_LABEL_MENU_RGUI_TRANSPARENCY, + "menu_rgui_transparency" + ) MSG_HASH( MENU_ENUM_LABEL_MENU_RGUI_SHADOWS, "menu_rgui_shadows" diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index bc725fc145..4c354ac29c 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -8214,6 +8214,14 @@ MSG_HASH( MENU_ENUM_SUBLABEL_RGUI_MENU_THEME_PRESET, "Select a menu theme preset from the file browser." ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_MENU_RGUI_TRANSPARENCY, + "Menu Transparency" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_MENU_RGUI_TRANSPARENCY, + "Enable background display of running content while Quick Menu is active. Disabling transparency may alter theme colors." + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_MENU_RGUI_SHADOWS, "Shadow Effects" diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index a07a17a551..4193cfe8d3 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -916,6 +916,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_linear_filter, DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_aspect_ratio_lock, MENU_ENUM_SUBLABEL_MENU_RGUI_ASPECT_RATIO_LOCK) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_rgui_menu_color_theme, MENU_ENUM_SUBLABEL_RGUI_MENU_COLOR_THEME) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_rgui_menu_theme_preset, MENU_ENUM_SUBLABEL_RGUI_MENU_THEME_PRESET) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_transparency, MENU_ENUM_SUBLABEL_MENU_RGUI_TRANSPARENCY) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_shadows, MENU_ENUM_SUBLABEL_MENU_RGUI_SHADOWS) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_particle_effect, MENU_ENUM_SUBLABEL_MENU_RGUI_PARTICLE_EFFECT) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_particle_effect_speed, MENU_ENUM_SUBLABEL_MENU_RGUI_PARTICLE_EFFECT_SPEED) @@ -4041,6 +4042,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_rgui_menu_theme_preset); break; + case MENU_ENUM_LABEL_MENU_RGUI_TRANSPARENCY: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_rgui_transparency); + break; case MENU_ENUM_LABEL_MENU_RGUI_SHADOWS: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_rgui_shadows); break; diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 32a48f8b2f..4bd62b09f3 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -128,6 +128,18 @@ static const rgui_theme_t rgui_theme_classic_red = { 0xC09E8686 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_classic_red = { + 0xFFFF362B, /* hover_color */ + 0xFFFFFFFF, /* normal_color */ + 0xFFFF362B, /* title_color */ + 0xFF1B1B1B, /* bg_dark_color */ + 0xFF363636, /* bg_light_color */ + 0xFF6D0000, /* border_dark_color */ + 0xFFA30000, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF7A6D6D /* particle_color */ +}; + static const rgui_theme_t rgui_theme_classic_orange = { 0xFFF87217, /* hover_color */ 0xFFFFFFFF, /* normal_color */ @@ -140,6 +152,18 @@ static const rgui_theme_t rgui_theme_classic_orange = { 0xC09E9286 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_classic_orange = { + 0xFFF87217, /* hover_color */ + 0xFFFFFFFF, /* normal_color */ + 0xFFF87217, /* title_color */ + 0xFF1B1B1B, /* bg_dark_color */ + 0xFF363636, /* bg_light_color */ + 0xFF7A1B00, /* border_dark_color */ + 0xFFBE5200, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF7A7A6D /* particle_color */ +}; + static const rgui_theme_t rgui_theme_classic_yellow = { 0xFFFFD801, /* hover_color */ 0xFFFFFFFF, /* normal_color */ @@ -152,6 +176,18 @@ static const rgui_theme_t rgui_theme_classic_yellow = { 0xC0999581 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_classic_yellow = { + 0xFFFFD801, /* hover_color */ + 0xFFFFFFFF, /* normal_color */ + 0xFFFFD801, /* title_color */ + 0xFF1B1B1B, /* bg_dark_color */ + 0xFF363636, /* bg_light_color */ + 0xFF885F00, /* border_dark_color */ + 0xFFCCA300, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF7A7A6D /* particle_color */ +}; + static const rgui_theme_t rgui_theme_classic_green = { 0xFF64FF64, /* hover_color */ 0xFFFFFFFF, /* normal_color */ @@ -164,6 +200,18 @@ static const rgui_theme_t rgui_theme_classic_green = { 0xC0879E87 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_classic_green = { + 0xFF64FF64, /* hover_color */ + 0xFFFFFFFF, /* normal_color */ + 0xFF64FF64, /* title_color */ + 0xFF1B1B1B, /* bg_dark_color */ + 0xFF363636, /* bg_light_color */ + 0xFF1B361B, /* border_dark_color */ + 0xFF366D36, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF6D7A6D /* particle_color */ +}; + static const rgui_theme_t rgui_theme_classic_blue = { 0xFF48BEFF, /* hover_color */ 0xFFFFFFFF, /* normal_color */ @@ -176,6 +224,18 @@ static const rgui_theme_t rgui_theme_classic_blue = { 0xC086949E /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_classic_blue = { + 0xFF48BEFF, /* hover_color */ + 0xFFFFFFFF, /* normal_color */ + 0xFF48BEFF, /* title_color */ + 0xFF1B1B1B, /* bg_dark_color */ + 0xFF363636, /* bg_light_color */ + 0xFF004488, /* border_dark_color */ + 0xFF1B7ABE, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF6D7A7A /* particle_color */ +}; + static const rgui_theme_t rgui_theme_classic_violet = { 0xFFD86EFF, /* hover_color */ 0xFFFFFFFF, /* normal_color */ @@ -188,6 +248,18 @@ static const rgui_theme_t rgui_theme_classic_violet = { 0xC08E8299 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_classic_violet = { + 0xFFD86EFF, /* hover_color */ + 0xFFFFFFFF, /* normal_color */ + 0xFFD86EFF, /* title_color */ + 0xFF1B1B1B, /* bg_dark_color */ + 0xFF363636, /* bg_light_color */ + 0xFF360052, /* border_dark_color */ + 0xFF6D1BA3, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF6D6D7A /* particle_color */ +}; + static const rgui_theme_t rgui_theme_classic_grey = { 0xFFB6C1C7, /* hover_color */ 0xFFFFFFFF, /* normal_color */ @@ -200,6 +272,18 @@ static const rgui_theme_t rgui_theme_classic_grey = { 0xC078828A /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_classic_grey = { + 0xFFB6C1C7, /* hover_color */ + 0xFFFFFFFF, /* normal_color */ + 0xFFB6C1C7, /* title_color */ + 0xFF1B1B1B, /* bg_dark_color */ + 0xFF363636, /* bg_light_color */ + 0xFF444444, /* border_dark_color */ + 0xFF5F6D7A, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF5F6D6D /* particle_color */ +}; + static const rgui_theme_t rgui_theme_legacy_red = { 0xFFFFBDBD, /* hover_color */ 0xFFFAF6D5, /* normal_color */ @@ -212,6 +296,18 @@ static const rgui_theme_t rgui_theme_legacy_red = { 0xC0F75431 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_legacy_red = { + 0xFFFFBDBD, /* hover_color */ + 0xFFFAF6D5, /* normal_color */ + 0xFFFF948A, /* title_color */ + 0xFF7A3629, /* bg_dark_color */ + 0xFF963636, /* bg_light_color */ + 0xFF964444, /* border_dark_color */ + 0xFFCC5F52, /* border_light_color */ + 0xFF0E0000, /* shadow_color */ + 0xFFCC4429 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_dark_purple = { 0xFFF2B5D6, /* hover_color */ 0xFFE8D0CC, /* normal_color */ @@ -224,6 +320,18 @@ static const rgui_theme_t rgui_theme_dark_purple = { 0xC09786A0 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_dark_purple = { + 0xFFF2B5D6, /* hover_color */ + 0xFFE8D0CC, /* normal_color */ + 0xFFC79FC2, /* title_color */ + 0xFF441B44, /* bg_dark_color */ + 0xFF522952, /* bg_light_color */ + 0xFF6D446D, /* border_dark_color */ + 0xFF885F88, /* border_light_color */ + 0xFF0E000E, /* shadow_color */ + 0xFF7A6D88 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_midnight_blue = { 0xFFB2D3ED, /* hover_color */ 0xFFD3DCDE, /* normal_color */ @@ -236,6 +344,18 @@ static const rgui_theme_t rgui_theme_midnight_blue = { 0xC084849E /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_midnight_blue = { + 0xFFB2D3ED, /* hover_color */ + 0xFFD3DCDE, /* normal_color */ + 0xFF86A1BA, /* title_color */ + 0xFF1B2936, /* bg_dark_color */ + 0xFF293644, /* bg_light_color */ + 0xFF364452, /* border_dark_color */ + 0xFF525F7A, /* border_light_color */ + 0xFF00000E, /* shadow_color */ + 0xFF6D6D7A /* particle_color */ +}; + static const rgui_theme_t rgui_theme_golden = { 0xFFFFE666, /* hover_color */ 0xFFFFFFDC, /* normal_color */ @@ -248,6 +368,18 @@ static const rgui_theme_t rgui_theme_golden = { 0xC0F7D15E /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_golden = { + 0xFFFFE666, /* hover_color */ + 0xFFFFFFDC, /* normal_color */ + 0xFFFFCC00, /* title_color */ + 0xFF966D00, /* bg_dark_color */ + 0xFF967A1B, /* bg_light_color */ + 0xFFBE881B, /* border_dark_color */ + 0xFFCCA30E, /* border_light_color */ + 0xFF291B00, /* shadow_color */ + 0xFFCCB144 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_electric_blue = { 0xFF7DF9FF, /* hover_color */ 0xFFDBE9F4, /* normal_color */ @@ -260,6 +392,18 @@ static const rgui_theme_t rgui_theme_electric_blue = { 0xC080C7E6 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_electric_blue = { + 0xFF7DF9FF, /* hover_color */ + 0xFFDBE9F4, /* normal_color */ + 0xFF86CDE0, /* title_color */ + 0xFF1B52A3, /* bg_dark_color */ + 0xFF0065D9, /* bg_light_color */ + 0xFF2988B1, /* border_dark_color */ + 0xFF5FA3CC, /* border_light_color */ + 0xFF0E1B36, /* shadow_color */ + 0xFF6DA3BE /* particle_color */ +}; + static const rgui_theme_t rgui_theme_apple_green = { 0xFFB0FC64, /* hover_color */ 0xFFD8F2CB, /* normal_color */ @@ -272,6 +416,18 @@ static const rgui_theme_t rgui_theme_apple_green = { 0xC0A3C44E /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_apple_green = { + 0xFFB0FC64, /* hover_color */ + 0xFFD8F2CB, /* normal_color */ + 0xFFA6D652, /* title_color */ + 0xFF365F36, /* bg_dark_color */ + 0xFF526D29, /* bg_light_color */ + 0xFF526D29, /* border_dark_color */ + 0xFF7A965F, /* border_light_color */ + 0xFF0E1B0E, /* shadow_color */ + 0xFF88A336 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_volcanic_red = { 0xFFFFCC99, /* hover_color */ 0xFFD3D3D3, /* normal_color */ @@ -284,6 +440,18 @@ static const rgui_theme_t rgui_theme_volcanic_red = { 0xC0E67D45 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_volcanic_red = { + 0xFFFFCC99, /* hover_color */ + 0xFFD3D3D3, /* normal_color */ + 0xFFDDADAF, /* title_color */ + 0xFF7A1B1B, /* bg_dark_color */ + 0xFF96000E, /* bg_light_color */ + 0xFFA31B1B, /* border_dark_color */ + 0xFFCC0000, /* border_light_color */ + 0xFF290000, /* shadow_color */ + 0xFFBE5F36 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_lagoon = { 0xFFBCE1EB, /* hover_color */ 0xFFCFCFC4, /* normal_color */ @@ -296,6 +464,18 @@ static const rgui_theme_t rgui_theme_lagoon = { 0xC09FB1C7 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_lagoon = { + 0xFFBCE1EB, /* hover_color */ + 0xFFCFCFC4, /* normal_color */ + 0xFF86C7C7, /* title_color */ + 0xFF364452, /* bg_dark_color */ + 0xFF44525F, /* bg_light_color */ + 0xFF446D6D, /* border_dark_color */ + 0xFF527A7A, /* border_light_color */ + 0xFF0E1B1B, /* shadow_color */ + 0xFF7A96A3 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_brogrammer = { 0xFF3498DB, /* hover_color */ 0xFFECF0F1, /* normal_color */ @@ -308,6 +488,18 @@ static const rgui_theme_t rgui_theme_brogrammer = { 0xC0606060 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_brogrammer = { + 0xFF3498DB, /* hover_color */ + 0xFFECF0F1, /* normal_color */ + 0xFF2ECC71, /* title_color */ + 0xFF1B1B1B, /* bg_dark_color */ + 0xFF1B1B1B, /* bg_light_color */ + 0xFFBE3629, /* border_dark_color */ + 0xFFBE3629, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF525252 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_dracula = { 0xFFBD93F9, /* hover_color */ 0xFFF8F8F2, /* normal_color */ @@ -320,6 +512,18 @@ static const rgui_theme_t rgui_theme_dracula = { 0xC06272A4 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_dracula = { + 0xFFBD93F9, /* hover_color */ + 0xFFF8F8F2, /* normal_color */ + 0xFFFF79C6, /* title_color */ + 0xFF1B2936, /* bg_dark_color */ + 0xFF1B2936, /* bg_light_color */ + 0xFF525F88, /* border_dark_color */ + 0xFF525F88, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF525F88 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_fairyfloss = { 0xFFFFF352, /* hover_color */ 0xFFF8F8F2, /* normal_color */ @@ -332,6 +536,18 @@ static const rgui_theme_t rgui_theme_fairyfloss = { 0xC0C5A3FF /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_fairyfloss = { + 0xFFFFF352, /* hover_color */ + 0xFFF8F8F2, /* normal_color */ + 0xFFFFB8D1, /* title_color */ + 0xFF52446D, /* bg_dark_color */ + 0xFF52446D, /* bg_light_color */ + 0xFF706087, /* border_dark_color */ + 0xFF706087, /* border_light_color */ + 0xFF1B1B29, /* shadow_color */ + 0xFFA388CC /* particle_color */ +}; + static const rgui_theme_t rgui_theme_flatui = { 0xFF0A74B9, /* hover_color */ 0xFF2C3E50, /* normal_color */ @@ -344,6 +560,18 @@ static const rgui_theme_t rgui_theme_flatui = { 0xE0B3DFFF /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_flatui = { + 0xFF0A74B9, /* hover_color */ + 0xFF2C3E50, /* normal_color */ + 0xFF8E44AD, /* title_color */ + 0xFFDEEEEE, /* bg_dark_color */ + 0xFFDEEEEE, /* bg_light_color */ + 0xFF8F9F9F, /* border_dark_color */ + 0xFF8F9F9F, /* border_light_color */ + 0xFFBECECE, /* shadow_color */ + 0xFFAFCEEE /* particle_color */ +}; + static const rgui_theme_t rgui_theme_gruvbox_dark = { 0xFFFE8019, /* hover_color */ 0xFFEBDBB2, /* normal_color */ @@ -356,6 +584,18 @@ static const rgui_theme_t rgui_theme_gruvbox_dark = { 0xC098971A /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_gruvbox_dark = { + 0xFFFE8019, /* hover_color */ + 0xFFEBDBB2, /* normal_color */ + 0xFF83A598, /* title_color */ + 0xFF292929, /* bg_dark_color */ + 0xFF292929, /* bg_light_color */ + 0xFF7A6D5F, /* border_dark_color */ + 0xFF7A6D5F, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF7A7A0E /* particle_color */ +}; + static const rgui_theme_t rgui_theme_gruvbox_light = { 0xFFAF3A03, /* hover_color */ 0xFF3C3836, /* normal_color */ @@ -368,6 +608,18 @@ static const rgui_theme_t rgui_theme_gruvbox_light = { 0xE0D5C4A1 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_gruvbox_light = { + 0xFFAF3A03, /* hover_color */ + 0xFF3C3836, /* normal_color */ + 0xFF076678, /* title_color */ + 0xFFEEDEBE, /* bg_dark_color */ + 0xFFEEDEBE, /* bg_light_color */ + 0xFF8F7F6F, /* border_dark_color */ + 0xFF8F7F6F, /* border_light_color */ + 0xFFCEBE9F, /* shadow_color */ + 0xFFCEBE9F /* particle_color */ +}; + static const rgui_theme_t rgui_theme_hacking_the_kernel = { 0xFF83FF83, /* hover_color */ 0xFF00E000, /* normal_color */ @@ -380,6 +632,18 @@ static const rgui_theme_t rgui_theme_hacking_the_kernel = { 0xC0008C00 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_hacking_the_kernel = { + 0xFF83FF83, /* hover_color */ + 0xFF00E000, /* normal_color */ + 0xFF00FF00, /* title_color */ + 0xFF000000, /* bg_dark_color */ + 0xFF000000, /* bg_light_color */ + 0xFF005200, /* border_dark_color */ + 0xFF005200, /* border_light_color */ + 0xFF0E361B, /* shadow_color */ + 0xFF006D00 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_nord = { 0xFF8FBCBB, /* hover_color */ 0xFFD8DEE9, /* normal_color */ @@ -392,6 +656,18 @@ static const rgui_theme_t rgui_theme_nord = { 0xC05E81AC /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_nord = { + 0xFF8FBCBB, /* hover_color */ + 0xFFD8DEE9, /* normal_color */ + 0xFF81A1C1, /* title_color */ + 0xFF292936, /* bg_dark_color */ + 0xFF292936, /* bg_light_color */ + 0xFF364452, /* border_dark_color */ + 0xFF364452, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF446D88 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_nova = { 0XFF7FC1CA, /* hover_color */ 0XFFC5D4DD, /* normal_color */ @@ -404,6 +680,18 @@ static const rgui_theme_t rgui_theme_nova = { 0xC0889BA7 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_nova = { + 0XFF7FC1CA, /* hover_color */ + 0XFFC5D4DD, /* normal_color */ + 0XFF9A93E1, /* title_color */ + 0xFF364452, /* bg_dark_color */ + 0xFF364452, /* bg_light_color */ + 0xFF546370, /* border_dark_color */ + 0xFF546370, /* border_light_color */ + 0xFF0E1B1B, /* shadow_color */ + 0xFF6D7A88 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_one_dark = { 0XFF98C379, /* hover_color */ 0XFFBBBBBB, /* normal_color */ @@ -416,6 +704,18 @@ static const rgui_theme_t rgui_theme_one_dark = { 0xC05F697A /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_one_dark = { + 0XFF98C379, /* hover_color */ + 0XFFBBBBBB, /* normal_color */ + 0XFFD19A66, /* title_color */ + 0xFF1B2929, /* bg_dark_color */ + 0xFF1B2929, /* bg_light_color */ + 0xFF364452, /* border_dark_color */ + 0xFF364452, /* border_light_color */ + 0xFF000000, /* shadow_color */ + 0xFF44525F /* particle_color */ +}; + static const rgui_theme_t rgui_theme_palenight = { 0xFFC792EA, /* hover_color */ 0xFFBFC7D5, /* normal_color */ @@ -428,6 +728,18 @@ static const rgui_theme_t rgui_theme_palenight = { 0xC0697098 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_palenight = { + 0xFFC792EA, /* hover_color */ + 0xFFBFC7D5, /* normal_color */ + 0xFF82AAFF, /* title_color */ + 0xFF1B2936, /* bg_dark_color */ + 0xFF1B2936, /* bg_light_color */ + 0xFF51617A, /* border_dark_color */ + 0xFF51617A, /* border_light_color */ + 0xFF00000E, /* shadow_color */ + 0xFF525F7A /* particle_color */ +}; + static const rgui_theme_t rgui_theme_solarized_dark = { 0xFFB58900, /* hover_color */ 0xFF839496, /* normal_color */ @@ -440,6 +752,18 @@ static const rgui_theme_t rgui_theme_solarized_dark = { 0xC0586E75 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_solarized_dark = { + 0xFFB58900, /* hover_color */ + 0xFF839496, /* normal_color */ + 0xFF268BD2, /* title_color */ + 0xFF002936, /* bg_dark_color */ + 0xFF002936, /* bg_light_color */ + 0xFF7A8888, /* border_dark_color */ + 0xFF7A8888, /* border_light_color */ + 0xFF000E0E, /* shadow_color */ + 0xFF44525F /* particle_color */ +}; + static const rgui_theme_t rgui_theme_solarized_light = { 0xFFB58900, /* hover_color */ 0xFF657B83, /* normal_color */ @@ -452,6 +776,18 @@ static const rgui_theme_t rgui_theme_solarized_light = { 0xE0FFC5AD /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_solarized_light = { + 0xFFB58900, /* hover_color */ + 0xFF657B83, /* normal_color */ + 0xFF268BD2, /* title_color */ + 0xFFEEDECE, /* bg_dark_color */ + 0xFFEEDECE, /* bg_light_color */ + 0xFF8F9F9F, /* border_dark_color */ + 0xFF8F9F9F, /* border_light_color */ + 0xFFDECEBE, /* shadow_color */ + 0xFFEEBE9F /* particle_color */ +}; + static const rgui_theme_t rgui_theme_tango_dark = { 0xFF8AE234, /* hover_color */ 0xFFEEEEEC, /* normal_color */ @@ -464,6 +800,18 @@ static const rgui_theme_t rgui_theme_tango_dark = { 0xC0C4A000 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_tango_dark = { + 0xFF8AE234, /* hover_color */ + 0xFFEEEEEC, /* normal_color */ + 0xFF729FCF, /* title_color */ + 0xFF293636, /* bg_dark_color */ + 0xFF293636, /* bg_light_color */ + 0xFF556160, /* border_dark_color */ + 0xFF556160, /* border_light_color */ + 0xFF0E0E0E, /* shadow_color */ + 0xFFA38800 /* particle_color */ +}; + static const rgui_theme_t rgui_theme_tango_light = { 0xFF4E9A06, /* hover_color */ 0xFF2E3436, /* normal_color */ @@ -476,6 +824,18 @@ static const rgui_theme_t rgui_theme_tango_light = { 0xE0FFCA78 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_tango_light = { + 0xFF4E9A06, /* hover_color */ + 0xFF2E3436, /* normal_color */ + 0xFF204A87, /* title_color */ + 0xFFDEDEDE, /* bg_dark_color */ + 0xFFDEDEDE, /* bg_light_color */ + 0xFFBEBEBE, /* border_dark_color */ + 0xFFBEBEBE, /* border_light_color */ + 0xFFCECEBE, /* shadow_color */ + 0xFFEEBE6F /* particle_color */ +}; + static const rgui_theme_t rgui_theme_zenburn = { 0xFFF0DFAF, /* hover_color */ 0xFFDCDCCC, /* normal_color */ @@ -488,6 +848,18 @@ static const rgui_theme_t rgui_theme_zenburn = { 0xC0AC7373 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_zenburn = { + 0xFFF0DFAF, /* hover_color */ + 0xFFDCDCCC, /* normal_color */ + 0xFF8FB28F, /* title_color */ + 0xFF363636, /* bg_dark_color */ + 0xFF363636, /* bg_light_color */ + 0xFF505050, /* border_dark_color */ + 0xFF505050, /* border_light_color */ + 0xFF0E0E0E, /* shadow_color */ + 0xFF885F5F /* particle_color */ +}; + static const rgui_theme_t rgui_theme_anti_zenburn = { 0xFF336C6C, /* hover_color */ 0xFF232333, /* normal_color */ @@ -500,6 +872,18 @@ static const rgui_theme_t rgui_theme_anti_zenburn = { 0xE0B090B0 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_anti_zenburn = { + 0xFF336C6C, /* hover_color */ + 0xFF232333, /* normal_color */ + 0xFF205070, /* title_color */ + 0xFFBEBEBE, /* bg_dark_color */ + 0xFFBEBEBE, /* bg_light_color */ + 0xFF9F9F9F, /* border_dark_color */ + 0xFF9F9F9F, /* border_light_color */ + 0xFFAFAFAF, /* shadow_color */ + 0xFFAF8FAF /* particle_color */ +}; + static const rgui_theme_t rgui_theme_flux = { 0xFF6FCB9F, /* hover_color */ 0xFF666547, /* normal_color */ @@ -512,6 +896,18 @@ static const rgui_theme_t rgui_theme_flux = { 0xE0FB2E01 /* particle_color */ }; +static const rgui_theme_t rgui_theme_opaque_flux = { + 0xFF6FCB9F, /* hover_color */ + 0xFF666547, /* normal_color */ + 0xFFFB2E01, /* title_color */ + 0xFFEEEEAF, /* bg_dark_color */ + 0xFFEEEEAF, /* bg_light_color */ + 0xFFEEDE7F, /* border_dark_color */ + 0xFFEEDE7F, /* border_light_color */ + 0xFFEEDE7F, /* shadow_color */ + 0xFFEE2000 /* particle_color */ +}; + typedef struct { uint16_t hover_color; @@ -662,6 +1058,8 @@ typedef struct bool bg_thickness; bool border_thickness; bool border_enable; + bool transparency_supported; + bool transparency_enable; bool shadow_enable; bool extended_ascii_enable; bool is_playlist; @@ -957,11 +1355,11 @@ static const uint8_t rgui_symbol_data_switch_off_right[RGUI_SYMBOL_WIDTH * RGUI_ static uint16_t argb32_to_abgr1555(uint32_t col) { /* Extract colour components */ - unsigned a = (col >> 24) & 0xff; - unsigned r = (col >> 16) & 0xff; - unsigned g = (col >> 8) & 0xff; - unsigned b = col & 0xff; - if (a < 0xff) + unsigned a = (col >> 24) & 0xFF; + unsigned r = (col >> 16) & 0xFF; + unsigned g = (col >> 8) & 0xFF; + unsigned b = col & 0xFF; + if (a < 0xFF) { /* Background and border colours are normally semi-transparent * (so we can see suspended content when opening the quick menu). @@ -974,10 +1372,10 @@ static uint16_t argb32_to_abgr1555(uint32_t col) * become abnormally bright. * We therefore have to darken each RGB value according to the alpha * component of the input colour... */ - float a_factor = (float)a * (1.0 / 255.0); - r = (unsigned)(((float)r * a_factor) + 0.5) & 0xff; - g = (unsigned)(((float)g * a_factor) + 0.5) & 0xff; - b = (unsigned)(((float)b * a_factor) + 0.5) & 0xff; + float a_factor = (float)a * (1.0f / 255.0f); + r = (unsigned)(((float)r * a_factor) + 0.5f) & 0xFF; + g = (unsigned)(((float)g * a_factor) + 0.5f) & 0xFF; + b = (unsigned)(((float)b * a_factor) + 0.5f) & 0xFF; } /* Convert from 8 bit to 5 bit */ r = r >> 3; @@ -991,12 +1389,12 @@ static uint16_t argb32_to_abgr1555(uint32_t col) static uint16_t argb32_to_rgb5a3(uint32_t col) { /* Extract colour components */ - unsigned a = (col >> 24) & 0xff; - unsigned r = (col >> 16) & 0xff; - unsigned g = (col >> 8) & 0xff; - unsigned b = col & 0xff; - unsigned a3 = a >> 5; - if (a < 0xff) + unsigned a = (col >> 24) & 0xFF; + unsigned r = (col >> 16) & 0xFF; + unsigned g = (col >> 8) & 0xFF; + unsigned b = col & 0xFF; + unsigned a3 = a >> 5; + if (a < 0xFF) { /* Gekko platforms only have a 3 bit alpha channel, which * is one bit less than all 'standard' target platforms. @@ -1005,22 +1403,22 @@ static uint16_t argb32_to_rgb5a3(uint32_t col) * borders to appear too bright. We therefore have to darken * each RGB component according to the difference between Gekko * alpha and normal 4 bit alpha values... */ - unsigned a4 = a >> 4; - float a_factor = 1.0; + unsigned a4 = a >> 4; + float a_factor = 1.0f; if (a3 > 0) { /* Avoid divide by zero errors... */ - a_factor = ((float)a4 * (1.0 / 15.0)) / ((float)a3 * (1.0 / 7.0)); + a_factor = ((float)a4 * (1.0f / 15.0f)) / ((float)a3 * (1.0f / 7.0f)); } - r = (unsigned)(((float)r * a_factor) + 0.5); - g = (unsigned)(((float)g * a_factor) + 0.5); - b = (unsigned)(((float)b * a_factor) + 0.5); + r = (unsigned)(((float)r * a_factor) + 0.5f); + g = (unsigned)(((float)g * a_factor) + 0.5f); + b = (unsigned)(((float)b * a_factor) + 0.5f); /* a_factor can actually be greater than 1. This will never happen * with the current preset theme colour values, but users can set * any custom values they like, so we have to play it safe... */ - r = (r <= 0xff) ? r : 0xff; - g = (g <= 0xff) ? g : 0xff; - b = (b <= 0xff) ? b : 0xff; + r = (r <= 0xFF) ? r : 0xFF; + g = (g <= 0xFF) ? g : 0xFF; + b = (b <= 0xFF) ? b : 0xFF; } /* Convert RGB from 8 bit to 4 bit */ r = r >> 4; @@ -1033,20 +1431,20 @@ static uint16_t argb32_to_rgb5a3(uint32_t col) /* PSP */ static uint16_t argb32_to_abgr4444(uint32_t col) { - unsigned a = ((col >> 24) & 0xff) >> 4; - unsigned r = ((col >> 16) & 0xff) >> 4; - unsigned g = ((col >> 8) & 0xff) >> 4; - unsigned b = ((col & 0xff) ) >> 4; + unsigned a = ((col >> 24) & 0xFF) >> 4; + unsigned r = ((col >> 16) & 0xFF) >> 4; + unsigned g = ((col >> 8) & 0xFF) >> 4; + unsigned b = ( col & 0xFF) >> 4; return (a << 12) | (b << 8) | (g << 4) | r; } /* D3D10/11/12 */ static uint16_t argb32_to_bgra4444(uint32_t col) { - unsigned a = ((col >> 24) & 0xff) >> 4; - unsigned r = ((col >> 16) & 0xff) >> 4; - unsigned g = ((col >> 8) & 0xff) >> 4; - unsigned b = ((col & 0xff) ) >> 4; + unsigned a = ((col >> 24) & 0xFF) >> 4; + unsigned r = ((col >> 16) & 0xFF) >> 4; + unsigned g = ((col >> 8) & 0xFF) >> 4; + unsigned b = ( col & 0xFF) >> 4; return (b << 12) | (g << 8) | (r << 4) | a; } @@ -1054,19 +1452,19 @@ static uint16_t argb32_to_bgra4444(uint32_t col) static uint16_t argb32_to_rgb565(uint32_t col) { /* Extract colour components */ - unsigned a = (col >> 24) & 0xff; - unsigned r = (col >> 16) & 0xff; - unsigned g = (col >> 8) & 0xff; - unsigned b = col & 0xff; - if (a < 0xff) + unsigned a = (col >> 24) & 0xFF; + unsigned r = (col >> 16) & 0xFF; + unsigned g = (col >> 8) & 0xFF; + unsigned b = col & 0xFF; + if (a < 0xFF) { /* RGB565 has no alpha component - as with PS2 colour conversion, * have to darken each RGB value according to the alpha component * of the input colour... */ - float a_factor = (float)a * (1.0 / 255.0); - r = (unsigned)(((float)r * a_factor) + 0.5) & 0xff; - g = (unsigned)(((float)g * a_factor) + 0.5) & 0xff; - b = (unsigned)(((float)b * a_factor) + 0.5) & 0xff; + float a_factor = (float)a * (1.0f / 255.0f); + r = (unsigned)(((float)r * a_factor) + 0.5f) & 0xFF; + g = (unsigned)(((float)g * a_factor) + 0.5f) & 0xFF; + b = (unsigned)(((float)b * a_factor) + 0.5f) & 0xFF; } /* Convert from 8 bit to 5 bit */ r = r >> 3; @@ -1079,28 +1477,34 @@ static uint16_t argb32_to_rgb565(uint32_t col) /* All other platforms */ static uint16_t argb32_to_rgba4444(uint32_t col) { - unsigned a = ((col >> 24) & 0xff) >> 4; - unsigned r = ((col >> 16) & 0xff) >> 4; - unsigned g = ((col >> 8) & 0xff) >> 4; - unsigned b = ((col & 0xff) ) >> 4; + unsigned a = ((col >> 24) & 0xFF) >> 4; + unsigned r = ((col >> 16) & 0xFF) >> 4; + unsigned g = ((col >> 8) & 0xFF) >> 4; + unsigned b = ( col & 0xFF) >> 4; return (r << 12) | (g << 8) | (b << 4) | a; } static uint16_t (*argb32_to_pixel_platform_format)(uint32_t col) = argb32_to_rgba4444; -static void rgui_set_pixel_format_function(void) +/* Returns true if current pixel format supports + * framebuffer transparency */ +static bool rgui_set_pixel_format_function(void) { - const char *driver_ident = video_driver_get_ident(); + const char *driver_ident = video_driver_get_ident(); + bool transparency_supported = true; /* Default fallback... */ if (string_is_empty(driver_ident)) { argb32_to_pixel_platform_format = argb32_to_rgba4444; - return; + return transparency_supported; } if ( string_is_equal(driver_ident, "ps2")) /* PS2 */ + { argb32_to_pixel_platform_format = argb32_to_abgr1555; + transparency_supported = false; + } else if (string_is_equal(driver_ident, "gx")) /* GEKKO */ argb32_to_pixel_platform_format = argb32_to_rgb5a3; else if (string_is_equal(driver_ident, "psp1")) /* PSP */ @@ -1110,9 +1514,14 @@ static void rgui_set_pixel_format_function(void) string_is_equal(driver_ident, "d3d12")) argb32_to_pixel_platform_format = argb32_to_bgra4444; else if (string_is_equal(driver_ident, "sdl_dingux")) /* DINGUX SDL */ + { argb32_to_pixel_platform_format = argb32_to_rgb565; + transparency_supported = false; + } else argb32_to_pixel_platform_format = argb32_to_rgba4444; + + return transparency_supported; } /* ============================== @@ -2433,79 +2842,150 @@ static void rgui_render_mini_thumbnail( static const rgui_theme_t *get_theme(rgui_t *rgui) { + bool transparent = rgui->transparency_supported && + rgui->transparency_enable; + switch (rgui->color_theme) { case RGUI_THEME_CLASSIC_RED: - return &rgui_theme_classic_red; + return transparent ? + &rgui_theme_classic_red : + &rgui_theme_opaque_classic_red; case RGUI_THEME_CLASSIC_ORANGE: - return &rgui_theme_classic_orange; + return transparent ? + &rgui_theme_classic_orange : + &rgui_theme_opaque_classic_orange; case RGUI_THEME_CLASSIC_YELLOW: - return &rgui_theme_classic_yellow; + return transparent ? + &rgui_theme_classic_yellow : + &rgui_theme_opaque_classic_yellow; case RGUI_THEME_CLASSIC_GREEN: - return &rgui_theme_classic_green; + return transparent ? + &rgui_theme_classic_green : + &rgui_theme_opaque_classic_green; case RGUI_THEME_CLASSIC_BLUE: - return &rgui_theme_classic_blue; + return transparent ? + &rgui_theme_classic_blue : + &rgui_theme_opaque_classic_blue; case RGUI_THEME_CLASSIC_VIOLET: - return &rgui_theme_classic_violet; + return transparent ? + &rgui_theme_classic_violet : + &rgui_theme_opaque_classic_violet; case RGUI_THEME_CLASSIC_GREY: - return &rgui_theme_classic_grey; + return transparent ? + &rgui_theme_classic_grey : + &rgui_theme_opaque_classic_grey; case RGUI_THEME_LEGACY_RED: - return &rgui_theme_legacy_red; + return transparent ? + &rgui_theme_legacy_red : + &rgui_theme_opaque_legacy_red; case RGUI_THEME_DARK_PURPLE: - return &rgui_theme_dark_purple; + return transparent ? + &rgui_theme_dark_purple : + &rgui_theme_opaque_dark_purple; case RGUI_THEME_MIDNIGHT_BLUE: - return &rgui_theme_midnight_blue; + return transparent ? + &rgui_theme_midnight_blue : + &rgui_theme_opaque_midnight_blue; case RGUI_THEME_GOLDEN: - return &rgui_theme_golden; + return transparent ? + &rgui_theme_golden : + &rgui_theme_opaque_golden; case RGUI_THEME_ELECTRIC_BLUE: - return &rgui_theme_electric_blue; + return transparent ? + &rgui_theme_electric_blue : + &rgui_theme_opaque_electric_blue; case RGUI_THEME_APPLE_GREEN: - return &rgui_theme_apple_green; + return transparent ? + &rgui_theme_apple_green : + &rgui_theme_opaque_apple_green; case RGUI_THEME_VOLCANIC_RED: - return &rgui_theme_volcanic_red; + return transparent ? + &rgui_theme_volcanic_red : + &rgui_theme_opaque_volcanic_red; case RGUI_THEME_LAGOON: - return &rgui_theme_lagoon; + return transparent ? + &rgui_theme_lagoon : + &rgui_theme_opaque_lagoon; case RGUI_THEME_BROGRAMMER: - return &rgui_theme_brogrammer; + return transparent ? + &rgui_theme_brogrammer : + &rgui_theme_opaque_brogrammer; case RGUI_THEME_DRACULA: - return &rgui_theme_dracula; + return transparent ? + &rgui_theme_dracula : + &rgui_theme_opaque_dracula; case RGUI_THEME_FAIRYFLOSS: - return &rgui_theme_fairyfloss; + return transparent ? + &rgui_theme_fairyfloss : + &rgui_theme_opaque_fairyfloss; case RGUI_THEME_FLATUI: - return &rgui_theme_flatui; + return transparent ? + &rgui_theme_flatui : + &rgui_theme_opaque_flatui; case RGUI_THEME_GRUVBOX_DARK: - return &rgui_theme_gruvbox_dark; + return transparent ? + &rgui_theme_gruvbox_dark : + &rgui_theme_opaque_gruvbox_dark; case RGUI_THEME_GRUVBOX_LIGHT: - return &rgui_theme_gruvbox_light; + return transparent ? + &rgui_theme_gruvbox_light : + &rgui_theme_opaque_gruvbox_light; case RGUI_THEME_HACKING_THE_KERNEL: - return &rgui_theme_hacking_the_kernel; + return transparent ? + &rgui_theme_hacking_the_kernel : + &rgui_theme_opaque_hacking_the_kernel; case RGUI_THEME_NORD: - return &rgui_theme_nord; + return transparent ? + &rgui_theme_nord : + &rgui_theme_opaque_nord; case RGUI_THEME_NOVA: - return &rgui_theme_nova; + return transparent ? + &rgui_theme_nova : + &rgui_theme_opaque_nova; case RGUI_THEME_ONE_DARK: - return &rgui_theme_one_dark; + return transparent ? + &rgui_theme_one_dark : + &rgui_theme_opaque_one_dark; case RGUI_THEME_PALENIGHT: - return &rgui_theme_palenight; + return transparent ? + &rgui_theme_palenight : + &rgui_theme_opaque_palenight; case RGUI_THEME_SOLARIZED_DARK: - return &rgui_theme_solarized_dark; + return transparent ? + &rgui_theme_solarized_dark : + &rgui_theme_opaque_solarized_dark; case RGUI_THEME_SOLARIZED_LIGHT: - return &rgui_theme_solarized_light; + return transparent ? + &rgui_theme_solarized_light : + &rgui_theme_opaque_solarized_light; case RGUI_THEME_TANGO_DARK: - return &rgui_theme_tango_dark; + return transparent ? + &rgui_theme_tango_dark : + &rgui_theme_opaque_tango_dark; case RGUI_THEME_TANGO_LIGHT: - return &rgui_theme_tango_light; + return transparent ? + &rgui_theme_tango_light : + &rgui_theme_opaque_tango_light; case RGUI_THEME_ZENBURN: - return &rgui_theme_zenburn; + return transparent ? + &rgui_theme_zenburn : + &rgui_theme_opaque_zenburn; case RGUI_THEME_ANTI_ZENBURN: - return &rgui_theme_anti_zenburn; + return transparent ? + &rgui_theme_anti_zenburn : + &rgui_theme_opaque_anti_zenburn; case RGUI_THEME_FLUX: - return &rgui_theme_flux; + return transparent ? + &rgui_theme_flux : + &rgui_theme_opaque_flux; default: break; } - return &rgui_theme_classic_green; + return transparent ? + &rgui_theme_classic_green : + &rgui_theme_opaque_classic_green; } static void load_custom_theme(rgui_t *rgui, rgui_theme_t *theme_colors, const char *theme_path) @@ -2640,15 +3120,19 @@ end: else { /* Use 'Classic Green' fallback */ - theme_colors->normal_color = rgui_theme_classic_green.normal_color; - theme_colors->hover_color = rgui_theme_classic_green.hover_color; - theme_colors->title_color = rgui_theme_classic_green.title_color; - theme_colors->bg_dark_color = rgui_theme_classic_green.bg_dark_color; - theme_colors->bg_light_color = rgui_theme_classic_green.bg_light_color; - theme_colors->border_dark_color = rgui_theme_classic_green.border_dark_color; - theme_colors->border_light_color = rgui_theme_classic_green.border_light_color; - theme_colors->shadow_color = rgui_theme_classic_green.shadow_color; - theme_colors->particle_color = rgui_theme_classic_green.particle_color; + const rgui_theme_t *fallback_theme = + (rgui->transparency_supported && rgui->transparency_enable) ? + &rgui_theme_classic_green : &rgui_theme_opaque_classic_green; + + theme_colors->normal_color = fallback_theme->normal_color; + theme_colors->hover_color = fallback_theme->hover_color; + theme_colors->title_color = fallback_theme->title_color; + theme_colors->bg_dark_color = fallback_theme->bg_dark_color; + theme_colors->bg_light_color = fallback_theme->bg_light_color; + theme_colors->border_dark_color = fallback_theme->border_dark_color; + theme_colors->border_light_color = fallback_theme->border_light_color; + theme_colors->shadow_color = fallback_theme->shadow_color; + theme_colors->particle_color = fallback_theme->particle_color; } if (conf) @@ -2688,8 +3172,10 @@ static void prepare_rgui_colors(rgui_t *rgui, settings_t *settings) uint32_t ss_particle_color_argb32; unsigned rgui_color_theme = settings->uints.menu_rgui_color_theme; const char *rgui_theme_preset = settings->paths.path_rgui_theme_preset; + bool rgui_transparency = settings->bools.menu_rgui_transparency; rgui->color_theme = rgui_color_theme; + rgui->transparency_enable = rgui_transparency; rgui->show_wallpaper = false; if (rgui->color_theme == RGUI_THEME_CUSTOM) @@ -5306,7 +5792,7 @@ static void *rgui_init(void **userdata, bool video_is_threaded) rgui->menu_sublabel[0] = '\0'; /* Set pixel format conversion function */ - rgui_set_pixel_format_function(); + rgui->transparency_supported = rgui_set_pixel_format_function(); /* Initialise fonts */ if (!rgui_fonts_init(rgui)) @@ -6144,7 +6630,9 @@ static void rgui_frame(void *data, video_frame_info_t *video_info) rgui->force_redraw = true; } - if (settings->uints.menu_rgui_color_theme != rgui->color_theme) + if ((settings->uints.menu_rgui_color_theme != rgui->color_theme) || + (rgui->transparency_supported && + (settings->bools.menu_rgui_transparency != rgui->transparency_enable))) prepare_rgui_colors(rgui, settings); else if (settings->uints.menu_rgui_color_theme == RGUI_THEME_CUSTOM) { diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index c48e9b0c65..6b0816ceb4 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -8857,6 +8857,7 @@ unsigned menu_displaylist_build_list( bool menu_materialui_icons_enable = settings->bools.menu_materialui_icons_enable; bool menu_materialui_show_nav_bar = settings->bools.menu_materialui_show_nav_bar; bool menu_use_preferred_system_color_theme = settings->bools.menu_use_preferred_system_color_theme; + 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; @@ -8879,7 +8880,8 @@ unsigned menu_displaylist_build_list( {MENU_ENUM_LABEL_MENU_XMB_ANIMATION_MOVE_UP_DOWN, PARSE_ONLY_UINT, true}, {MENU_ENUM_LABEL_MENU_XMB_ANIMATION_OPENING_MAIN_MENU, PARSE_ONLY_UINT, true}, {MENU_ENUM_LABEL_RGUI_MENU_COLOR_THEME, PARSE_ONLY_UINT, true}, - {MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET, PARSE_ONLY_PATH, true}, + {MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET, PARSE_ONLY_PATH, false}, + {MENU_ENUM_LABEL_MENU_RGUI_TRANSPARENCY, PARSE_ONLY_BOOL, false}, {MENU_ENUM_LABEL_MENU_RGUI_SHADOWS, PARSE_ONLY_BOOL, true}, {MENU_ENUM_LABEL_MENU_RGUI_PARTICLE_EFFECT, PARSE_ONLY_UINT, true}, {MENU_ENUM_LABEL_MENU_RGUI_PARTICLE_EFFECT_SPEED, PARSE_ONLY_FLOAT, false}, @@ -8937,6 +8939,14 @@ unsigned menu_displaylist_build_list( if (menu_horizontal_animation) build_list[i].checked = true; break; + case MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET: + if (menu_rgui_color_theme == RGUI_THEME_CUSTOM) + build_list[i].checked = true; + break; + case MENU_ENUM_LABEL_MENU_RGUI_TRANSPARENCY: + if (menu_rgui_color_theme != RGUI_THEME_CUSTOM) + build_list[i].checked = true; + break; case MENU_ENUM_LABEL_MENU_RGUI_PARTICLE_EFFECT_SPEED: if (menu_rgui_particle_effect != RGUI_PARTICLE_EFFECT_NONE) build_list[i].checked = true; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 90561db124..ec4492661b 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -14601,6 +14601,8 @@ static bool setting_append_list( 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_rgui_menu_color_theme; menu_settings_list_current_add_range(list, list_info, 0, RGUI_THEME_LAST-1, 1, true, true); @@ -14620,6 +14622,27 @@ static bool setting_append_list( general_read_handler); MENU_SETTINGS_LIST_CURRENT_ADD_VALUES(list, list_info, "cfg"); + /* ps2 and sdl_dingux gfx drivers do not support + * menu framebuffer transparency */ + if (!string_is_equal(settings->arrays.video_driver, "ps2") && + !string_is_equal(settings->arrays.video_driver, "sdl_dingux")) + { + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_rgui_transparency, + MENU_ENUM_LABEL_MENU_RGUI_TRANSPARENCY, + MENU_ENUM_LABEL_VALUE_MENU_RGUI_TRANSPARENCY, + DEFAULT_RGUI_TRANSPARENCY, + 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_BOOL( list, list_info, &settings->bools.menu_rgui_shadows, diff --git a/msg_hash.h b/msg_hash.h index 1145e6ff41..819411ec91 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1119,6 +1119,7 @@ enum msg_hash_enums MENU_LABEL(MENU_RGUI_ASPECT_RATIO), MENU_LABEL(MENU_RGUI_ASPECT_RATIO_LOCK), MENU_LABEL(MENU_RGUI_FULL_WIDTH_LAYOUT), + MENU_LABEL(MENU_RGUI_TRANSPARENCY), MENU_LABEL(MENU_RGUI_SHADOWS), MENU_LABEL(MENU_RGUI_PARTICLE_EFFECT), MENU_LABEL(MENU_RGUI_PARTICLE_EFFECT_SPEED),