Merge pull request #1303 from MultisampledNight/configurable-blur

Add configurable blur amount
macos-click-through
multisn8 3 years ago committed by GitHub
commit 69902a4272
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -35,6 +35,8 @@ pub struct RendererSettings {
scroll_animation_length: f32, scroll_animation_length: f32,
floating_opacity: f32, floating_opacity: f32,
floating_blur: bool, floating_blur: bool,
floating_blur_amount_x: f32,
floating_blur_amount_y: f32,
debug_renderer: bool, debug_renderer: bool,
profiler: bool, profiler: bool,
} }
@ -46,6 +48,8 @@ impl Default for RendererSettings {
scroll_animation_length: 0.3, scroll_animation_length: 0.3,
floating_opacity: 0.7, floating_opacity: 0.7,
floating_blur: true, floating_blur: true,
floating_blur_amount_x: 2.0,
floating_blur_amount_y: 2.0,
debug_renderer: false, debug_renderer: false,
profiler: false, profiler: false,
} }

@ -255,7 +255,16 @@ impl RenderedWindow {
} }
if self.floating_order.is_some() && settings.floating_blur { if self.floating_order.is_some() && settings.floating_blur {
let blur = blur((2.0, 2.0), None, None, None).unwrap(); let blur = blur(
(
settings.floating_blur_amount_x,
settings.floating_blur_amount_y,
),
None,
None,
None,
)
.unwrap();
let save_layer_rec = SaveLayerRec::default() let save_layer_rec = SaveLayerRec::default()
.backdrop(&blur) .backdrop(&blur)
.bounds(&pixel_region); .bounds(&pixel_region);

Loading…
Cancel
Save