mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-09-16 06:42:01 +02:00
refactor(animation): new animations engine
This commit is comprised of the following interactively rebased commits from PR #1002 by @thearturca.1a184a4442refactor(animation): move animations to its own mod First step for more rusty version animations. The goal is to make animations more generic so its easier to add new animations to komorebi!d3ac6b72c2refactor(animation): reduce mutex calls on `ANIMATION_STYLE`8a42b738ferefactor(animation): introduce `Lerp` traite449861c10refactor(animation): generalized ANIMATION_MANAGER Instead of a isize key for the ANIMATION_MANAGER HashMap, now we use a String key. For window move animation, the key would be `window_move:{hwnd}`. This allows us to use single manager for more types of animations.67b2a7a284feat(animation): introduce `AnimationPrefix` enum8290f143a6feat(animation): introduce `RenderDispatcher` trait2400d757fefeat(animation): implement window transparency animation This commit also fixes graceful shutdown of animations by disabling them before exit and wait for all remaining animations for 20 seconds.44189d8382refactor(animation): move generation of `animation key` to `RenderDispatcher`e502cb3ffbrefactor(animation): rename `animation` mod to `engine` Linter was upset about this: > error: module has the same name as its containing module369107f5e0feat(config): adds per animation configuration options Originally static config only allowed global config for animations. Since this refactor introduces the abilty to add more type of animations, this change allows us to configure `enabled`, `duration` and `style` state per animation type. Now each of them take either the raw value or a JSON object where keys are the animation types and values are desired config value. Also adds support for per animation configuration for komorebic commands.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#![warn(clippy::all)]
|
||||
|
||||
pub mod animation;
|
||||
pub mod animation_manager;
|
||||
pub mod border_manager;
|
||||
pub mod com;
|
||||
#[macro_use]
|
||||
@@ -47,8 +46,6 @@ use std::sync::atomic::AtomicU64;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub use animation::*;
|
||||
pub use animation_manager::*;
|
||||
pub use colour::*;
|
||||
pub use core::*;
|
||||
pub use process_command::*;
|
||||
@@ -216,12 +213,6 @@ lazy_static! {
|
||||
)
|
||||
};
|
||||
|
||||
static ref ANIMATION_STYLE: Arc<Mutex<AnimationStyle >> =
|
||||
Arc::new(Mutex::new(AnimationStyle::Linear));
|
||||
|
||||
static ref ANIMATION_MANAGER: Arc<Mutex<AnimationManager>> =
|
||||
Arc::new(Mutex::new(AnimationManager::new()));
|
||||
|
||||
// Use app-specific titlebar removal options where possible
|
||||
// eg. Windows Terminal, IntelliJ IDEA, Firefox
|
||||
static ref NO_TITLEBAR: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(vec![]));
|
||||
@@ -238,8 +229,6 @@ pub static CUSTOM_FFM: AtomicBool = AtomicBool::new(false);
|
||||
pub static SESSION_ID: AtomicU32 = AtomicU32::new(0);
|
||||
|
||||
pub static REMOVE_TITLEBARS: AtomicBool = AtomicBool::new(false);
|
||||
pub static ANIMATION_ENABLED: AtomicBool = AtomicBool::new(false);
|
||||
pub static ANIMATION_DURATION: AtomicU64 = AtomicU64::new(250);
|
||||
|
||||
pub static SLOW_APPLICATION_COMPENSATION_TIME: AtomicU64 = AtomicU64::new(20);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user