aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-06-21 23:07:27 +0200
committerOmar Polo <op@omarpolo.com>2021-06-21 23:07:27 +0200
commitb598590d2dbf0d1b76146745953273eddf6eb126 (patch)
tree36dae40a768015c0ac8de98d5a982862f06be10f
parent50f7147c04445ef8fc489f16ff18f46f90540435 (diff)
downloadtelescope-b598590d2dbf0d1b76146745953273eddf6eb126.tar.gz
telescope-b598590d2dbf0d1b76146745953273eddf6eb126.tar.bz2
allow changing the background color of the body window
-rw-r--r--ChangeLog2
-rw-r--r--defaults.c13
-rw-r--r--telescope.h9
-rw-r--r--ui.c1
4 files changed, 24 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 41556a9..e4044fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2021-06-21 Omar Polo <op@omarpolo.com>
+ * telescope.h (enum pairs): allow changing the background color of the body window
+
* defaults.c (config_setvari): add enable-colors (variable)
2021-06-20 Omar Polo <op@omarpolo.com>
diff --git a/defaults.c b/defaults.c
index 46b5e81..d78e651 100644
--- a/defaults.c
+++ b/defaults.c
@@ -76,6 +76,11 @@ struct tab_face tab_face = {
.current_tab = A_NORMAL,
};
+struct body_face body_face = {
+ .bg = 0,
+ .fg = 0,
+};
+
struct modeline_face modeline_face = {
.background = A_REVERSE,
};
@@ -186,6 +191,11 @@ config_setcolor(int bg, const char *name, int prfx, int line, int trail)
d->fg = line;
d->trail_fg = trail;
}
+ } else if (!strcmp(name, "line")) {
+ if (bg)
+ body_face.bg = prfx;
+ else
+ body_face.fg = prfx;
} else {
return 0;
}
@@ -216,4 +226,7 @@ config_apply_colors(void)
f->trail_prop = COLOR_PAIR(d->tp);
}
}
+
+ init_pair(PBODY, body_face.fg, body_face.bg);
+ body_face.body = COLOR_PAIR(PBODY);
}
diff --git a/telescope.h b/telescope.h
index a75fd07..8657e1e 100644
--- a/telescope.h
+++ b/telescope.h
@@ -81,6 +81,12 @@ struct tab_face {
};
extern struct tab_face tab_face;
+struct body_face {
+ int bg, fg;
+ int body;
+};
+extern struct body_face body_face;
+
struct modeline_face {
int background;
};
@@ -326,7 +332,8 @@ extern int body_cols;
extern int in_minibuffer;
enum pairs {
- PT = 1,
+ PBODY = 1,
+ PT,
PT_PRFX,
PT_TRAIL,
PL,
diff --git a/ui.c b/ui.c
index a323d02..18c979b 100644
--- a/ui.c
+++ b/ui.c
@@ -1423,6 +1423,7 @@ ui_init(int argc, char * const *argv)
body_lines = LINES-3;
body_cols = COLS;
+ wbkgd(body, body_face.body);
update_x_offset();