mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-29 07:58:01 -04:00
render: render_search_box: draw cursor as a bar
This commit is contained in:
parent
27da0d7f28
commit
2ca7400cc6
1 changed files with 6 additions and 0 deletions
6
render.c
6
render.c
|
|
@ -740,6 +740,9 @@ render_search_box(struct terminal *term)
|
||||||
|
|
||||||
/* Text (what the user entered - *not* match(es)) */
|
/* Text (what the user entered - *not* match(es)) */
|
||||||
for (size_t i = 0; i < term->search.len; i++) {
|
for (size_t i = 0; i < term->search.len; i++) {
|
||||||
|
if (i == term->search.cursor)
|
||||||
|
draw_bar(term, buf->pix, &fg, x, y);
|
||||||
|
|
||||||
const struct glyph *glyph = font_glyph_for_wc(&term->fonts[0], term->search.buf[i]);
|
const struct glyph *glyph = font_glyph_for_wc(&term->fonts[0], term->search.buf[i]);
|
||||||
if (glyph == NULL)
|
if (glyph == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -754,6 +757,9 @@ render_search_box(struct terminal *term)
|
||||||
x += glyph->width;
|
x += glyph->width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (term->search.cursor >= term->search.len)
|
||||||
|
draw_bar(term, buf->pix, &fg, x, y);
|
||||||
|
|
||||||
wl_subsurface_set_position(
|
wl_subsurface_set_position(
|
||||||
term->wl.search_sub_surface,
|
term->wl.search_sub_surface,
|
||||||
term->width - width - margin, term->height - height - margin);
|
term->width - width - margin, term->height - height - margin);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue