-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(animation): bring in changes from #597
This commit contains all the changes of #597 to make it easier to rebase with the latest changes on master post-v0.1.21. fix(animation): Fixed cancelling logic (57e9b2f) Added static animation state manager for tracking "in_progress" and "is_cancelled" states. The idea is not to have states in Animation struct but to keep them in HashMap<hwnd, AnimationState> behind reference (Arc<Mutex<>>). So we each animation frame we have access to state and can cancel animation if we have to. Need review and testings refactor(animation): avoid unwrap (fa6d5bb) fix(animation): Move cancel call to Animation struct (306513f) Only focused window was cancelling its animation because we call cancel in window::set_position and waiting for its cancelling. And because we waiting for cancelling second window is still moving. Second window will stop moving only after the first window. So I moved `cancel` call to Animation struct so its happening in its own thread and doesn't block others animation moves and cancels.
- Loading branch information
Showing
17 changed files
with
827 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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, | ||
)] | ||
pub enum AnimationStyle { | ||
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.