Set Attrs::monospaced if Font::Monospace is selected

This commit is contained in:
Héctor Ramón Jiménez 2023-02-05 18:33:09 +01:00
parent dd80772da9
commit 7d4c63d411
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -350,16 +350,19 @@ impl<'a> Cache<'a> {
);
buffer.set_text(
key.content,
glyphon::Attrs::new().family(to_family(key.font)).color({
let [r, g, b, a] = key.color.into_linear();
glyphon::Attrs::new()
.family(to_family(key.font))
.color({
let [r, g, b, a] = key.color.into_linear();
glyphon::Color::rgba(
(r * 255.0) as u8,
(g * 255.0) as u8,
(b * 255.0) as u8,
(a * 255.0) as u8,
)
}),
glyphon::Color::rgba(
(r * 255.0) as u8,
(g * 255.0) as u8,
(b * 255.0) as u8,
(a * 255.0) as u8,
)
})
.monospaced(matches!(key.font, Font::Monospace)),
);
let _ = entry.insert(buffer);