aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-02-10 13:29:00 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-02-10 07:29:33 -0800
commit14ac2cff4cafb2e4df74d2194eaeb1664b33c831 (patch)
tree6d92caaf99a2e39aa6061fa0e0efd525c92db558
parentfde627d955bd0d7b1211587a0fc08442bf00e079 (diff)
downloadniri-14ac2cff4cafb2e4df74d2194eaeb1664b33c831.tar.gz
niri-14ac2cff4cafb2e4df74d2194eaeb1664b33c831.tar.bz2
niri-14ac2cff4cafb2e4df74d2194eaeb1664b33c831.zip
tab indicator: Dim colors when column is inactive
-rw-r--r--src/layout/tab_indicator.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/layout/tab_indicator.rs b/src/layout/tab_indicator.rs
index ad457386..cbe1e932 100644
--- a/src/layout/tab_indicator.rs
+++ b/src/layout/tab_indicator.rs
@@ -133,8 +133,7 @@ impl TabIndicator {
// Tab count, should match the tabs iterator length.
tab_count: usize,
tabs: impl Iterator<Item = TabInfo>,
- // TODO: do we indicate inactive-but-selected somehow?
- _is_active: bool,
+ is_active: bool,
scale: f64,
) {
if !enabled || self.config.off {
@@ -166,12 +165,19 @@ impl TabIndicator {
};
gradient_area.loc -= *loc;
+ let mut color_from = tab.gradient.from;
+ let mut color_to = tab.gradient.to;
+ if !is_active {
+ color_from *= 0.5;
+ color_to *= 0.5;
+ }
+
shader.update(
rect.size,
gradient_area,
tab.gradient.in_,
- tab.gradient.from,
- tab.gradient.to,
+ color_from,
+ color_to,
((tab.gradient.angle as f32) - 90.).to_radians(),
Rectangle::from_size(rect.size),
0.,