aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-08-30 19:01:13 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-08-30 19:01:13 +0000
commit7c4c41fbae9a561eec877399601d44567c22e947 (patch)
treea010a8559f598523fe2f3baee5bbd3134ce5bd4b
parentsearch: map ctrl+b/f to move cursor single character backward/forward (diff)
render: search box: use colors from the color table
Use the 'yellow' color from the 'regular' range of colors (SGR 33) for background when we have a match, or 'red' from the 'regular' range of colors (SGR 31) when we don't have a match. Foreground uses the 'black' color from the regular range of colors (SGR 30).
-rw-r--r--render.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/render.c b/render.c
index e5ec9c90..c571a984 100644
--- a/render.c
+++ b/render.c
@@ -729,7 +729,8 @@ render_search_box(struct terminal *term)
/* Background - yellow on empty/match, red on mismatch */
pixman_color_t color = color_hex_to_pixman(
- term->search.match_len == term->search.len ? 0xffff00 : 0xff0000);
+ term->search.match_len == term->search.len
+ ? term->colors.table[3] : term->colors.table[1]);
pixman_image_fill_rectangles(
PIXMAN_OP_SRC, buf->pix, &color,
@@ -738,7 +739,7 @@ render_search_box(struct terminal *term)
struct font *font = &term->fonts[0];
int x = margin;
int y = margin;
- pixman_color_t fg = color_hex_to_pixman(0x000000);
+ pixman_color_t fg = color_hex_to_pixman(term->colors.table[0]);
/* Text (what the user entered - *not* match(es)) */
for (size_t i = 0; i < term->search.len; i++) {