From 65fe25f03c0d369a74f8888789c24f418d48e28a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 24 Apr 2018 16:45:06 +0200 Subject: [PATCH] (RGUI) Add background border filler thickness enable --- configuration.c | 2 ++ configuration.h | 2 ++ intl/msg_hash_ar.h | 4 +++ intl/msg_hash_chs.h | 4 +++ intl/msg_hash_cht.h | 4 +++ intl/msg_hash_de.h | 4 +++ intl/msg_hash_eo.h | 4 +++ intl/msg_hash_es.h | 4 +++ intl/msg_hash_fr.h | 4 +++ intl/msg_hash_it.h | 4 +++ intl/msg_hash_ja.h | 4 +++ intl/msg_hash_ko.h | 4 +++ intl/msg_hash_lbl.h | 4 +++ intl/msg_hash_nl.h | 4 +++ intl/msg_hash_pl.h | 4 +++ intl/msg_hash_pt_br.h | 4 +++ intl/msg_hash_pt_pt.h | 4 +++ intl/msg_hash_ru.h | 4 +++ intl/msg_hash_us.h | 4 +++ intl/msg_hash_vn.h | 4 +++ menu/drivers/rgui.c | 73 +++++++++++++++++++++++++---------------- menu/menu_displaylist.c | 8 +++++ menu/menu_setting.c | 36 ++++++++++++++++++-- msg_hash.h | 2 ++ 24 files changed, 165 insertions(+), 30 deletions(-) diff --git a/configuration.c b/configuration.c index 522bcef290..b258632f7d 100644 --- a/configuration.c +++ b/configuration.c @@ -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); #endif #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); #endif #ifdef HAVE_XMB diff --git a/configuration.h b/configuration.h index 97fb7249c9..eca18e512d 100644 --- a/configuration.h +++ b/configuration.h @@ -148,6 +148,8 @@ typedef struct settings bool menu_show_quit_retroarch; bool menu_show_reboot; 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_xmb_shadows_enable; bool menu_xmb_vertical_thumbnails; diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index ecb9d5c5d6..15edc43cdb 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -3437,3 +3437,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index c7ed79c00a..0261fd48a7 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3223,3 +3223,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index bd29173ff5..52b50d9ba8 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3215,3 +3215,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index eaf90f6b40..bd052b7d18 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3329,3 +3329,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 018e802a54..9be34208be 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3088,3 +3088,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index 7633418c99..6132592fe1 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -5819,3 +5819,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 65f57c3dcc..b5133d4f0d 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3253,3 +3253,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index dbc83f8fb7..7268c142e6 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3311,3 +3311,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Mostra statistiche tecniche su schermo.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 635c8ae8ec..53db7a8bf5 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3327,3 +3327,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index e36cbd02a5..a32764fefc 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3214,3 +3214,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index c463f48355..a53cd5d6e2 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1475,3 +1475,7 @@ MSG_HASH(MENU_ENUM_LABEL_VIDEO_WINDOW_SHOW_DECORATIONS, "video_window_show_decorations") MSG_HASH(MENU_ENUM_LABEL_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") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index e05d9964eb..fd2f1a6e72 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3090,3 +3090,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index 56575412e9..8c3d081e69 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -3449,3 +3449,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Pokaż techniczne statystyki na ekranie.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index c8c88335b2..69e60613c8 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -4318,3 +4318,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Mostrar estatísticas técnicas na tela.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 2e8fee43ba..dc0d414f01 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3188,3 +3188,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 7807f3856c..f3956f3c14 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3272,3 +3272,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 0884f06788..87fb91209c 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3493,3 +3493,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 25fb749e51..e8ad2f7d60 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3245,3 +3245,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_STATISTICS_SHOW, "Show onscreen technical statistics.") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_ENABLE, "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") diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 8ea1841554..4c7beca70b 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -55,11 +55,14 @@ typedef struct { + bool bg_modified; bool force_redraw; bool mouse_show; unsigned last_width; unsigned last_height; unsigned frame_count; + bool bg_thickness; + bool border_thickness; float scroll_y; char *msgbox; } rgui_t; @@ -86,10 +89,10 @@ static uint16_t argb32_to_rgba4444(uint32_t col) #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) return (6 << 12) | (col << 8) | (col << 4) | (col << 0); #else @@ -97,9 +100,10 @@ static uint16_t rgui_gray_filler(unsigned x, unsigned y) #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) return (6 << 12) | (col << 8) | (col << 5) | (col << 0); #else @@ -108,17 +112,18 @@ static uint16_t rgui_green_filler(unsigned x, unsigned y) } static void rgui_fill_rect( + rgui_t *rgui, uint16_t *data, size_t pitch, unsigned x, unsigned y, unsigned width, unsigned height, - uint16_t (*col)(unsigned x, unsigned y)) + uint16_t (*col)(rgui_t *rgui, unsigned x, unsigned y)) { unsigned i, j; for (j = y; j < y + height; j++) 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( @@ -239,7 +244,7 @@ static bool rguidisp_init_font(menu_handle_t *menu) return true; } -static void rgui_render_background(void) +static void rgui_render_background(rgui_t *rgui) { size_t pitch_in_pixels, size; size_t fb_pitch; @@ -267,11 +272,11 @@ static void rgui_render_background(void) 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_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, 5, 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_framebuf_data, fb_pitch, fb_width - 10, 5, 5, fb_height - 10, + rgui_fill_rect(rgui, rgui_framebuf_data, fb_pitch, 5, 5, 5, fb_height - 10, rgui_green_filler); + rgui_fill_rect(rgui, rgui_framebuf_data, fb_pitch, fb_width - 10, 5, 5, fb_height - 10, rgui_green_filler); } } @@ -290,7 +295,7 @@ static void rgui_set_message(void *data, const char *message) 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; uint16_t color; @@ -343,21 +348,21 @@ static void rgui_render_messagebox(const char *message) 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, height - 10, rgui_gray_filler); 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); - rgui_fill_rect(rgui_framebuf_data, + rgui_fill_rect(rgui, rgui_framebuf_data, fb_pitch, x + width - 5, y, 5, 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, 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, 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) { 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++; } @@ -439,14 +453,17 @@ static void rgui_render(void *data, bool is_idle) &fb_pitch); /* 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) - rgui_fill_rect(rgui_framebuf_data, + rgui_fill_rect(rgui, rgui_framebuf_data, fb_pitch, 0, fb_height, fb_width, 4, rgui_gray_filler); rgui->last_width = fb_width; rgui->last_height = fb_height; } + + if (rgui->bg_modified) + rgui->bg_modified = false; menu_display_set_framebuffer_dirty_flag(); 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)) ? 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)); @@ -657,12 +674,12 @@ static void rgui_render(void *data, bool is_idle) const char *label = menu_input_dialog_get_label_buffer(); snprintf(msg, sizeof(msg), "%s\n%s", label, str); - rgui_render_messagebox(msg); + rgui_render_messagebox(rgui, msg); } if (!string_is_empty(rgui->msgbox)) { - rgui_render_messagebox(rgui->msgbox); + rgui_render_messagebox(rgui, rgui->msgbox); free(rgui->msgbox); rgui->msgbox = NULL; 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; rgui_t *rgui = NULL; bool ret = false; + settings_t *settings = config_get_ptr(); menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu)); if (!menu) @@ -703,7 +721,7 @@ static void *rgui_init(void **userdata, bool video_is_threaded) if (!rgui) goto error; - *userdata = rgui; + *userdata = rgui; /* 4 extra lines to cache the checked background */ rgui_framebuf_data = (uint16_t*) @@ -730,10 +748,9 @@ static void *rgui_init(void **userdata, bool video_is_threaded) if (!ret) goto error; - if (rgui_framebuf_data) - rgui_fill_rect(rgui_framebuf_data, - fb_pitch, 0, fb_height, - fb_width, 4, rgui_gray_filler); + rgui->bg_thickness = settings->bools.menu_rgui_background_filler_thickness_enable; + rgui->border_thickness = settings->bools.menu_rgui_border_filler_thickness_enable; + rgui->bg_modified = true; rgui->last_width = fb_width; rgui->last_height = fb_height; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index dd89b20305..88ef220072 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5306,10 +5306,18 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_MENU_FRAMEBUFFER_OPACITY, PARSE_ONLY_FLOAT, false) == 0) 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, MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_ENABLE, PARSE_ONLY_BOOL, false) == 0) 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, MENU_ENUM_LABEL_MENU_LINEAR_FILTER, PARSE_ONLY_BOOL, false) == 0) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 22c719367f..dda74df1ce 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5194,7 +5194,39 @@ static bool setting_append_list( parent_group, general_write_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) @@ -5211,7 +5243,7 @@ static bool setting_append_list( parent_group, general_write_handler, general_read_handler, - SD_FLAG_ADVANCED + SD_FLAG_NONE ); } diff --git a/msg_hash.h b/msg_hash.h index 5abcdb94d7..3b6766bce7 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -749,6 +749,8 @@ enum msg_hash_enums MENU_LABEL(MOUSE_ENABLE), MENU_LABEL(POINTER_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_HORIZONTAL_ANIMATION), MENU_LABEL(NAVIGATION_WRAPAROUND),