osd: set field width to ellipsize

This commit is contained in:
Johan Malm 2023-04-21 16:26:44 +01:00 committed by Consolatis
parent 693c5bd937
commit 09c1cdd2dc

View file

@ -367,9 +367,11 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h,
default:
break;
}
int field_width = field->width / 100.0 * OSD_ITEM_WIDTH;
pango_layout_set_width(layout, field_width * PANGO_SCALE);
pango_layout_set_text(layout, buf.buf, -1);
pango_cairo_show_layout(cairo, layout);
x += field->width / 100.0 * OSD_ITEM_WIDTH;
x += field_width;
}
if (view == cycle_view) {