add urgent border color and gradient

This commit is contained in:
Duncan Overbruck
2025-03-22 19:04:24 +01:00
committed by Ivan Molodetskikh
parent caa6189448
commit 398bc78ea0
8 changed files with 79 additions and 3 deletions
+7 -2
View File
@@ -59,6 +59,7 @@ impl FocusRing {
win_size: Size<f64, Logical>,
is_active: bool,
is_border: bool,
is_urgent: bool,
view_rect: Rectangle<f64, Logical>,
radius: CornerRadius,
scale: f64,
@@ -67,7 +68,9 @@ impl FocusRing {
let width = self.config.width.0;
self.full_size = win_size + Size::from((width, width)).upscale(2.);
let color = if is_active {
let color = if is_urgent {
self.config.urgent_color
} else if is_active {
self.config.active_color
} else {
self.config.inactive_color
@@ -79,7 +82,9 @@ impl FocusRing {
let radius = radius.fit_to(self.full_size.w as f32, self.full_size.h as f32);
let gradient = if is_active {
let gradient = if is_urgent {
self.config.urgent_gradient
} else if is_active {
self.config.active_gradient
} else {
self.config.inactive_gradient
+5 -1
View File
@@ -19,8 +19,10 @@ impl InsertHintElement {
width: FloatOrInt(0.),
active_color: config.color,
inactive_color: config.color,
urgent_color: config.color,
active_gradient: config.gradient,
inactive_gradient: config.gradient,
urgent_gradient: config.gradient,
}),
}
}
@@ -31,8 +33,10 @@ impl InsertHintElement {
width: FloatOrInt(0.),
active_color: config.color,
inactive_color: config.color,
urgent_color: config.color,
active_gradient: config.gradient,
inactive_gradient: config.gradient,
urgent_gradient: config.gradient,
});
}
@@ -48,7 +52,7 @@ impl InsertHintElement {
scale: f64,
) {
self.inner
.update_render_elements(size, true, false, view_rect, radius, scale, 1.);
.update_render_elements(size, true, false, false, view_rect, radius, scale, 1.);
}
pub fn render(
+2
View File
@@ -366,6 +366,7 @@ impl<W: LayoutElement> Tile<W> {
self.animated_window_size(),
is_active,
!draw_border_with_background,
self.window.is_urgent(),
Rectangle::new(
view_rect.loc - Point::from((border_width, border_width)),
view_rect.size,
@@ -400,6 +401,7 @@ impl<W: LayoutElement> Tile<W> {
self.animated_tile_size(),
is_active,
!draw_focus_ring_with_background,
self.window.is_urgent(),
view_rect,
radius,
self.scale,
+4
View File
@@ -191,8 +191,10 @@ impl ResolvedWindowRules {
width: None,
active_color: None,
inactive_color: None,
urgent_color: None,
active_gradient: None,
inactive_gradient: None,
urgent_gradient: None,
},
border: BorderRule {
off: false,
@@ -200,8 +202,10 @@ impl ResolvedWindowRules {
width: None,
active_color: None,
inactive_color: None,
urgent_color: None,
active_gradient: None,
inactive_gradient: None,
urgent_gradient: None,
},
shadow: ShadowRule {
off: false,