From ee99eb53c3aa8a1d199061ac40a05e0acb7b73f2 Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 25 Dec 2019 02:38:16 -0500 Subject: [PATCH] HUD: throw a close-X on the hud --- src/demo/hud.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/demo/hud.c b/src/demo/hud.c index 8a333498a..120c2dbac 100644 --- a/src/demo/hud.c +++ b/src/demo/hud.c @@ -37,8 +37,7 @@ hud_grabbed_bg(struct ncplane* n){ struct ncplane* hud_create(struct notcurses* nc){ int dimx, dimy; notcurses_term_dim_yx(nc, &dimy, &dimx); - //int xoffset = (dimx - hud_cols) / 2; - int xoffset = dimx - hud_cols; + int xoffset = (dimx - hud_cols) / 2; //int yoffset = (dimy - hud_rows); int yoffset = 0; struct ncplane* n = notcurses_newplane(nc, hud_rows, hud_cols, yoffset, xoffset, NULL); @@ -46,6 +45,12 @@ struct ncplane* hud_create(struct notcurses* nc){ return NULL; } hud_standard_bg(n); + uint64_t channels; + channels_set_fg(&channels, 0xffffff); + if(ncplane_putegc_yx(n, 0, hud_cols - 1, "\u274e", 0, channels, NULL) < 0){ + ncplane_destroy(n); + return NULL; + } return (hud = n); }