(RGUI) Add background border filler thickness enable

This commit is contained in:
twinaphex 2018-04-24 16:45:06 +02:00
parent ee421fcaa8
commit 65fe25f03c
24 changed files with 165 additions and 30 deletions

View File

@ -1332,6 +1332,8 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, materialui_icons_enable, false); SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, materialui_icons_enable, false);
#endif #endif
#ifdef HAVE_RGUI #ifdef HAVE_RGUI
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("rgui_border_filler_enable", &settings->bools.menu_rgui_border_filler_enable, true, true, false);
#endif #endif
#ifdef HAVE_XMB #ifdef HAVE_XMB

View File

@ -148,6 +148,8 @@ typedef struct settings
bool menu_show_quit_retroarch; bool menu_show_quit_retroarch;
bool menu_show_reboot; bool menu_show_reboot;
bool menu_materialui_icons_enable; bool menu_materialui_icons_enable;
bool menu_rgui_background_filler_thickness_enable;
bool menu_rgui_border_filler_thickness_enable;
bool menu_rgui_border_filler_enable; bool menu_rgui_border_filler_enable;
bool menu_xmb_shadows_enable; bool menu_xmb_shadows_enable;
bool menu_xmb_vertical_thumbnails; bool menu_xmb_vertical_thumbnails;

View File

@ -3437,3 +3437,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3223,3 +3223,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3215,3 +3215,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3329,3 +3329,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3088,3 +3088,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -5819,3 +5819,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3253,3 +3253,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3311,3 +3311,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Mostra statistiche tecniche su schermo.") "Mostra statistiche tecniche su schermo.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3327,3 +3327,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3214,3 +3214,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -1475,3 +1475,7 @@ MSG_HASH(MENU_ENUM_LABEL_VIDEO_WINDOW_SHOW_DECORATIONS,
"video_window_show_decorations") "video_window_show_decorations")
MSG_HASH(MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_ENABLE,
"menu_rgui_border_filler_enable") "menu_rgui_border_filler_enable")
MSG_HASH(MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"menu_rgui_border_filler_thickness_enable")
MSG_HASH(MENU_ENUM_LABEL_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"menu_rgui_background_filler_thickness_enable")

View File

@ -3090,3 +3090,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3449,3 +3449,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Pokaż techniczne statystyki na ekranie.") "Pokaż techniczne statystyki na ekranie.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -4318,3 +4318,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Mostrar estatísticas técnicas na tela.") "Mostrar estatísticas técnicas na tela.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3188,3 +3188,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3272,3 +3272,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3493,3 +3493,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -3245,3 +3245,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW,
"Show onscreen technical statistics.") "Show onscreen technical statistics.")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE,
"Enable border filler") "Enable border filler")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
"Enable border filler thickness")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
"Enable background filler thickness")

View File

@ -55,11 +55,14 @@
typedef struct typedef struct
{ {
bool bg_modified;
bool force_redraw; bool force_redraw;
bool mouse_show; bool mouse_show;
unsigned last_width; unsigned last_width;
unsigned last_height; unsigned last_height;
unsigned frame_count; unsigned frame_count;
bool bg_thickness;
bool border_thickness;
float scroll_y; float scroll_y;
char *msgbox; char *msgbox;
} rgui_t; } rgui_t;
@ -86,10 +89,10 @@ static uint16_t argb32_to_rgba4444(uint32_t col)
#endif #endif
static uint16_t rgui_gray_filler(unsigned x, unsigned y) static uint16_t rgui_gray_filler(rgui_t *rgui, unsigned x, unsigned y)
{ {
unsigned col = (((x >> 1) + (y >> 1)) & 1) + 1; unsigned shft = (rgui->bg_thickness ? 1 : 0);
unsigned col = (((x >> shft) + (y >> shft)) & 1) + 1;
#if defined(GEKKO) || defined(PSP) #if defined(GEKKO) || defined(PSP)
return (6 << 12) | (col << 8) | (col << 4) | (col << 0); return (6 << 12) | (col << 8) | (col << 4) | (col << 0);
#else #else
@ -97,9 +100,10 @@ static uint16_t rgui_gray_filler(unsigned x, unsigned y)
#endif #endif
} }
static uint16_t rgui_green_filler(unsigned x, unsigned y) static uint16_t rgui_green_filler(rgui_t *rgui, unsigned x, unsigned y)
{ {
unsigned col = (((x >> 1) + (y >> 1)) & 1) + 1; unsigned shft = (rgui->border_thickness ? 1 : 0);
unsigned col = (((x >> shft) + (y >> shft)) & 1) + 1;
#if defined(GEKKO) || defined(PSP) #if defined(GEKKO) || defined(PSP)
return (6 << 12) | (col << 8) | (col << 5) | (col << 0); return (6 << 12) | (col << 8) | (col << 5) | (col << 0);
#else #else
@ -108,17 +112,18 @@ static uint16_t rgui_green_filler(unsigned x, unsigned y)
} }
static void rgui_fill_rect( static void rgui_fill_rect(
rgui_t *rgui,
uint16_t *data, uint16_t *data,
size_t pitch, size_t pitch,
unsigned x, unsigned y, unsigned x, unsigned y,
unsigned width, unsigned height, unsigned width, unsigned height,
uint16_t (*col)(unsigned x, unsigned y)) uint16_t (*col)(rgui_t *rgui, unsigned x, unsigned y))
{ {
unsigned i, j; unsigned i, j;
for (j = y; j < y + height; j++) for (j = y; j < y + height; j++)
for (i = x; i < x + width; i++) for (i = x; i < x + width; i++)
data[j * (pitch >> 1) + i] = col(i, j); data[j * (pitch >> 1) + i] = col(rgui, i, j);
} }
static void rgui_color_rect( static void rgui_color_rect(
@ -239,7 +244,7 @@ static bool rguidisp_init_font(menu_handle_t *menu)
return true; return true;
} }
static void rgui_render_background(void) static void rgui_render_background(rgui_t *rgui)
{ {
size_t pitch_in_pixels, size; size_t pitch_in_pixels, size;
size_t fb_pitch; size_t fb_pitch;
@ -267,11 +272,11 @@ static void rgui_render_background(void)
if (settings->bools.menu_rgui_border_filler_enable) if (settings->bools.menu_rgui_border_filler_enable)
{ {
rgui_fill_rect(rgui_framebuf_data, fb_pitch, 5, 5, fb_width - 10, 5, rgui_green_filler); rgui_fill_rect(rgui, rgui_framebuf_data, fb_pitch, 5, 5, fb_width - 10, 5, rgui_green_filler);
rgui_fill_rect(rgui_framebuf_data, fb_pitch, 5, fb_height - 10, fb_width - 10, 5, rgui_green_filler); rgui_fill_rect(rgui, rgui_framebuf_data, fb_pitch, 5, fb_height - 10, fb_width - 10, 5, rgui_green_filler);
rgui_fill_rect(rgui_framebuf_data, fb_pitch, 5, 5, 5, fb_height - 10, rgui_green_filler); rgui_fill_rect(rgui, rgui_framebuf_data, fb_pitch, 5, 5, 5, fb_height - 10, rgui_green_filler);
rgui_fill_rect(rgui_framebuf_data, fb_pitch, fb_width - 10, 5, 5, fb_height - 10, rgui_fill_rect(rgui, rgui_framebuf_data, fb_pitch, fb_width - 10, 5, 5, fb_height - 10,
rgui_green_filler); rgui_green_filler);
} }
} }
@ -290,7 +295,7 @@ static void rgui_set_message(void *data, const char *message)
rgui->force_redraw = true; rgui->force_redraw = true;
} }
static void rgui_render_messagebox(const char *message) static void rgui_render_messagebox(rgui_t *rgui, const char *message)
{ {
int x, y; int x, y;
uint16_t color; uint16_t color;
@ -343,21 +348,21 @@ static void rgui_render_messagebox(const char *message)
if (rgui_framebuf_data) if (rgui_framebuf_data)
{ {
rgui_fill_rect(rgui_framebuf_data, rgui_fill_rect(rgui, rgui_framebuf_data,
fb_pitch, x + 5, y + 5, width - 10, fb_pitch, x + 5, y + 5, width - 10,
height - 10, rgui_gray_filler); height - 10, rgui_gray_filler);
if (settings->bools.menu_rgui_border_filler_enable) if (settings->bools.menu_rgui_border_filler_enable)
{ {
rgui_fill_rect(rgui_framebuf_data, rgui_fill_rect(rgui, rgui_framebuf_data,
fb_pitch, x, y, width - 5, 5, rgui_green_filler); fb_pitch, x, y, width - 5, 5, rgui_green_filler);
rgui_fill_rect(rgui_framebuf_data, rgui_fill_rect(rgui, rgui_framebuf_data,
fb_pitch, x + width - 5, y, 5, fb_pitch, x + width - 5, y, 5,
height - 5, rgui_green_filler); height - 5, rgui_green_filler);
rgui_fill_rect(rgui_framebuf_data, rgui_fill_rect(rgui, rgui_framebuf_data,
fb_pitch, x + 5, y + height - 5, fb_pitch, x + 5, y + height - 5,
width - 5, 5, rgui_green_filler); width - 5, 5, rgui_green_filler);
rgui_fill_rect(rgui_framebuf_data, rgui_fill_rect(rgui, rgui_framebuf_data,
fb_pitch, x, y + 5, 5, fb_pitch, x, y + 5, 5,
height - 5, rgui_green_filler); height - 5, rgui_green_filler);
} }
@ -399,6 +404,15 @@ static void rgui_blit_cursor(void)
static void rgui_frame(void *data, video_frame_info_t *video_info) static void rgui_frame(void *data, video_frame_info_t *video_info)
{ {
rgui_t *rgui = (rgui_t*)data; rgui_t *rgui = (rgui_t*)data;
settings_t *settings = config_get_ptr();
if ((settings->bools.menu_rgui_background_filler_thickness_enable != rgui->bg_thickness) ||
(settings->bools.menu_rgui_border_filler_thickness_enable != rgui->border_thickness)
)
rgui->bg_modified = true;
rgui->bg_thickness = settings->bools.menu_rgui_background_filler_thickness_enable;
rgui->border_thickness = settings->bools.menu_rgui_border_filler_thickness_enable;
rgui->frame_count++; rgui->frame_count++;
} }
@ -439,15 +453,18 @@ static void rgui_render(void *data, bool is_idle)
&fb_pitch); &fb_pitch);
/* if the framebuffer changed size, recache the background */ /* if the framebuffer changed size, recache the background */
if (rgui->last_width != fb_width || rgui->last_height != fb_height) if (rgui->bg_modified || rgui->last_width != fb_width || rgui->last_height != fb_height)
{ {
if (rgui_framebuf_data) if (rgui_framebuf_data)
rgui_fill_rect(rgui_framebuf_data, rgui_fill_rect(rgui, rgui_framebuf_data,
fb_pitch, 0, fb_height, fb_width, 4, rgui_gray_filler); fb_pitch, 0, fb_height, fb_width, 4, rgui_gray_filler);
rgui->last_width = fb_width; rgui->last_width = fb_width;
rgui->last_height = fb_height; rgui->last_height = fb_height;
} }
if (rgui->bg_modified)
rgui->bg_modified = false;
menu_display_set_framebuffer_dirty_flag(); menu_display_set_framebuffer_dirty_flag();
menu_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL); menu_animation_ctl(MENU_ANIMATION_CTL_CLEAR_ACTIVE, NULL);
@ -511,7 +528,7 @@ static void rgui_render(void *data, bool is_idle)
end = ((old_start + RGUI_TERM_HEIGHT(fb_width, fb_height)) <= (entries_end)) ? end = ((old_start + RGUI_TERM_HEIGHT(fb_width, fb_height)) <= (entries_end)) ?
old_start + RGUI_TERM_HEIGHT(fb_width, fb_height) : entries_end; old_start + RGUI_TERM_HEIGHT(fb_width, fb_height) : entries_end;
rgui_render_background(); rgui_render_background(rgui);
menu_entries_get_title(title, sizeof(title)); menu_entries_get_title(title, sizeof(title));
@ -657,12 +674,12 @@ static void rgui_render(void *data, bool is_idle)
const char *label = menu_input_dialog_get_label_buffer(); const char *label = menu_input_dialog_get_label_buffer();
snprintf(msg, sizeof(msg), "%s\n%s", label, str); snprintf(msg, sizeof(msg), "%s\n%s", label, str);
rgui_render_messagebox(msg); rgui_render_messagebox(rgui, msg);
} }
if (!string_is_empty(rgui->msgbox)) if (!string_is_empty(rgui->msgbox))
{ {
rgui_render_messagebox(rgui->msgbox); rgui_render_messagebox(rgui, rgui->msgbox);
free(rgui->msgbox); free(rgui->msgbox);
rgui->msgbox = NULL; rgui->msgbox = NULL;
rgui->force_redraw = true; rgui->force_redraw = true;
@ -693,6 +710,7 @@ static void *rgui_init(void **userdata, bool video_is_threaded)
unsigned fb_width, fb_height, new_font_height; unsigned fb_width, fb_height, new_font_height;
rgui_t *rgui = NULL; rgui_t *rgui = NULL;
bool ret = false; bool ret = false;
settings_t *settings = config_get_ptr();
menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu)); menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
if (!menu) if (!menu)
@ -703,7 +721,7 @@ static void *rgui_init(void **userdata, bool video_is_threaded)
if (!rgui) if (!rgui)
goto error; goto error;
*userdata = rgui; *userdata = rgui;
/* 4 extra lines to cache the checked background */ /* 4 extra lines to cache the checked background */
rgui_framebuf_data = (uint16_t*) rgui_framebuf_data = (uint16_t*)
@ -730,10 +748,9 @@ static void *rgui_init(void **userdata, bool video_is_threaded)
if (!ret) if (!ret)
goto error; goto error;
if (rgui_framebuf_data) rgui->bg_thickness = settings->bools.menu_rgui_background_filler_thickness_enable;
rgui_fill_rect(rgui_framebuf_data, rgui->border_thickness = settings->bools.menu_rgui_border_filler_thickness_enable;
fb_pitch, 0, fb_height, rgui->bg_modified = true;
fb_width, 4, rgui_gray_filler);
rgui->last_width = fb_width; rgui->last_width = fb_width;
rgui->last_height = fb_height; rgui->last_height = fb_height;

View File

@ -5306,10 +5306,18 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
MENU_ENUM_LABEL_MENU_FRAMEBUFFER_OPACITY, MENU_ENUM_LABEL_MENU_FRAMEBUFFER_OPACITY,
PARSE_ONLY_FLOAT, false) == 0) PARSE_ONLY_FLOAT, false) == 0)
count++; count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info, if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_ENABLE, MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_ENABLE,
PARSE_ONLY_BOOL, false) == 0) PARSE_ONLY_BOOL, false) == 0)
count++; count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
PARSE_ONLY_BOOL, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info, if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_MENU_LINEAR_FILTER, MENU_ENUM_LABEL_MENU_LINEAR_FILTER,
PARSE_ONLY_BOOL, false) == 0) PARSE_ONLY_BOOL, false) == 0)

View File

@ -5194,7 +5194,39 @@ static bool setting_append_list(
parent_group, parent_group,
general_write_handler, general_write_handler,
general_read_handler, general_read_handler,
SD_FLAG_ADVANCED SD_FLAG_NONE
);
CONFIG_BOOL(
list, list_info,
&settings->bools.menu_rgui_background_filler_thickness_enable,
MENU_ENUM_LABEL_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
true,
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_border_filler_thickness_enable,
MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
true,
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
); );
if (setting_set) if (setting_set)
@ -5211,7 +5243,7 @@ static bool setting_append_list(
parent_group, parent_group,
general_write_handler, general_write_handler,
general_read_handler, general_read_handler,
SD_FLAG_ADVANCED SD_FLAG_NONE
); );
} }

View File

@ -749,6 +749,8 @@ enum msg_hash_enums
MENU_LABEL(MOUSE_ENABLE), MENU_LABEL(MOUSE_ENABLE),
MENU_LABEL(POINTER_ENABLE), MENU_LABEL(POINTER_ENABLE),
MENU_LABEL(MENU_RGUI_BORDER_FILLER_ENABLE), MENU_LABEL(MENU_RGUI_BORDER_FILLER_ENABLE),
MENU_LABEL(MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE),
MENU_LABEL(MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE),
MENU_LABEL(MENU_LINEAR_FILTER), MENU_LABEL(MENU_LINEAR_FILTER),
MENU_LABEL(MENU_HORIZONTAL_ANIMATION), MENU_LABEL(MENU_HORIZONTAL_ANIMATION),
MENU_LABEL(NAVIGATION_WRAPAROUND), MENU_LABEL(NAVIGATION_WRAPAROUND),