mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
feat: add global option animation_fade_out
This commit is contained in:
parent
0a9181ecb0
commit
2f61e14eeb
4 changed files with 10 additions and 3 deletions
|
|
@ -6,6 +6,7 @@ animations=1
|
|||
animation_type_open=slide
|
||||
animation_type_close=slide
|
||||
animation_fade_in=1
|
||||
animation_fade_out=1
|
||||
tag_animation_direction=1
|
||||
zoom_initial_ratio=0.5
|
||||
fadein_begin_opacity=0.5
|
||||
|
|
|
|||
|
|
@ -105,7 +105,8 @@ typedef struct {
|
|||
int animations;
|
||||
char animation_type_open[10];
|
||||
char animation_type_close[10];
|
||||
char animation_fade_in;
|
||||
int animation_fade_in;
|
||||
int animation_fade_out;
|
||||
int tag_animation_direction;
|
||||
float zoom_initial_ratio;
|
||||
float fadein_begin_opacity;
|
||||
|
|
@ -726,6 +727,8 @@ void parse_config_line(Config *config, const char *line) {
|
|||
"%.9s", value); // string limit to 9 char
|
||||
} else if (strcmp(key, "animation_fade_in") == 0) {
|
||||
config->animation_fade_in = atoi(value);
|
||||
} else if (strcmp(key, "animation_fade_out") == 0) {
|
||||
config->animation_fade_out = atoi(value);
|
||||
} else if (strcmp(key, "tag_animation_direction") == 0) {
|
||||
config->tag_animation_direction = atoi(value);
|
||||
} else if (strcmp(key, "zoom_initial_ratio") == 0) {
|
||||
|
|
@ -1787,6 +1790,7 @@ void override_config(void) {
|
|||
animation_type_open = config.animation_type_open;
|
||||
animation_type_close = config.animation_type_close;
|
||||
animation_fade_in = config.animation_fade_in;
|
||||
animation_fade_out = config.animation_fade_out;
|
||||
tag_animation_direction = config.tag_animation_direction;
|
||||
zoom_initial_ratio = config.zoom_initial_ratio;
|
||||
fadein_begin_opacity = config.fadein_begin_opacity;
|
||||
|
|
@ -1874,6 +1878,7 @@ void set_value_default() {
|
|||
/* animaion */
|
||||
config.animations = animations; // 是否启用动画
|
||||
config.animation_fade_in = animation_fade_in; // Enable animation fade in
|
||||
config.animation_fade_out = animation_fade_out; // Enable animation fade out
|
||||
config.tag_animation_direction = tag_animation_direction; // 标签动画方向
|
||||
config.zoom_initial_ratio = zoom_initial_ratio; // 动画起始窗口比例
|
||||
config.fadein_begin_opacity =
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ char *animation_type_open = "slide"; // 是否启用动画 //slide,zoom
|
|||
char *animation_type_close = "slide"; // 是否启用动画 //slide,zoom
|
||||
int animations = 1; // 是否启用动画
|
||||
int tag_animation_direction = HORIZONTAL; // 标签动画方向
|
||||
char animation_fade_in = 1; // Enable animation fade in
|
||||
int animation_fade_in = 1; // Enable animation fade in
|
||||
int animation_fade_out = 1; // Enable animation fade out
|
||||
float zoom_initial_ratio = 0.5; // 动画起始窗口比例
|
||||
float fadein_begin_opacity = 0.5; // Begin opac window ratio for animations
|
||||
float fadeout_begin_opacity = 0.5; // Begin opac window ratio for animations
|
||||
|
|
|
|||
|
|
@ -959,7 +959,7 @@ void fadeout_client_animation_next_tick(Client *c) {
|
|||
|
||||
double opacity = MAX(fadeout_begin_opacity - animation_passed, 0);
|
||||
|
||||
if(!c->nofadeout)
|
||||
if(animation_fade_out && !c->nofadeout)
|
||||
wlr_scene_node_for_each_buffer(&c->scene->node, scene_buffer_apply_opacity,
|
||||
&opacity);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue