forge
Explore
Log in

Don't you dare go Hollow

tab indicator: Dim colors when column is inactive

Browse files at this commit

14ac2cff4cafb2e4df74d2194eaeb1664b33c831Ivan MolodetskikhParent: fde627d
src/layout/tab_indicator.rsmodified+10 -4
@@ -133,8 +133,7 @@ impl TabIndicator {
133133 // Tab count, should match the tabs iterator length.
134134 tab_count: usize,
135135 tabs: impl Iterator<Item = TabInfo>,
136- // TODO: do we indicate inactive-but-selected somehow?
137- _is_active: bool,
136+ is_active: bool,
138137 scale: f64,
139138 ) {
140139 if !enabled || self.config.off {
@@ -166,12 +165,19 @@ impl TabIndicator {
166165 };
167166 gradient_area.loc -= *loc;
168167
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+
169175 shader.update(
170176 rect.size,
171177 gradient_area,
172178 tab.gradient.in_,
173- tab.gradient.from,
174- tab.gradient.to,
179+ color_from,
180+ color_to,
175181 ((tab.gradient.angle as f32) - 90.).to_radians(),
176182 Rectangle::from_size(rect.size),
177183 0.,