Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,18 @@ impl App {
self.reseed_pane_palettes();
new_cfg.save();
window.set_title(&new_cfg.window.title);

if self.state.config.font.family != new_cfg.font.family {
self.renderer.reload_font_family(&new_cfg.font.family);
for tab in &mut self.state.tabs {
let current_px = tab.metrics.font_px;
tab.metrics = self.renderer.make_metrics(current_px);
}
}

self.state.config = new_cfg;
self.sync_all_pane_sizes();
window.request_redraw();
self.state.config_panel = None;
}

Expand Down
4 changes: 4 additions & 0 deletions src/renderer/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ impl Renderer {
}
}

pub fn reload_font_family(&mut self, family: &str) {
self.glyphs = GlyphCache::new(family);
}

/// Compute metrics for a given font size using the shared glyph cache.
pub fn make_metrics(&mut self, font_px: f32) -> FontMetrics {
FontMetrics::compute(&mut self.glyphs, font_px)
Expand Down
2 changes: 1 addition & 1 deletion src/tui_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ impl ConfigPanel {
}
match self.build_config() {
Ok(cfg) => {
self.status = Some("Saved. Font/color changes apply on restart.".into());
self.status = Some("Saved.".into());
ConfigAction::Save(Box::new(cfg))
}
Err(e) => {
Expand Down