From e07d9872f072ab63cf2d74950b989571b84b9826 Mon Sep 17 00:00:00 2001 From: MaxVerevkin Date: Tue, 22 Aug 2023 23:36:54 +0300 Subject: add `blend` config option --- src/bar.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/bar.rs') diff --git a/src/bar.rs b/src/bar.rs index eeb633d..5f24478 100644 --- a/src/bar.rs +++ b/src/bar.rs @@ -118,12 +118,20 @@ impl Bar { let cairo_ctx = cairo::Context::new(&cairo_surf).expect("cairo context"); cairo_ctx.scale(scale_f, scale_f); + if !ss.config.blend { + cairo_ctx.set_operator(cairo::Operator::Source); + } + // Background - cairo_ctx.save().unwrap(); - cairo_ctx.set_operator(cairo::Operator::Source); + if ss.config.blend { + cairo_ctx.save().unwrap(); + cairo_ctx.set_operator(cairo::Operator::Source); + } ss.config.background.apply(&cairo_ctx); cairo_ctx.paint().unwrap(); - cairo_ctx.restore().unwrap(); + if ss.config.blend { + cairo_ctx.restore().unwrap(); + } // Compute tags if self.tags_computed.is_empty() { -- cgit v1.3.1