Feature: Animation. Need fixes

At current state animation is working. Configs are available for it.
animation enable/disable
animation-duration {duration in ms}
animation-ease -e {ease func. See --help}

Two major problems for my implementation:
1. Google Chrome window is broken and I don't know how to implement fix
   for it.
2. Border window does not update properly with window. Dont know how to
   fix it.
This commit is contained in:
thearturca
2023-12-03 09:06:46 -08:00
committed by LGUG2Z
parent 9d1c0ad790
commit 95df970860
10 changed files with 670 additions and 68 deletions
+38
View File
@@ -21,6 +21,7 @@ use color_eyre::Result;
use fs_tail::TailedFile;
use heck::ToKebabCase;
use komorebi_core::resolve_home_path;
use komorebi_core::EaseEnum;
use lazy_static::lazy_static;
use paste::paste;
use sysinfo::SystemExt;
@@ -627,6 +628,25 @@ struct ActiveWindowBorderOffset {
offset: i32,
}
#[derive(Parser, AhkFunction)]
struct Animate {
#[clap(value_enum)]
boolean_state: BooleanState,
}
#[derive(Parser, AhkFunction)]
struct AnimateDuration {
/// Desired animation durations in ms
duration: u64,
}
#[derive(Parser, AhkFunction)]
struct AnimateEase {
/// Desired ease function for animation
#[clap(value_enum, short, long, default_value = "linear")]
ease_func: EaseEnum,
}
#[derive(Parser, AhkFunction)]
#[allow(clippy::struct_excessive_bools)]
struct Start {
@@ -1059,6 +1079,15 @@ enum SubCommand {
/// Set the offset for the active window border
#[clap(arg_required_else_help = true)]
ActiveWindowBorderOffset(ActiveWindowBorderOffset),
/// Enable or disable the window move animation
#[clap(arg_required_else_help = true)]
Animate(Animate),
/// Set the duration for the window move animation in ms
#[clap(arg_required_else_help = true)]
AnimateDuration(AnimateDuration),
/// Set the ease function for the window move animation
#[clap(arg_required_else_help = true)]
AnimateEase(AnimateEase),
/// Enable or disable focus follows mouse for the operating system
#[clap(arg_required_else_help = true)]
FocusFollowsMouse(FocusFollowsMouse),
@@ -1986,6 +2015,15 @@ Stop-Process -Name:whkd -ErrorAction SilentlyContinue
SubCommand::ActiveWindowBorderOffset(arg) => {
send_message(&SocketMessage::ActiveWindowBorderOffset(arg.offset).as_bytes()?)?;
}
SubCommand::Animate(arg) => {
send_message(&SocketMessage::Animate(arg.boolean_state.into()).as_bytes()?)?;
}
SubCommand::AnimateDuration(arg) => {
send_message(&SocketMessage::AnimateDuration(arg.duration).as_bytes()?)?;
}
SubCommand::AnimateEase(arg) => {
send_message(&SocketMessage::AnimateEase(arg.ease_func).as_bytes()?)?;
}
SubCommand::ResizeDelta(arg) => {
send_message(&SocketMessage::ResizeDelta(arg.pixels).as_bytes()?)?;
}