[tfman] colorize structure based off distance #2457

This commit is contained in:
nick black 2021-12-14 18:24:51 -05:00
parent 9fda62030d
commit 5295d0c938
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 11 additions and 5 deletions

View File

@ -829,8 +829,8 @@ render_troff(struct notcurses* nc, const unsigned char* map, size_t mlen,
return pman;
}
static const char USAGE_TEXT[] = "b⇞k↑j↓f⇟⎢ (q)uit";
static const char USAGE_TEXT_ASCII[] = "(bkjf) (q)uit";
static const char USAGE_TEXT[] = "⇆/s⎢⎥b⇞k↑↓j⇟f⎢ (q)uit";
static const char USAGE_TEXT_ASCII[] = "(tab/s) (bkjf) (q)uit";
static int
draw_bar(struct ncplane* bar, pagedom* dom){
@ -957,6 +957,12 @@ manloop(struct notcurses* nc, const char* arg){
notcurses_refresh(nc, NULL, NULL);
}
break;
case 's':
// FIXME toggle structure browser visibility
break;
case NCKEY_TAB: case L'\u21c6':
// FIXME switch between browsers
break;
case 'k': case NCKEY_UP:
if(ncplane_y(page)){
ncplane_move_rel(page, 1, 0);

View File

@ -20,9 +20,9 @@ static int
docstruct_callback(struct ncplane* n, void* curry, int i){
if(n){
docnode* dn = curry;
uint64_t channels = NCCHANNELS_INITIALIZER(0, 0, 0, 0x49, 0x9d, 0x63);
ncplane_set_base(n, "", 0, channels);
ncplane_set_fg_rgb(n, 0xffffff);
uint64_t channels =
NCCHANNELS_INITIALIZER(0xff, 0xff, 0xff, 0x49, (0x9d - 0x10 * i), 0x63);
ncplane_set_channels(n, channels);
ncplane_erase(n);
//ncplane_putstr(n, dn->title);
ncplane_putstr_aligned(n, 0, NCALIGN_RIGHT, dn->title);