Merge pull request #1219 from mitchellh/config-change

renderer: reload background, foreground, cursor-color at runtime
This commit is contained in:
Mitchell Hashimoto
2024-01-04 21:55:53 -08:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@ -1305,6 +1305,11 @@ pub fn changeConfig(self: *Metal, config: *DerivedConfig) !void {
// Set our new minimum contrast // Set our new minimum contrast
self.uniforms.min_contrast = config.min_contrast; self.uniforms.min_contrast = config.min_contrast;
// Set our new colors
self.background_color = config.background;
self.foreground_color = config.foreground;
self.cursor_color = config.cursor_color;
self.config.deinit(); self.config.deinit();
self.config = config.*; self.config = config.*;
} }

View File

@ -1658,6 +1658,11 @@ pub fn changeConfig(self: *OpenGL, config: *DerivedConfig) !void {
self.font_shaper = font_shaper; self.font_shaper = font_shaper;
} }
// Set our new colors
self.background_color = config.background;
self.foreground_color = config.foreground;
self.cursor_color = config.cursor_color;
// Update our uniforms // Update our uniforms
self.deferred_config = .{}; self.deferred_config = .{};