refactor(cli): update animation cmd names

This commit is contained in:
LGUG2Z
2023-12-01 16:24:30 -08:00
parent a8aad69ecb
commit 23cc38b1d3

View File

@@ -629,19 +629,19 @@ struct ActiveWindowBorderOffset {
} }
#[derive(Parser, AhkFunction)] #[derive(Parser, AhkFunction)]
struct Animate { struct Animation {
#[clap(value_enum)] #[clap(value_enum)]
boolean_state: BooleanState, boolean_state: BooleanState,
} }
#[derive(Parser, AhkFunction)] #[derive(Parser, AhkFunction)]
struct AnimateDuration { struct AnimationDuration {
/// Desired animation durations in ms /// Desired animation durations in ms
duration: u64, duration: u64,
} }
#[derive(Parser, AhkFunction)] #[derive(Parser, AhkFunction)]
struct AnimateEase { struct AnimationEase {
/// Desired ease function for animation /// Desired ease function for animation
#[clap(value_enum, short, long, default_value = "linear")] #[clap(value_enum, short, long, default_value = "linear")]
ease_func: EaseEnum, ease_func: EaseEnum,
@@ -1081,13 +1081,13 @@ enum SubCommand {
ActiveWindowBorderOffset(ActiveWindowBorderOffset), ActiveWindowBorderOffset(ActiveWindowBorderOffset),
/// Enable or disable the window move animation /// Enable or disable the window move animation
#[clap(arg_required_else_help = true)] #[clap(arg_required_else_help = true)]
Animate(Animate), Animation(Animation),
/// Set the duration for the window move animation in ms /// Set the duration for the window move animation in ms
#[clap(arg_required_else_help = true)] #[clap(arg_required_else_help = true)]
AnimateDuration(AnimateDuration), AnimationDuration(AnimationDuration),
/// Set the ease function for the window move animation /// Set the ease function for the window move animation
#[clap(arg_required_else_help = true)] #[clap(arg_required_else_help = true)]
AnimateEase(AnimateEase), AnimationEase(AnimationEase),
/// Enable or disable focus follows mouse for the operating system /// Enable or disable focus follows mouse for the operating system
#[clap(arg_required_else_help = true)] #[clap(arg_required_else_help = true)]
FocusFollowsMouse(FocusFollowsMouse), FocusFollowsMouse(FocusFollowsMouse),
@@ -2015,13 +2015,13 @@ Stop-Process -Name:whkd -ErrorAction SilentlyContinue
SubCommand::ActiveWindowBorderOffset(arg) => { SubCommand::ActiveWindowBorderOffset(arg) => {
send_message(&SocketMessage::ActiveWindowBorderOffset(arg.offset).as_bytes()?)?; send_message(&SocketMessage::ActiveWindowBorderOffset(arg.offset).as_bytes()?)?;
} }
SubCommand::Animate(arg) => { SubCommand::Animation(arg) => {
send_message(&SocketMessage::Animation(arg.boolean_state.into()).as_bytes()?)?; send_message(&SocketMessage::Animation(arg.boolean_state.into()).as_bytes()?)?;
} }
SubCommand::AnimateDuration(arg) => { SubCommand::AnimationDuration(arg) => {
send_message(&SocketMessage::AnimationDuration(arg.duration).as_bytes()?)?; send_message(&SocketMessage::AnimationDuration(arg.duration).as_bytes()?)?;
} }
SubCommand::AnimateEase(arg) => { SubCommand::AnimationEase(arg) => {
send_message(&SocketMessage::AnimationEase(arg.ease_func).as_bytes()?)?; send_message(&SocketMessage::AnimationEase(arg.ease_func).as_bytes()?)?;
} }
SubCommand::ResizeDelta(arg) => { SubCommand::ResizeDelta(arg) => {