mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
tab indicator: Dim colors when column is inactive
This commit is contained in:
@@ -133,8 +133,7 @@ impl TabIndicator {
|
|||||||
// Tab count, should match the tabs iterator length.
|
// Tab count, should match the tabs iterator length.
|
||||||
tab_count: usize,
|
tab_count: usize,
|
||||||
tabs: impl Iterator<Item = TabInfo>,
|
tabs: impl Iterator<Item = TabInfo>,
|
||||||
// TODO: do we indicate inactive-but-selected somehow?
|
is_active: bool,
|
||||||
_is_active: bool,
|
|
||||||
scale: f64,
|
scale: f64,
|
||||||
) {
|
) {
|
||||||
if !enabled || self.config.off {
|
if !enabled || self.config.off {
|
||||||
@@ -166,12 +165,19 @@ impl TabIndicator {
|
|||||||
};
|
};
|
||||||
gradient_area.loc -= *loc;
|
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(
|
shader.update(
|
||||||
rect.size,
|
rect.size,
|
||||||
gradient_area,
|
gradient_area,
|
||||||
tab.gradient.in_,
|
tab.gradient.in_,
|
||||||
tab.gradient.from,
|
color_from,
|
||||||
tab.gradient.to,
|
color_to,
|
||||||
((tab.gradient.angle as f32) - 90.).to_radians(),
|
((tab.gradient.angle as f32) - 90.).to_radians(),
|
||||||
Rectangle::from_size(rect.size),
|
Rectangle::from_size(rect.size),
|
||||||
0.,
|
0.,
|
||||||
|
|||||||
Reference in New Issue
Block a user