Make only root_canvas semi-transparent

macos-click-through
LoipesMas 3 years ago committed by Keith Simmons
parent 45ab1843b8
commit b0dc9332c4

@ -75,7 +75,10 @@ impl GridRenderer {
} }
pub fn get_default_background(&self) -> Color { pub fn get_default_background(&self) -> Color {
let transparency = {SETTINGS.get::<WindowSettings>().transparency}; let mut transparency = {SETTINGS.get::<WindowSettings>().transparency};
if transparency < 1.0 {
transparency = 0.0;
}
self.default_style.colors.background.unwrap().to_color().with_a((255.0 * transparency) as u8) self.default_style.colors.background.unwrap().to_color().with_a((255.0 * transparency) as u8)
} }

@ -4,6 +4,7 @@ mod fonts;
pub mod grid_renderer; pub mod grid_renderer;
mod rendered_window; mod rendered_window;
use crate::WindowSettings;
use std::collections::{hash_map::Entry, HashMap}; use std::collections::{hash_map::Entry, HashMap};
use std::sync::mpsc::Receiver; use std::sync::mpsc::Receiver;
use std::sync::Arc; use std::sync::Arc;
@ -97,7 +98,8 @@ impl Renderer {
let default_background = self.grid_renderer.get_default_background(); let default_background = self.grid_renderer.get_default_background();
let font_dimensions = self.grid_renderer.font_dimensions; let font_dimensions = self.grid_renderer.font_dimensions;
root_canvas.clear(default_background); let transparency = {SETTINGS.get::<WindowSettings>().transparency};
root_canvas.clear(default_background.with_a((255.0 * transparency) as u8));
root_canvas.save(); root_canvas.save();
root_canvas.reset_matrix(); root_canvas.reset_matrix();

Loading…
Cancel
Save