aboutsummaryrefslogtreecommitdiff
path: root/niri-config/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-11-02 09:33:44 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-11-02 10:53:55 +0300
commit05d218113c1209f58b0dcdd415f1e095d4ff2b46 (patch)
tree57a10521ada23b1974e67f144a02fd92ad6a2c40 /niri-config/src
parentef6af6adc1094db05d1df3953a18f6550816f71e (diff)
downloadniri-05d218113c1209f58b0dcdd415f1e095d4ff2b46.tar.gz
niri-05d218113c1209f58b0dcdd415f1e095d4ff2b46.tar.bz2
niri-05d218113c1209f58b0dcdd415f1e095d4ff2b46.zip
Add gradient support for the insert hint
Implement it via FocusRing which already handles SolidColor vs. Border render element.
Diffstat (limited to 'niri-config/src')
-rw-r--r--niri-config/src/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs
index d8613def..042cf6ba 100644
--- a/niri-config/src/lib.rs
+++ b/niri-config/src/lib.rs
@@ -597,6 +597,8 @@ pub struct InsertHint {
pub off: bool,
#[knuffel(child, default = Self::default().color)]
pub color: Color,
+ #[knuffel(child)]
+ pub gradient: Option<Gradient>,
}
impl Default for InsertHint {
@@ -604,6 +606,7 @@ impl Default for InsertHint {
Self {
off: false,
color: Color::from_rgba8_unpremul(127, 200, 255, 128),
+ gradient: None,
}
}
}
@@ -3051,6 +3054,7 @@ mod tests {
insert-hint {
color "rgb(255, 200, 127)"
+ gradient from="rgba(10, 20, 30, 1.0)" to="#0080ffff" relative-to="workspace-view"
}
}
@@ -3253,6 +3257,16 @@ mod tests {
insert_hint: InsertHint {
off: false,
color: Color::from_rgba8_unpremul(255, 200, 127, 255),
+ gradient: Some(Gradient {
+ from: Color::from_rgba8_unpremul(10, 20, 30, 255),
+ to: Color::from_rgba8_unpremul(0, 128, 255, 255),
+ angle: 180,
+ relative_to: GradientRelativeTo::WorkspaceView,
+ in_: GradientInterpolation {
+ color_space: GradientColorSpace::Srgb,
+ hue_interpolation: HueInterpolation::Shorter,
+ },
+ }),
},
preset_column_widths: vec![
PresetSize::Proportion(0.25),