aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-23 20:49:01 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-23 20:49:01 +0000
commit6146cab3bd885fe2132ed12ac2593348984f77a4 (patch)
tree4f4dcddc03b7c4bc84460456f07cd99fd0365f62
parentd2cfbc64a0ae2ed3e867b3d4df35cd89a925e7ef (diff)
downloadrtmux-6146cab3bd885fe2132ed12ac2593348984f77a4.tar.gz
rtmux-6146cab3bd885fe2132ed12ac2593348984f77a4.tar.bz2
rtmux-6146cab3bd885fe2132ed12ac2593348984f77a4.zip
Use reverse so status line etc works in terminals w/o colour.
-rw-r--r--status.c37
-rw-r--r--window-choose.c7
-rw-r--r--window-copy.c7
-rw-r--r--window-more.c7
-rw-r--r--window-scroll.c7
5 files changed, 35 insertions, 30 deletions
diff --git a/status.c b/status.c
index c388cd76..5712d2f2 100644
--- a/status.c
+++ b/status.c
@@ -1,4 +1,4 @@
-/* $Id: status.c,v 1.66 2009-01-19 20:14:55 nicm Exp $ */
+/* $Id: status.c,v 1.67 2009-01-23 20:49:01 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -67,8 +67,9 @@ status_redraw(struct client *c)
if (gettimeofday(&c->status_timer, NULL) != 0)
fatal("gettimeofday");
memcpy(&gc, &grid_default_cell, sizeof gc);
- gc.fg = options_get_number(&s->options, "status-fg");
- gc.bg = options_get_number(&s->options, "status-bg");
+ gc.bg = options_get_number(&s->options, "status-fg");
+ gc.fg = options_get_number(&s->options, "status-bg");
+ gc.attr |= GRID_ATTR_REVERSE;
yy = c->sy - 1;
if (yy == 0)
@@ -198,7 +199,7 @@ draw:
rarrow = -1;
}
- gc.attr &= ~GRID_ATTR_REVERSE;
+ gc.attr |= GRID_ATTR_REVERSE;
if (offset < start + width) {
if (offset >= start) {
screen_write_putc(&ctx, &gc, ' ');
@@ -222,9 +223,9 @@ draw:
/* Draw the arrows. */
if (larrow != 0) {
if (larrow == -1)
- gc.attr |= GRID_ATTR_REVERSE;
- else
gc.attr &= ~GRID_ATTR_REVERSE;
+ else
+ gc.attr |= GRID_ATTR_REVERSE;
if (llen != 0)
screen_write_cursormove(&ctx, llen + 1, yy);
else
@@ -234,15 +235,15 @@ draw:
}
if (rarrow != 0) {
if (rarrow == -1)
- gc.attr |= GRID_ATTR_REVERSE;
- else
gc.attr &= ~GRID_ATTR_REVERSE;
+ else
+ gc.attr |= GRID_ATTR_REVERSE;
if (rlen != 0)
screen_write_cursormove(&ctx, c->sx - rlen - 2, yy);
else
screen_write_cursormove(&ctx, c->sx - 1, yy);
screen_write_putc(&ctx, &gc, '>');
- gc.attr &= ~GRID_ATTR_REVERSE;
+ gc.attr |= GRID_ATTR_REVERSE;
}
goto out;
@@ -388,14 +389,13 @@ status_print(struct session *s, struct winlink *wl, struct grid_cell *gc)
if (wl == s->curw)
flag = '*';
- gc->attr &= ~GRID_ATTR_REVERSE;
if (session_alert_has(s, wl, WINDOW_ACTIVITY)) {
flag = '#';
- gc->attr |= GRID_ATTR_REVERSE;
+ gc->attr &= ~GRID_ATTR_REVERSE;
}
if (session_alert_has(s, wl, WINDOW_BELL)) {
flag = '!';
- gc->attr |= GRID_ATTR_REVERSE;
+ gc->attr &= ~GRID_ATTR_REVERSE;
}
xasprintf(&text, "%d:%s%c", wl->idx, wl->window->name, flag);
@@ -423,8 +423,9 @@ status_message_redraw(struct client *c)
len = c->sx;
memcpy(&gc, &grid_default_cell, sizeof gc);
- gc.fg = options_get_number(&s->options, "message-fg");
- gc.bg = options_get_number(&s->options, "message-bg");
+ gc.bg = options_get_number(&s->options, "message-fg");
+ gc.fg = options_get_number(&s->options, "message-bg");
+ gc.attr |= GRID_ATTR_REVERSE;
screen_write_start(&ctx, NULL, &c->status);
@@ -459,8 +460,9 @@ status_prompt_redraw(struct client *c)
len = c->sx;
memcpy(&gc, &grid_default_cell, sizeof gc);
- gc.fg = options_get_number(&s->options, "message-fg");
- gc.bg = options_get_number(&s->options, "message-bg");
+ gc.bg = options_get_number(&s->options, "message-fg");
+ gc.fg = options_get_number(&s->options, "message-bg");
+ gc.attr |= GRID_ATTR_REVERSE;
screen_write_start(&ctx, NULL, &c->status);
@@ -500,8 +502,7 @@ status_prompt_redraw(struct client *c)
ch = c->prompt_buffer[c->prompt_index];
if (ch == '\0')
ch = ' ';
- gc.bg = options_get_number(&s->options, "message-bg");
- gc.attr |= GRID_ATTR_REVERSE;
+ gc.attr &= ~GRID_ATTR_REVERSE;
screen_write_putc(&ctx, &gc, ch);
screen_write_stop(&ctx);
diff --git a/window-choose.c b/window-choose.c
index 66b5b210..38a6a9dc 100644
--- a/window-choose.c
+++ b/window-choose.c
@@ -1,4 +1,4 @@
-/* $Id: window-choose.c,v 1.5 2009-01-23 20:17:04 nicm Exp $ */
+/* $Id: window-choose.c,v 1.6 2009-01-23 20:49:01 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -258,8 +258,9 @@ window_choose_write_line(
memcpy(&gc, &grid_default_cell, sizeof gc);
if (data->selected == data->top + py) {
- gc.fg = options_get_number(&wp->window->options, "mode-fg");
- gc.bg = options_get_number(&wp->window->options, "mode-bg");
+ gc.fg = options_get_number(&wp->window->options, "mode-bg");
+ gc.bg = options_get_number(&wp->window->options, "mode-fg");
+ gc.attr |= GRID_ATTR_REVERSE;
}
screen_write_cursormove(ctx, 0, py);
diff --git a/window-copy.c b/window-copy.c
index e17e6291..f8815551 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -1,4 +1,4 @@
-/* $Id: window-copy.c,v 1.42 2009-01-21 18:19:32 nicm Exp $ */
+/* $Id: window-copy.c,v 1.43 2009-01-23 20:49:01 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -215,8 +215,9 @@ window_copy_write_line(struct window_pane *wp, struct screen_write_ctx *ctx, u_i
memcpy(&gc, &grid_default_cell, sizeof gc);
size = xsnprintf(hdr, sizeof hdr,
"[%u,%u/%u]", data->ox, data->oy, screen_hsize(&wp->base));
- gc.fg = options_get_number(&wp->window->options, "mode-fg");
- gc.bg = options_get_number(&wp->window->options, "mode-bg");
+ gc.bg = options_get_number(&wp->window->options, "mode-fg");
+ gc.fg = options_get_number(&wp->window->options, "mode-bg");
+ gc.attr |= GRID_ATTR_REVERSE;
screen_write_cursormove(ctx, screen_size_x(s) - size, 0);
screen_write_puts(ctx, &gc, "%s", hdr);
screen_write_puts(ctx, &gc, "%s", hdr);
diff --git a/window-more.c b/window-more.c
index 43a269c8..de3386ef 100644
--- a/window-more.c
+++ b/window-more.c
@@ -1,4 +1,4 @@
-/* $Id: window-more.c,v 1.25 2009-01-15 00:51:39 nicm Exp $ */
+/* $Id: window-more.c,v 1.26 2009-01-23 20:49:01 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -180,8 +180,9 @@ window_more_write_line(
size = xsnprintf(hdr, sizeof hdr,
"[%u/%u]", data->top, ARRAY_LENGTH(&data->list));
screen_write_cursormove(ctx, screen_size_x(s) - size, 0);
- gc.fg = options_get_number(&wp->window->options, "mode-fg");
- gc.bg = options_get_number(&wp->window->options, "mode-bg");
+ gc.bg = options_get_number(&wp->window->options, "mode-fg");
+ gc.fg = options_get_number(&wp->window->options, "mode-bg");
+ gc.attr |= GRID_ATTR_REVERSE;
screen_write_puts(ctx, &gc, "%s", hdr);
memcpy(&gc, &grid_default_cell, sizeof gc);
} else
diff --git a/window-scroll.c b/window-scroll.c
index d3f7d244..f874d1d9 100644
--- a/window-scroll.c
+++ b/window-scroll.c
@@ -1,4 +1,4 @@
-/* $Id: window-scroll.c,v 1.27 2009-01-11 23:31:46 nicm Exp $ */
+/* $Id: window-scroll.c,v 1.28 2009-01-23 20:49:01 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -158,8 +158,9 @@ window_scroll_write_line(
memcpy(&gc, &grid_default_cell, sizeof gc);
size = xsnprintf(hdr, sizeof hdr,
"[%u,%u/%u]", data->ox, data->oy, screen_hsize(&wp->base));
- gc.fg = options_get_number(&wp->window->options, "mode-fg");
- gc.bg = options_get_number(&wp->window->options, "mode-bg");
+ gc.bg = options_get_number(&wp->window->options, "mode-fg");
+ gc.fg = options_get_number(&wp->window->options, "mode-bg");
+ gc.attr |= GRID_ATTR_REVERSE;
screen_write_cursormove(ctx, screen_size_x(s) - size, 0);
screen_write_puts(ctx, &gc, "%s", hdr);
memcpy(&gc, &grid_default_cell, sizeof gc);