diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2023-08-22 23:36:54 +0300 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2023-08-22 23:36:54 +0300 |
| commit | e07d9872f072ab63cf2d74950b989571b84b9826 (patch) | |
| tree | 53da2c5752b5f329dd489f46b09ba6372da78254 | |
| parent | f27d993243848727249e083f3dc13c471ca856e1 (diff) | |
| download | i3bar-mango-e07d9872f072ab63cf2d74950b989571b84b9826.tar.gz | |
add `blend` config option
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | src/bar.rs | 14 | ||||
| -rw-r--r-- | src/config.rs | 2 |
3 files changed, 14 insertions, 3 deletions
@@ -82,6 +82,7 @@ position = "top" # either "top" or "bottom" hide_inactive_tags = true invert_touchpad_scrolling = true show_layout_name = true +blend = true # whether tags/blocks colors should blend with bar's background # WM-specific options [wm.river] @@ -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() { diff --git a/src/config.rs b/src/config.rs index f6ff47d..382f968 100644 --- a/src/config.rs +++ b/src/config.rs @@ -43,6 +43,7 @@ pub struct Config { pub hide_inactive_tags: bool, pub invert_touchpad_scrolling: bool, pub show_layout_name: bool, + pub blend: bool, // wm-specific pub wm: WmConfig, // overrides @@ -83,6 +84,7 @@ impl Default for Config { hide_inactive_tags: true, invert_touchpad_scrolling: true, show_layout_name: true, + blend: true, wm: WmConfig { river: RiverConfig { max_tag: 9 }, |
