diff --git a/komorebi-for-kde/komorebi/src/core/mod.rs b/komorebi-for-kde/komorebi/src/core/mod.rs index ce27d8ad..9f358d56 100644 --- a/komorebi-for-kde/komorebi/src/core/mod.rs +++ b/komorebi-for-kde/komorebi/src/core/mod.rs @@ -45,6 +45,11 @@ pub use komorebi_layouts::validate_ratios; pub mod animation; pub mod asc; pub mod config_generation; +pub use komorebi_config::behaviour::CrossBoundaryBehaviour; +pub use komorebi_config::behaviour::FloatingLayerBehaviour; +pub use komorebi_config::behaviour::Placement; +pub use komorebi_config::behaviour::WindowContainerBehaviour; +pub use komorebi_config::behaviour::WindowHidingPosition; pub use komorebi_protocol::pathext; pub use komorebi_protocol::types::ApplicationIdentifier; pub use komorebi_protocol::types::FocusFollowsMouseImplementation; @@ -80,85 +85,6 @@ pub struct WindowManagementBehaviour { pub float_rule_placement: Placement, } -#[derive( - Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq, -)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -/// Window container behaviour when a new window is opened -pub enum WindowContainerBehaviour { - /// Create a new container for each new window - #[default] - Create, - /// Append new windows to the focused window container - Append, -} - -#[derive( - Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq, -)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -/// Floating layer behaviour when a new window is opened -pub enum FloatingLayerBehaviour { - /// Tile new windows (unless they match a float rule or float override is active) - #[default] - Tile, - /// Float new windows - Float, -} - -#[derive( - Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq, -)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -/// Window hiding position -pub enum WindowHidingPosition { - /// Hide windows in the bottom left corner of the screen - #[default] - BottomLeft, - /// Hide windows in the bottom right corner of the screen - BottomRight, -} - -#[derive( - Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq, -)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -/// Placement behaviour for floating windows -pub enum Placement { - /// Does not change the size or position of the window - #[default] - None, - /// Center the window without changing the size - Center, - /// Center the window and resize it according to the `AspectRatio` - CenterAndResize, -} - -impl FloatingLayerBehaviour { - pub fn should_float(&self) -> bool { - match self { - FloatingLayerBehaviour::Tile => false, - FloatingLayerBehaviour::Float => true, - } - } -} - -impl Placement { - pub fn should_center(&self) -> bool { - match self { - Placement::None => false, - Placement::Center | Placement::CenterAndResize => true, - } - } - - pub fn should_resize(&self) -> bool { - match self { - Placement::None | Placement::Center => false, - Placement::CenterAndResize => true, - } - } -} - #[derive( Clone, Copy, @@ -368,19 +294,6 @@ pub enum PlacementMatchingRules { Many(Vec), } -#[derive( - Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq, -)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -/// Behaviour when an action would cross a monitor boundary -pub enum CrossBoundaryBehaviour { - /// Attempt to perform actions across a workspace boundary - Workspace, - /// Attempt to perform actions across a monitor boundary - #[default] - Monitor, -} - pub use komorebi_protocol::message::SocketMessage; #[cfg(test)]