增加fadtout配置

This commit is contained in:
DreamMaoMao 2025-02-24 19:26:35 +08:00
parent 6af0449b75
commit e9fdd59ded
5 changed files with 13 additions and 18 deletions

View file

@ -3,10 +3,12 @@ animations=1
animation_type=slide
animation_fade_in=1
zoom_initial_ratio=0.5
fadein_begin_opacity=0
fadein_begin_opacity=0.5
fadeout_begin_opacity=0.5
animation_duration_move=500
animation_duration_open=400
animation_duration_tag=350
animation_duration_close=350
animation_curve=0.46,1.0,0.29,0.99
# Scroller Layout Setting
@ -211,20 +213,6 @@ bind=ALT+SHIFT,X,incgaps,1
bind=ALT+SHIFT,Z,incgaps,-1
bind=ALT+SHIFT,R,togglegaps
# switch tty
bind=Ctrl+Alt,F1,chvt,1
bind=Ctrl+Alt,F2,chvt,2
bind=Ctrl+Alt,F3,chvt,3
bind=Ctrl+Alt,f4,chvt,4
bind=Ctrl+Alt,F5,chvt,5
bind=Ctrl+Alt,F6,chvt,6
bind=Ctrl+Alt,F7,chvt,7
bind=Ctrl+Alt,F8,chvt,8
bind=Ctrl+Alt,F9,chvt,9
bind=Ctrl+Alt,F10,chvt,10
bind=Ctrl+Alt,F11,chvt,11
bind=Ctrl+Alt,F12,chvt,12
#custom app bind example
# bind=SUPER,Return,spawn,google-chrome
# bind=CTRL+ALT,Return,spawn,st -e ~/tool/ter-multiplexer.sh

View file

@ -11,6 +11,7 @@ static const char *animation_type = "slide"; //slide or zoom
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 fadein_begin_opacity = 0; // Begin opacity for animations fasdein
static const float fadeout_begin_opacity = 0; // Begin opacity for animations fasdein
static const uint32_t animation_duration_move = 500; // Animation move speed
static const uint32_t animation_duration_open = 400; // Animation open speed
static const uint32_t animation_duration_tag = 400; // Animation tag speed

View file

@ -747,7 +747,7 @@ void fadeout_client_animation_next_tick(Client *c) {
.height = height,
};
double opacity = MAX(1 - 0.4 - animation_passed, 0);
double opacity = MAX(fadeout_begin_opacity - animation_passed, 0);
wlr_scene_node_for_each_buffer(&c->snapshot_scene->node,
scene_buffer_apply_opacity, &opacity);

View file

@ -63,6 +63,7 @@ typedef struct {
char animation_fade_in;
float zoom_initial_ratio;
float fadein_begin_opacity;
float fadeout_begin_opacity;
uint32_t animation_duration_move;
uint32_t animation_duration_open;
uint32_t animation_duration_tag;
@ -447,6 +448,8 @@ void parse_config_line(Config *config, const char *line) {
config->zoom_initial_ratio = atof(value);
} else if (strcmp(key, "fadein_begin_opacity") == 0) {
config->fadein_begin_opacity = atof(value);
} else if (strcmp(key, "fadeout_begin_opacity") == 0) {
config->fadeout_begin_opacity = atof(value);
} else if (strcmp(key, "animation_duration_move") == 0) {
config->animation_duration_move = atoi(value);
} else if (strcmp(key, "animation_duration_open") == 0) {
@ -876,6 +879,7 @@ void override_config(void) {
animation_fade_in = config.animation_fade_in;
zoom_initial_ratio = config.zoom_initial_ratio;
fadein_begin_opacity = config.fadein_begin_opacity;
fadeout_begin_opacity = config.fadeout_begin_opacity;
animation_duration_move = config.animation_duration_move;
animation_duration_open = config.animation_duration_open;
animation_duration_tag = config.animation_duration_tag;
@ -927,7 +931,8 @@ void set_value_default() {
config.animations = 1; // 是否启用动画
config.animation_fade_in = 1; // Enable animation fade in
config.zoom_initial_ratio = 0.5; // 动画起始窗口比例
config.fadein_begin_opacity = 0; // Begin opac window ratio for animations
config.fadein_begin_opacity = 0.5; // Begin opac window ratio for animations
config.fadeout_begin_opacity = 0.5;
config.animation_duration_move = 500; // Animation move speed
config.animation_duration_open = 400; // Animation open speed
config.animation_duration_tag = 300; // Animation tag speed

View file

@ -9,7 +9,8 @@ char *animation_type = "slide"; // 是否启用动画 //slide,zoom
int animations = 1; // 是否启用动画
char animation_fade_in = 1; // Enable animation fade in
float zoom_initial_ratio = 0.5; // 动画起始窗口比例
float fadein_begin_opacity = 0; // Begin opac window ratio for animations
float fadein_begin_opacity = 0.5; // Begin opac window ratio for animations
float fadeout_begin_opacity = 0.5; // Begin opac window ratio for animations
uint32_t animation_duration_move = 500; // Animation move speed
uint32_t animation_duration_open = 400; // Animation open speed
uint32_t animation_duration_tag = 300; // Animation tag speed