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 | 133 | // Tab count, should match the tabs iterator length. |
| 134 | 134 | tab_count: usize, |
| 135 | 135 | tabs: impl Iterator<Item = TabInfo>, |
| 136 | - // TODO: do we indicate inactive-but-selected somehow? | |
| 137 | - _is_active: bool, | |
| 136 | + is_active: bool, | |
| 138 | 137 | scale: f64, |
| 139 | 138 | ) { |
| 140 | 139 | if !enabled || self.config.off { |
| @@ -166,12 +165,19 @@ impl TabIndicator { | ||
| 166 | 165 | }; |
| 167 | 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 | 175 | shader.update( |
| 170 | 176 | rect.size, |
| 171 | 177 | gradient_area, |
| 172 | 178 | tab.gradient.in_, |
| 173 | - tab.gradient.from, | |
| 174 | - tab.gradient.to, | |
| 179 | + color_from, | |
| 180 | + color_to, | |
| 175 | 181 | ((tab.gradient.angle as f32) - 90.).to_radians(), |
| 176 | 182 | Rectangle::from_size(rect.size), |
| 177 | 183 | 0., |