From 4b264afa48b5f7ac7242575c54daceca2a07e962 Mon Sep 17 00:00:00 2001 From: MultisampledNight Date: Fri, 6 May 2022 17:51:05 +0200 Subject: [PATCH 1/2] Add configurable blur --- src/renderer/mod.rs | 2 ++ src/renderer/rendered_window.rs | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index c175cf8..ebc1570 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -35,6 +35,7 @@ pub struct RendererSettings { scroll_animation_length: f32, floating_opacity: f32, floating_blur: bool, + floating_blur_amount: f32, debug_renderer: bool, profiler: bool, } @@ -46,6 +47,7 @@ impl Default for RendererSettings { scroll_animation_length: 0.3, floating_opacity: 0.7, floating_blur: true, + floating_blur_amount: 2.0, debug_renderer: false, profiler: false, } diff --git a/src/renderer/rendered_window.rs b/src/renderer/rendered_window.rs index ab9b9bf..adf0a04 100644 --- a/src/renderer/rendered_window.rs +++ b/src/renderer/rendered_window.rs @@ -255,7 +255,13 @@ impl RenderedWindow { } 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, settings.floating_blur_amount), + None, + None, + None, + ) + .unwrap(); let save_layer_rec = SaveLayerRec::default() .backdrop(&blur) .bounds(&pixel_region); From 5d26ec2930d8713c8dd1f615447bbe5118c9eac2 Mon Sep 17 00:00:00 2001 From: MultisampledNight Date: Sun, 8 May 2022 20:00:00 +0200 Subject: [PATCH 2/2] Split unified blur amount into X and Y --- src/renderer/mod.rs | 6 ++++-- src/renderer/rendered_window.rs | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index ebc1570..2154ab3 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -35,7 +35,8 @@ pub struct RendererSettings { scroll_animation_length: f32, floating_opacity: f32, floating_blur: bool, - floating_blur_amount: f32, + floating_blur_amount_x: f32, + floating_blur_amount_y: f32, debug_renderer: bool, profiler: bool, } @@ -47,7 +48,8 @@ impl Default for RendererSettings { scroll_animation_length: 0.3, floating_opacity: 0.7, floating_blur: true, - floating_blur_amount: 2.0, + floating_blur_amount_x: 2.0, + floating_blur_amount_y: 2.0, debug_renderer: false, profiler: false, } diff --git a/src/renderer/rendered_window.rs b/src/renderer/rendered_window.rs index adf0a04..cc179e3 100644 --- a/src/renderer/rendered_window.rs +++ b/src/renderer/rendered_window.rs @@ -256,7 +256,10 @@ impl RenderedWindow { if self.floating_order.is_some() && settings.floating_blur { let blur = blur( - (settings.floating_blur_amount, settings.floating_blur_amount), + ( + settings.floating_blur_amount_x, + settings.floating_blur_amount_y, + ), None, None, None,