Struct leftwm_core::models::Workspace
source · [−]pub struct Workspace {
pub id: Option<i32>,
pub layout: Layout,
pub main_width_percentage: u8,
pub tag: Option<TagId>,
pub margin: Margins,
pub margin_multiplier: f32,
pub gutters: Vec<Gutter>,
pub avoid: Vec<Xyhw>,
pub xyhw: Xyhw,
pub max_window_width: Option<Size>,
/* private fields */
}
Expand description
Information for workspaces (screen divisions).
Fields
id: Option<i32>
layout: Layout
main_width_percentage: u8
tag: Option<TagId>
margin: Margins
margin_multiplier: f32
gutters: Vec<Gutter>
avoid: Vec<Xyhw>
xyhw: Xyhw
max_window_width: Option<Size>
Implementations
sourceimpl Workspace
impl Workspace
pub fn new(
id: Option<i32>,
bbox: BBox,
layout: Layout,
max_window_width: Option<Size>
) -> Self
pub fn load_config(&mut self, config: &impl Config)
pub fn get_gutters_for_theme(&mut self, config: &impl Config) -> Vec<Gutter>
pub fn show_tag(&mut self, tag: &TagId)
pub const fn contains_point(&self, x: i32, y: i32) -> bool
pub fn has_tag(&self, tag: &TagId) -> bool
sourcepub fn is_displaying(&self, window: &Window) -> bool
pub fn is_displaying(&self, window: &Window) -> bool
Returns true if the workspace is displays a given window.
sourcepub fn is_managed(&self, window: &Window) -> bool
pub fn is_managed(&self, window: &Window) -> bool
Returns true if the workspace is to update the locations info of this window.
sourcepub fn x(&self) -> i32
pub fn x(&self) -> i32
Returns the original x position of the workspace,
disregarding the optional max_window_width
configuration
sourcepub fn x_limited(&self, column_count: usize) -> i32
pub fn x_limited(&self, column_count: usize) -> i32
Returns the x position for the workspace,
while accounting for the optional max_window_width
configuration
pub fn y(&self) -> i32
pub fn height(&self) -> i32
sourcepub fn width(&self) -> i32
pub fn width(&self) -> i32
Returns the original width for the workspace,
disregarding the optional max_window_width
configuration
sourcepub fn width_limited(&self, column_count: usize) -> i32
pub fn width_limited(&self, column_count: usize) -> i32
Returns the width of the workspace,
while accounting for the optional max_window_width
configuration
pub fn center_halfed(&self) -> Xyhw
pub fn update_avoided_areas(&mut self)
sourcepub fn set_margin_multiplier(&mut self, margin_multiplier: f32)
pub fn set_margin_multiplier(&mut self, margin_multiplier: f32)
Set the tag model’s margin multiplier.
sourcepub const fn margin_multiplier(&self) -> f32
pub const fn margin_multiplier(&self) -> f32
Get a reference to the tag model’s margin multiplier.
pub fn change_main_width(&mut self, delta: i8)
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Workspace
impl<'de> Deserialize<'de> for Workspace
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnwindSafe for Workspace
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more