From 1b9072307afe4d4d22ce63d16b248b4d6d1f83a7 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 20 Mar 2022 14:34:19 +0100 Subject: [PATCH] [background] Turbo Vision's background on startup screen --- src/config/options.inc | 4 ++++ src/terminal/draw.c | 14 ++++++++++++-- src/terminal/draw.h | 6 ++++++ src/viewer/text/draw.c | 6 +++++- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/config/options.inc b/src/config/options.inc index fa9b50bb1..adccf35fb 100644 --- a/src/config/options.inc +++ b/src/config/options.inc @@ -1326,6 +1326,10 @@ static union option_info config_options_info[] = { "clipboard", "lime", "green", "white", "green", N_("Clipboard highlight colors.")), + INIT_OPT_COLORS("", N_("Desktop"), + "desktop", "blue", "white", "blue", "white", + N_("Desktop background.")), + INIT_OPT_COLORS("", N_("Searched strings"), "searched", "black", "lime", "black", "white", N_("Searched string highlight colors.")), diff --git a/src/terminal/draw.c b/src/terminal/draw.c index b6571a659..27b42d304 100644 --- a/src/terminal/draw.c +++ b/src/terminal/draw.c @@ -558,11 +558,17 @@ draw_box(struct terminal *term, struct el_box *box, set_screen_dirty(term->screen, box->y, box->y + box->height); } - +#ifdef CONFIG_UTF8 +void +draw_box_node(struct terminal *term, struct el_box *box, + unicode_val_T data, int attr, + unsigned int node_number) +#else void draw_box_node(struct terminal *term, struct el_box *box, unsigned char data, int attr, unsigned int node_number) +#endif { struct screen_char *line, *pos, *end; int width, height; @@ -1003,6 +1009,10 @@ clear_terminal(struct terminal *term) struct el_box box; set_box(&box, 0, 0, term->width, term->height); - draw_box(term, &box, ' ', 0, NULL); +#ifdef CONFIG_UTF8 + draw_box_node(term, &box, 0x2591, 0, get_bfu_color_node(term, "desktop")); +#else + draw_box_node(term, &box, '#', 0, get_bfu_color_node(term, "desktop")); +#endif set_cursor(term, 0, 0, 1); } diff --git a/src/terminal/draw.h b/src/terminal/draw.h index b4a54a832..7faae23b6 100644 --- a/src/terminal/draw.h +++ b/src/terminal/draw.h @@ -293,9 +293,15 @@ void draw_box(struct terminal *term, struct el_box *box, unsigned char data, int attr, struct color_pair *color); +#ifdef CONFIG_UTF8 +void draw_box_node(struct terminal *term, struct el_box *box, + unicode_val_T data, int attr, + unsigned int node_number); +#else void draw_box_node(struct terminal *term, struct el_box *box, unsigned char data, int attr, unsigned int node_number); +#endif /** Draws a shadow of @a width and @a height with color @a color * around @a box. */ diff --git a/src/viewer/text/draw.c b/src/viewer/text/draw.c index 391f0a598..b613829d1 100644 --- a/src/viewer/text/draw.c +++ b/src/viewer/text/draw.c @@ -485,7 +485,11 @@ draw_formatted(struct session *ses, int rerender) set_box(&box, 0, 1, ses->tab->term->width, ses->tab->term->height - 2); - draw_box(ses->tab->term, &box, ' ', 0, NULL); +#ifdef CONFIG_UTF8 + draw_box_node(ses->tab->term, &box, 0x2591, 0, get_bfu_color_node(ses->tab->term, "desktop")); +#else + draw_box_node(ses->tab->term, &box, '#', 0, get_bfu_color_node(ses->tab->term, "desktop")); +#endif return; }