Set attribute family to monospace when monospace is toggled
This commit is contained in:
parent
753c847aa9
commit
498cb7243d
1 changed files with 7 additions and 1 deletions
|
|
@ -192,7 +192,13 @@ impl Application for Window {
|
||||||
self.monospaced = monospaced;
|
self.monospaced = monospaced;
|
||||||
|
|
||||||
let mut buffer = self.buffer.lock().unwrap();
|
let mut buffer = self.buffer.lock().unwrap();
|
||||||
let attrs = buffer.attrs().clone().monospaced(monospaced);
|
let attrs = buffer.attrs().clone()
|
||||||
|
.family(if monospaced {
|
||||||
|
cosmic_text::Family::Monospace
|
||||||
|
} else {
|
||||||
|
cosmic_text::Family::SansSerif
|
||||||
|
})
|
||||||
|
.monospaced(monospaced);
|
||||||
buffer.set_attrs(&FONT_SYSTEM, attrs);
|
buffer.set_attrs(&FONT_SYSTEM, attrs);
|
||||||
},
|
},
|
||||||
Message::MetricsChanged(metrics) => {
|
Message::MetricsChanged(metrics) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue