mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Add urgent color support to tab indicators
This commit is contained in:
@@ -3820,8 +3820,9 @@ impl<W: LayoutElement> Column<W> {
|
||||
.enumerate()
|
||||
.map(|(tile_idx, (tile, tile_off))| {
|
||||
let is_active = tile_idx == active_idx;
|
||||
let is_urgent = tile.window().is_urgent();
|
||||
let tile_pos = tile_off + tile.render_offset();
|
||||
TabInfo::from_tile(tile, tile_pos, is_active, &config)
|
||||
TabInfo::from_tile(tile, tile_pos, is_active, is_urgent, &config)
|
||||
});
|
||||
|
||||
// Hide the tab indicator in fullscreen. If you have it configured to overlap the window,
|
||||
|
||||
@@ -350,13 +350,16 @@ impl TabInfo {
|
||||
tile: &Tile<W>,
|
||||
position: Point<f64, Logical>,
|
||||
is_active: bool,
|
||||
is_urgent: bool,
|
||||
config: &niri_config::TabIndicator,
|
||||
) -> Self {
|
||||
let rules = tile.window().rules();
|
||||
let rule = rules.tab_indicator;
|
||||
|
||||
let gradient_from_rule = || {
|
||||
let (color, gradient) = if is_active {
|
||||
let (color, gradient) = if is_urgent {
|
||||
(rule.urgent_color, rule.urgent_gradient)
|
||||
} else if is_active {
|
||||
(rule.active_color, rule.active_gradient)
|
||||
} else {
|
||||
(rule.inactive_color, rule.inactive_gradient)
|
||||
@@ -366,7 +369,9 @@ impl TabInfo {
|
||||
};
|
||||
|
||||
let gradient_from_config = || {
|
||||
let (color, gradient) = if is_active {
|
||||
let (color, gradient) = if is_urgent {
|
||||
(config.urgent_color, config.urgent_gradient)
|
||||
} else if is_active {
|
||||
(config.active_color, config.active_gradient)
|
||||
} else {
|
||||
(config.inactive_color, config.inactive_gradient)
|
||||
@@ -386,7 +391,9 @@ impl TabInfo {
|
||||
focus_ring_config
|
||||
};
|
||||
|
||||
let (color, gradient) = if is_active {
|
||||
let (color, gradient) = if is_urgent {
|
||||
(config.urgent_color, config.urgent_gradient)
|
||||
} else if is_active {
|
||||
(config.active_color, config.active_gradient)
|
||||
} else {
|
||||
(config.inactive_color, config.inactive_gradient)
|
||||
|
||||
@@ -220,8 +220,10 @@ impl ResolvedWindowRules {
|
||||
tab_indicator: TabIndicatorRule {
|
||||
active_color: None,
|
||||
inactive_color: None,
|
||||
urgent_color: None,
|
||||
active_gradient: None,
|
||||
inactive_gradient: None,
|
||||
urgent_gradient: None,
|
||||
},
|
||||
draw_border_with_background: None,
|
||||
opacity: None,
|
||||
|
||||
Reference in New Issue
Block a user