tab indicator: Dim colors when column is inactive
Browse files at this commit14ac2cff4cafb2e4df74d2194eaeb1664b33c831Parent: fde627d1 changed file +10 -4
- src/layout/tab_indicator.rs +10 -4
src/layout/tab_indicator.rsmodified+10 -4
| @@ -133,8 +133,7 @@ impl TabIndicator { | |||
| 133 | // Tab count, should match the tabs iterator length. | 133 | // Tab count, should match the tabs iterator length. |
| 134 | tab_count: usize, | 134 | tab_count: usize, |
| 135 | tabs: impl Iterator<Item = TabInfo>, | 135 | tabs: impl Iterator<Item = TabInfo>, |
| 136 | - // TODO: do we indicate inactive-but-selected somehow? | 136 | + is_active: bool, |
| 137 | - _is_active: bool, | ||
| 138 | scale: f64, | 137 | scale: f64, |
| 139 | ) { | 138 | ) { |
| 140 | if !enabled || self.config.off { | 139 | if !enabled || self.config.off { |
| @@ -166,12 +165,19 @@ impl TabIndicator { | |||
| 166 | }; | 165 | }; |
| 167 | gradient_area.loc -= *loc; | 166 | gradient_area.loc -= *loc; |
| 168 | 167 | ||
| 168 | + let mut color_from = tab.gradient.from; | ||
| 169 | + let mut color_to = tab.gradient.to; | ||
| 170 | + if !is_active { | ||
| 171 | + color_from *= 0.5; | ||
| 172 | + color_to *= 0.5; | ||
| 173 | + } | ||
| 174 | + | ||
| 169 | shader.update( | 175 | shader.update( |
| 170 | rect.size, | 176 | rect.size, |
| 171 | gradient_area, | 177 | gradient_area, |
| 172 | tab.gradient.in_, | 178 | tab.gradient.in_, |
| 173 | - tab.gradient.from, | 179 | + color_from, |
| 174 | - tab.gradient.to, | 180 | + color_to, |
| 175 | ((tab.gradient.angle as f32) - 90.).to_radians(), | 181 | ((tab.gradient.angle as f32) - 90.).to_radians(), |
| 176 | Rectangle::from_size(rect.size), | 182 | Rectangle::from_size(rect.size), |
| 177 | 0., | 183 | 0., |