From 1b6d562307ac7abca1805de6697e41a94ec98645 Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Sun, 20 Dec 2020 19:38:38 -0800 Subject: [PATCH] add configuration for the window transparency --- src/renderer/mod.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index 60aee8a..4246b16 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -44,7 +44,7 @@ pub fn initialize_settings() { "floating_window_opacity", RendererSettings::floating_opacity ); - register_nvim_setting!("floating_window_blur", RendererSettings::floating_opacity); + register_nvim_setting!("floating_window_blur", RendererSettings::floating_blur); } // ---------------------------------------------------------------------------- @@ -52,7 +52,6 @@ pub fn initialize_settings() { pub struct Renderer { rendered_windows: HashMap, cursor_renderer: CursorRenderer, - settings: RendererSettings, pub paint: Paint, pub shaper: CachingShaper, @@ -67,7 +66,6 @@ impl Renderer { pub fn new(batched_draw_command_receiver: Receiver>) -> Renderer { let rendered_windows = HashMap::new(); let cursor_renderer = CursorRenderer::new(); - let settings = SETTINGS.get::(); let mut paint = Paint::new(colors::WHITE, None); paint.set_anti_alias(false); @@ -83,7 +81,6 @@ impl Renderer { Renderer { rendered_windows, cursor_renderer, - settings, paint, shaper, @@ -315,12 +312,12 @@ impl Renderer { .collect() }; - let settings = &self.settings; + let settings = SETTINGS.get::(); let font_width = self.font_width; let font_height = self.font_height; self.window_regions = windows .into_iter() - .map(|window| window.draw(root_canvas, settings, font_width, font_height, dt)) + .map(|window| window.draw(root_canvas, &settings, font_width, font_height, dt)) .collect(); self.cursor_renderer.draw(