Skip to content

Commit

Permalink
feat(animation): bring in changes from #597
Browse files Browse the repository at this point in the history
This commit contains all the changes of #597 to make it easier to rebase
with the latest changes on master post-v0.1.21.
  • Loading branch information
LGUG2Z committed Mar 26, 2024
1 parent 79fb098 commit cb35eeb
Show file tree
Hide file tree
Showing 16 changed files with 786 additions and 24 deletions.
43 changes: 43 additions & 0 deletions komorebi-core/src/animation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
use clap::ValueEnum;
use schemars::JsonSchema;
use serde::Deserialize;
use serde::Serialize;
use strum::Display;
use strum::EnumString;

#[derive(
Copy, Clone, Debug, Serialize, Deserialize, Display, EnumString, ValueEnum, JsonSchema,
)]
#[strum(serialize_all = "snake_case")]
pub enum EaseEnum {
Linear,
EaseInSine,
EaseOutSine,
EaseInOutSine,
EaseInQuad,
EaseOutQuad,
EaseInOutQuad,
EaseInCubic,
EaseInOutCubic,
EaseInQuart,
EaseOutQuart,
EaseInOutQuart,
EaseInQuint,
EaseOutQuint,
EaseInOutQuint,
EaseInExpo,
EaseOutExpo,
EaseInOutExpo,
EaseInCirc,
EaseOutCirc,
EaseInOutCirc,
EaseInBack,
EaseOutBack,
EaseInOutBack,
EaseInElastic,
EaseOutElastic,
EaseInOutElastic,
EaseInBounce,
EaseOutBounce,
EaseInOutBounce,
}
5 changes: 5 additions & 0 deletions komorebi-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use serde::Serialize;
use strum::Display;
use strum::EnumString;

pub use animation::EaseEnum;
pub use arrangement::Arrangement;
pub use arrangement::Axis;
pub use custom_layout::CustomLayout;
Expand All @@ -24,6 +25,7 @@ pub use layout::Layout;
pub use operation_direction::OperationDirection;
pub use rect::Rect;

pub mod animation;
pub mod arrangement;
pub mod config_generation;
pub mod custom_layout;
Expand Down Expand Up @@ -129,6 +131,9 @@ pub enum SocketMessage {
WatchConfiguration(bool),
CompleteConfiguration,
AltFocusHack(bool),
Animation(bool),
AnimationDuration(u64),
AnimationEase(EaseEnum),
ActiveWindowBorder(bool),
ActiveWindowBorderColour(WindowKind, u32, u32, u32),
ActiveWindowBorderWidth(i32),
Expand Down
10 changes: 10 additions & 0 deletions komorebi-core/src/rect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,14 @@ impl Rect {
bottom: (self.bottom * rect_dpi) / system_dpi,
}
}

#[must_use]
pub const fn rect(&self) -> RECT {
RECT {
left: self.left,
top: self.top,
right: self.left + self.right,
bottom: self.top + self.bottom,
}
}
}

0 comments on commit cb35eeb

Please sign in to comment.