opt: support custom fadein fadeout bigin opacity

This commit is contained in:
DreamMaoMao 2025-02-06 13:19:51 +08:00
parent f7ccaca144
commit fb1a3e4dbc
2 changed files with 7 additions and 5 deletions

View file

@ -8,8 +8,10 @@
/* animation */
static const bool animations = true; // Enable animations
static const char *animation_type = "slide"; //slide or zoom
static const char animation_fade_in = 1; // Enable animation fade in
static const char animation_fade_in = 0; // Enable animation fade in
static const float zoom_initial_ratio = 0.5; // Initial window ratio for animations
static const float fadeout_begin_opacity = 1; // Begin opacity for animations fadeout
static const float fadein_begin_opacity = 0; // Begin opacity for animations fasdein
static const uint32_t animation_duration_move = 300; // Animation move speed
static const uint32_t animation_duration_open = 300; // Animation open speed
static const uint32_t animation_duration_close = 200; // Animation close speed

8
main.c
View file

@ -690,11 +690,11 @@ client_animation_next_tick(Client *c)
if(!c->iskilling && (c->is_open_animation||c->animation.begin_fade_in) && animation_fade_in) {
c->animation.begin_fade_in = true;
client_set_opacity(c,animation_passed);
client_set_opacity(c,MIN(animation_passed + fadein_begin_opacity,1.0));
}
if(c->iskilling) {
client_set_opacity(c,1 - animation_passed );
client_set_opacity(c,MAX(fadeout_begin_opacity - animation_passed ,0.1) );
}
c->is_open_animation = false;
@ -2901,7 +2901,7 @@ void pending_kill_client(Client *c) {
c->iskilling = 1;
c->animainit_geom = c->geom;
c->pending = c->geom;
c->pending.y = c->geom.y + c->mon->m.height;
c->pending.y = c->geom.y + c->mon->m.height -(c->geom.y -c->mon->m.y);
if (c == grabc) {
cursor_mode = CurNormal;
@ -3831,7 +3831,7 @@ resize(Client *c, struct wlr_box geo, int interact)
}
if(c->isnoborder) {
if(c->isnoborder || c->iskilling) {
c->bw = 0;
}