From 2a31c2fbbc2f38abef54090767f842a9e8016c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 29 Aug 2019 19:33:25 +0200 Subject: [PATCH] render: reduce amount of dim while searching scrollback history --- render.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/render.c b/render.c index 6501aa4b..8bdaeb0f 100644 --- a/render.c +++ b/render.c @@ -72,6 +72,14 @@ pixman_color_dim(pixman_color_t *color) color->blue /= 2; } +static inline void +pixman_color_dim_for_search(pixman_color_t *color) +{ + color->red /= 3; + color->green /= 3; + color->blue /= 3; +} + static void draw_bar(const struct terminal *term, pixman_image_t *pix, const pixman_color_t *color, int x, int y) @@ -205,10 +213,8 @@ render_cell(struct terminal *term, pixman_image_t *pix, } if (term->is_searching && !is_selected) { - pixman_color_dim(&fg); - pixman_color_dim(&bg); - pixman_color_dim(&fg); - pixman_color_dim(&bg); + pixman_color_dim_for_search(&fg); + pixman_color_dim_for_search(&bg); } struct font *font = attrs_to_font(term, &cell->attrs);