correcting docs and removing unused Sides (#159)
Co-authored-by: Bryan Ndjeutcha <ndjeutcha@gmail.com>
This commit is contained in:
parent
a1a313be70
commit
661c29f1d2
2 changed files with 0 additions and 26 deletions
|
@ -113,11 +113,6 @@ pub enum Side {
|
||||||
Left,
|
Left,
|
||||||
Right,
|
Right,
|
||||||
Bottom,
|
Bottom,
|
||||||
Center,
|
|
||||||
TopLeft,
|
|
||||||
TopRight,
|
|
||||||
BottomLeft,
|
|
||||||
BottomRight,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::str::FromStr for Side {
|
impl std::str::FromStr for Side {
|
||||||
|
@ -133,25 +128,6 @@ impl std::str::FromStr for Side {
|
||||||
_ => Err(anyhow!("Failed to parse {} as valid side. Must be one of \"left\", \"right\", \"top\", \"bottom\"", s)),
|
_ => Err(anyhow!("Failed to parse {} as valid side. Must be one of \"left\", \"right\", \"top\", \"bottom\"", s)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "wayland")]
|
|
||||||
fn from_str(s: &str) -> Result<Side> {
|
|
||||||
match s {
|
|
||||||
"l" | "left" => Ok(Side::Left),
|
|
||||||
"r" | "right" => Ok(Side::Right),
|
|
||||||
"t" | "top" => Ok(Side::Top),
|
|
||||||
"b" | "bottom" => Ok(Side::Bottom),
|
|
||||||
"c" | "center" => Ok(Side::Center),
|
|
||||||
"tl" | "top-left" => Ok(Side::TopLeft),
|
|
||||||
"tr" | "top-right" => Ok(Side::TopRight),
|
|
||||||
"bl" | "bottom-left" => Ok(Side::BottomLeft),
|
|
||||||
"br" | "bottom-right" => Ok(Side::BottomRight),
|
|
||||||
_ => Err(anyhow!(
|
|
||||||
r#"Failed to parse {} as valid side. Must be one of "left", "right", "top", "bottom", "top-right", "top-left", "bottom-left", "bottom-right""#,
|
|
||||||
s
|
|
||||||
)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Surface definition if the backend for X11 is enable
|
// Surface definition if the backend for X11 is enable
|
||||||
|
|
|
@ -162,7 +162,6 @@ mod platform {
|
||||||
let dist = match strut_def.side {
|
let dist = match strut_def.side {
|
||||||
Side::Left | Side::Right => strut_def.dist.relative_to(monitor_rect.width) as u32,
|
Side::Left | Side::Right => strut_def.dist.relative_to(monitor_rect.width) as u32,
|
||||||
Side::Top | Side::Bottom => strut_def.dist.relative_to(monitor_rect.height) as u32,
|
Side::Top | Side::Bottom => strut_def.dist.relative_to(monitor_rect.height) as u32,
|
||||||
_ => (monitor_rect.height / 2) as u32,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// don't question it,.....
|
// don't question it,.....
|
||||||
|
@ -176,7 +175,6 @@ mod platform {
|
||||||
Side::Bottom => vec![0, 0, 0, root_window_geometry.height as u32 - mon_end_y + dist, 0, 0, 0, 0, 0, 0, monitor_rect.x as u32, mon_end_x],
|
Side::Bottom => vec![0, 0, 0, root_window_geometry.height as u32 - mon_end_y + dist, 0, 0, 0, 0, 0, 0, monitor_rect.x as u32, mon_end_x],
|
||||||
// This should never happen but if it does the window will be anchored on the
|
// This should never happen but if it does the window will be anchored on the
|
||||||
// right of the screen
|
// right of the screen
|
||||||
_ => vec![0, root_window_geometry.width as u32 - mon_end_x + dist, 0, 0, 0, 0, monitor_rect.y as u32, mon_end_y, 0, 0, 0, 0],
|
|
||||||
}.iter().flat_map(|x| x.to_le_bytes().to_vec()).collect();
|
}.iter().flat_map(|x| x.to_le_bytes().to_vec()).collect();
|
||||||
|
|
||||||
self.conn
|
self.conn
|
||||||
|
|
Loading…
Add table
Reference in a new issue