Struct leftwm_core::Workspace
source · pub struct Workspace {
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>,
pub output: String,
pub id: usize,
/* private fields */
}
Expand description
Information for workspaces (screen divisions).
Fields§
§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>
§output: String
Output (monitor) the workspace is linked to.
id: usize
ID of workspace on output. Starts with 1.
Implementations§
source§impl Workspace
impl Workspace
pub fn new(
bbox: BBox,
layout: Layout,
max_window_width: Option<Size>,
output: String,
id: usize
) -> 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.