aboutsummaryrefslogtreecommitdiff
path: root/screen-write.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-05-28 13:02:27 +0100
committerThomas Adam <thomas@xteddy.org>2019-05-28 13:02:27 +0100
commiteba6cf61c94b534d356439eab7ed883e2f7ca47d (patch)
tree931f5ad61c3abb2166721b65d0e5b102262e6165 /screen-write.c
parentc0116b2c5ba7d52509a8ce01dd27c2e3a3d4e2af (diff)
parente0fd2950548def0124733b43fb347e82878f47b3 (diff)
downloadrtmux-eba6cf61c94b534d356439eab7ed883e2f7ca47d.tar.gz
rtmux-eba6cf61c94b534d356439eab7ed883e2f7ca47d.tar.bz2
rtmux-eba6cf61c94b534d356439eab7ed883e2f7ca47d.zip
Merge branch 'obsd-master'
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/screen-write.c b/screen-write.c
index ad3808ae..174c7a82 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -410,6 +410,7 @@ screen_write_menu(struct screen_write_ctx *ctx, struct menu *menu, int choice)
struct screen *s = ctx->s;
struct grid_cell gc;
u_int cx, cy, i, j;
+ const char *name;
cx = s->cx;
cy = s->cy;
@@ -421,18 +422,24 @@ screen_write_menu(struct screen_write_ctx *ctx, struct menu *menu, int choice)
format_draw(ctx, &gc, menu->width, menu->title, NULL);
for (i = 0; i < menu->count; i++) {
- if (menu->items[i].name == NULL) {
+ name = menu->items[i].name;
+ if (name == NULL) {
screen_write_cursormove(ctx, cx, cy + 1 + i, 0);
screen_write_hline(ctx, menu->width + 4, 1, 1);
} else {
- if (choice >= 0 && i == (u_int)choice)
+ if (choice >= 0 && i == (u_int)choice && *name != '-')
gc.attr |= GRID_ATTR_REVERSE;
screen_write_cursormove(ctx, cx + 2, cy + 1 + i, 0);
for (j = 0; j < menu->width; j++)
screen_write_putc(ctx, &gc, ' ');
screen_write_cursormove(ctx, cx + 2, cy + 1 + i, 0);
- format_draw(ctx, &gc, menu->width, menu->items[i].name,
- NULL);
+ if (*name == '-') {
+ name++;
+ gc.attr |= GRID_ATTR_DIM;
+ format_draw(ctx, &gc, menu->width, name, NULL);
+ gc.attr &= ~GRID_ATTR_DIM;
+ } else
+ format_draw(ctx, &gc, menu->width, name, NULL);
if (choice >= 0 && i == (u_int)choice)
gc.attr &= ~GRID_ATTR_REVERSE;
}