mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-25 01:40:19 -05:00
render: csd_title(): use a custom font, sized based on the title bar’s height
We still use the primary font, but use a custom size, based on the title bar’s height. This fixes an issue where the window title could be way too small, or way too big. And changed size when the terminal font size was changed.
This commit is contained in:
parent
4a41575cb5
commit
0cf7a19616
3 changed files with 43 additions and 3 deletions
11
render.c
11
render.c
|
|
@ -1675,9 +1675,14 @@ render_csd_title(struct terminal *term, const struct csd_data *info,
|
|||
title_text = _title_text;
|
||||
}
|
||||
|
||||
const int margin = 10 * term->scale;
|
||||
render_osd(term, surf->surf, surf->sub, buf, title_text, fg, bg,
|
||||
margin, (buf->height - term->fonts[0]->height) / 2);
|
||||
struct wl_window *win = term->window;
|
||||
const int margin = win->csd.font->space_advance.x > 0
|
||||
? win->csd.font->space_advance.x
|
||||
: win->csd.font->max_advance.x;
|
||||
|
||||
render_osd(term, surf->surf, surf->sub, win->csd.font,
|
||||
buf, title_text, fg, bg, margin,
|
||||
(buf->height - win->csd.font->height) / 2);
|
||||
|
||||
csd_commit(term, surf->surf, buf);
|
||||
free(_title_text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue