From e0c4e67a11bd072bb1fab3f96938dbce37c26af8 Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 9 Dec 2021 17:38:05 -0500 Subject: [PATCH] [ncman] colorize the title --- src/man/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/man/main.c b/src/man/main.c index 51bb9d47f..ca8f20c5d 100644 --- a/src/man/main.c +++ b/src/man/main.c @@ -691,7 +691,7 @@ draw_domnode(struct ncplane* p, const pagedom* dom, const pagenode* n, if(strcmp(n->text, "NAME")){ ncplane_puttext(p, -1, NCALIGN_LEFT, "\n\n", &b); ncplane_set_styles(p, NCSTYLE_BOLD); - ncplane_putstr(p, n->text); + ncplane_putstr_aligned(p, -1, NCALIGN_CENTER, n->text); ncplane_set_styles(p, NCSTYLE_NONE); ncplane_cursor_move_yx(p, -1, 0); *wrotetext = true; @@ -700,7 +700,7 @@ draw_domnode(struct ncplane* p, const pagedom* dom, const pagenode* n, case LINE_SS: // subsection heading ncplane_puttext(p, -1, NCALIGN_LEFT, "\n\n", &b); ncplane_set_styles(p, NCSTYLE_ITALIC); - ncplane_printf(p, " %s", n->text); + ncplane_putstr_aligned(p, -1, NCALIGN_CENTER, n->text); ncplane_set_styles(p, NCSTYLE_NONE); ncplane_cursor_move_yx(p, -1, 0); *wrotetext = true; @@ -714,7 +714,10 @@ draw_domnode(struct ncplane* p, const pagedom* dom, const pagenode* n, } }else{ ncplane_set_styles(p, NCSTYLE_BOLD | NCSTYLE_ITALIC | NCSTYLE_UNDERLINE); - putpara(p, n->text); + ncplane_set_fg_rgb(p, 0xff6a00); + ncplane_putstr_aligned(p, -1, NCALIGN_CENTER, n->text); + ncplane_set_fg_default(p); + ncplane_set_styles(p, NCSTYLE_NONE); } *wrotetext = true; break;