Merge pull request #1146 from LoipesMas/transparency

Fix floating windows transparency
macos-click-through
LoipesMas 3 years ago committed by GitHub
commit 9e422e1b1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -106,13 +106,12 @@ impl GridRenderer {
.set_color(style.background(&self.default_style.colors).to_color()); .set_color(style.background(&self.default_style.colors).to_color());
} }
if (SETTINGS.get::<WindowSettings>().transparency - 1.0).abs() > f32::EPSILON // Only make background color transparent
&& self.paint.color() == self.get_default_background() if self.paint.color() == self.get_default_background() {
{
if is_floating { if is_floating {
self.paint self.paint
.set_alpha((255.0 * SETTINGS.get::<RendererSettings>().floating_opacity) as u8); .set_alpha((255.0 * SETTINGS.get::<RendererSettings>().floating_opacity) as u8);
} else { } else if (SETTINGS.get::<WindowSettings>().transparency - 1.0).abs() > f32::EPSILON {
self.paint.set_alpha(0); self.paint.set_alpha(0);
} }
} }

@ -279,7 +279,7 @@ impl RenderedWindow {
paint.set_color(default_background.with_a(a)); paint.set_color(default_background.with_a(a));
root_canvas.draw_rect(pixel_region, &paint); root_canvas.draw_rect(pixel_region, &paint);
paint.set_color(Color::from_argb(a, 255, 255, 255)); paint.set_color(Color::from_argb(255, 255, 255, 255));
let font_height = font_dimensions.height; let font_height = font_dimensions.height;

Loading…
Cancel
Save