Implement interactive window move

This commit is contained in:
Rasmus Eneman
2024-07-15 15:51:48 +02:00
committed by Ivan Molodetskikh
parent d640e85158
commit e887ee93a3
11 changed files with 1651 additions and 61 deletions
+28
View File
@@ -421,6 +421,8 @@ pub struct Layout {
pub focus_ring: FocusRing,
#[knuffel(child, default)]
pub border: Border,
#[knuffel(child, default)]
pub insert_hint: InsertHint,
#[knuffel(child, unwrap(children), default)]
pub preset_column_widths: Vec<PresetSize>,
#[knuffel(child)]
@@ -442,6 +444,7 @@ impl Default for Layout {
Self {
focus_ring: Default::default(),
border: Default::default(),
insert_hint: Default::default(),
preset_column_widths: Default::default(),
default_column_width: Default::default(),
center_focused_column: Default::default(),
@@ -588,6 +591,23 @@ impl From<FocusRing> for Border {
}
}
#[derive(knuffel::Decode, Debug, Clone, Copy, PartialEq)]
pub struct InsertHint {
#[knuffel(child)]
pub off: bool,
#[knuffel(child, default = Self::default().color)]
pub color: Color,
}
impl Default for InsertHint {
fn default() -> Self {
Self {
off: false,
color: Color::from_rgba8_unpremul(127, 200, 255, 128),
}
}
}
/// RGB color in [0, 1] with unpremultiplied alpha.
#[derive(Debug, Default, Clone, Copy, PartialEq)]
pub struct Color {
@@ -3028,6 +3048,10 @@ mod tests {
}
center-focused-column "on-overflow"
insert-hint {
color "rgb(255, 200, 127)"
}
}
spawn-at-startup "alacritty" "-e" "fish"
@@ -3226,6 +3250,10 @@ mod tests {
active_gradient: None,
inactive_gradient: None,
},
insert_hint: InsertHint {
off: false,
color: Color::from_rgba8_unpremul(255, 200, 127, 255),
},
preset_column_widths: vec![
PresetSize::Proportion(0.25),
PresetSize::Proportion(0.5),