Fix transparency for floating windows

macos-click-through
LoipesMas 3 years ago committed by Keith Simmons
parent 5906bf58c3
commit ef8a95a91d

@ -83,6 +83,7 @@ impl GridRenderer {
grid_position: (u64, u64), grid_position: (u64, u64),
cell_width: u64, cell_width: u64,
style: &Option<Arc<Style>>, style: &Option<Arc<Style>>,
is_floating: bool,
) { ) {
self.paint.set_blend_mode(BlendMode::Src); self.paint.set_blend_mode(BlendMode::Src);
@ -99,8 +100,13 @@ impl GridRenderer {
} }
if self.paint.color() == self.get_default_background() { if self.paint.color() == self.get_default_background() {
if is_floating {
self.paint
.set_alpha((255.0 * SETTINGS.get::<RendererSettings>().floating_opacity) as u8);
} else {
self.paint.set_alpha(0); self.paint.set_alpha(0);
} }
}
canvas.draw_rect(region, &self.paint); canvas.draw_rect(region, &self.paint);
} }

@ -354,7 +354,13 @@ impl RenderedWindow {
.. ..
} = line_fragment; } = line_fragment;
let grid_position = (*window_left, *window_top); let grid_position = (*window_left, *window_top);
grid_renderer.draw_background(canvas, grid_position, *width, style); grid_renderer.draw_background(
canvas,
grid_position,
*width,
style,
self.floating_order.is_some(),
);
} }
for line_fragment in line_fragments.into_iter() { for line_fragment in line_fragments.into_iter() {

Loading…
Cancel
Save