Light mode: show statusbar, use reverse video

This commit is contained in:
Arun Prakash Jana 2019-08-04 08:56:59 +05:30
parent 2bfcb281e7
commit cf1b9d34ea
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 29 additions and 33 deletions

View File

@ -116,9 +116,6 @@
#define TOUPPER(ch) \ #define TOUPPER(ch) \
(((ch) >= 'a' && (ch) <= 'z') ? ((ch) - 'a' + 'A') : (ch)) (((ch) >= 'a' && (ch) <= 'z') ? ((ch) - 'a' + 'A') : (ch))
#define CMD_LEN_MAX (PATH_MAX + ((NAME_MAX + 1) << 1)) #define CMD_LEN_MAX (PATH_MAX + ((NAME_MAX + 1) << 1))
#define CURSR ">>"
#define EMPTY " "
#define CURSYM(flag) ((flag) ? CURSR : EMPTY)
#define FILTER '/' #define FILTER '/'
#define MSGWAIT '$' #define MSGWAIT '$'
#define REGEX_MAX 48 #define REGEX_MAX 48
@ -2344,7 +2341,13 @@ static void printent(const struct entry *ent, int sel, uint namecols)
/* Directories are always shown on top */ /* Directories are always shown on top */
resetdircolor(ent->flags); resetdircolor(ent->flags);
printw("%s%c%s%s\n", CURSYM(sel), cp, pname, ind); if (sel)
attron(A_REVERSE);
printw("%c%s%s\n", cp, pname, ind);
if (sel)
attroff(A_REVERSE);
} }
static void printent_long(const struct entry *ent, int sel, uint namecols) static void printent_long(const struct entry *ent, int sel, uint namecols)
@ -3269,38 +3272,31 @@ static void redraw(char *path)
cfg.dircolor = 0; cfg.dircolor = 0;
} }
if (cfg.showdetail) { if (ndents) {
if (ndents) { char sort[] = "\0 ";
char sort[] = "\0 ";
if (cfg.mtimeorder) if (cfg.mtimeorder)
sort[0] = 'T'; sort[0] = 'T';
else if (cfg.sizeorder) else if (cfg.sizeorder)
sort[0] = 'S'; sort[0] = 'S';
else if (cfg.extnorder) else if (cfg.extnorder)
sort[0] = 'E'; sort[0] = 'E';
/* We need to show filename as it may be truncated in directory listing */ /* We need to show filename as it may be truncated in directory listing */
if (!cfg.blkorder) if (!cfg.showdetail || !cfg.blkorder)
mvprintw(lastln, 0, "%d/%d %s[%s]\n", cur + 1, ndents, sort, mvprintw(lastln, 0, "%d/%d %s[%s]\n", cur + 1, ndents, sort,
unescape(dents[cur].name, NAME_MAX)); unescape(dents[cur].name, NAME_MAX));
else { else {
xstrlcpy(buf, coolsize(dir_blocks << BLK_SHIFT), 12); xstrlcpy(buf, coolsize(dir_blocks << BLK_SHIFT), 12);
c = cfg.apparentsz ? 'a' : 'd';
if (cfg.apparentsz) mvprintw(lastln, 0, "%d/%d %cu: %s (%lu files) free: %s [%s]\n",
c = 'a'; cur + 1, ndents, c, buf, num_files,
else coolsize(get_fs_info(path, FREE)),
c = 'd'; unescape(dents[cur].name, NAME_MAX));
}
mvprintw(lastln, 0, } else
"%d/%d %cu: %s (%lu files) free: %s [%s]\n", printmsg("0/0");
cur + 1, ndents, c, buf, num_files,
coolsize(get_fs_info(path, FREE)),
unescape(dents[cur].name, NAME_MAX));
}
} else
printmsg("0/0");
}
} }
static void browse(char *ipath) static void browse(char *ipath)