mirror of
				https://github.com/DreamMaoMao/maomaowm.git
				synced 2025-11-03 09:01:47 -05:00 
			
		
		
		
	feat: support set begin opacity of fadeout
This commit is contained in:
		
							parent
							
								
									9df9ada7d9
								
							
						
					
					
						commit
						fda94aefa7
					
				
					 4 changed files with 10 additions and 3 deletions
				
			
		| 
						 | 
					@ -4,6 +4,7 @@ animation_type=slide
 | 
				
			||||||
animation_fade_in=1
 | 
					animation_fade_in=1
 | 
				
			||||||
zoom_initial_ratio=0.5
 | 
					zoom_initial_ratio=0.5
 | 
				
			||||||
fadein_begin_opacity=0.5
 | 
					fadein_begin_opacity=0.5
 | 
				
			||||||
 | 
					fadeout_begin_opacity=0.5
 | 
				
			||||||
animation_duration_move=500
 | 
					animation_duration_move=500
 | 
				
			||||||
animation_duration_open=400
 | 
					animation_duration_open=400
 | 
				
			||||||
animation_duration_tag=350
 | 
					animation_duration_tag=350
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								maomao.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								maomao.c
									
										
									
									
									
								
							| 
						 | 
					@ -747,7 +747,7 @@ void fadeout_client_animation_next_tick(Client *c) {
 | 
				
			||||||
      .height = height,
 | 
					      .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,
 | 
					  wlr_scene_node_for_each_buffer(&c->snapshot_scene->node,
 | 
				
			||||||
    scene_buffer_apply_opacity, &opacity);
 | 
					    scene_buffer_apply_opacity, &opacity);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -63,6 +63,7 @@ typedef struct {
 | 
				
			||||||
  char animation_fade_in;
 | 
					  char animation_fade_in;
 | 
				
			||||||
  float zoom_initial_ratio;
 | 
					  float zoom_initial_ratio;
 | 
				
			||||||
  float fadein_begin_opacity;
 | 
					  float fadein_begin_opacity;
 | 
				
			||||||
 | 
					  float fadeout_begin_opacity;
 | 
				
			||||||
  uint32_t animation_duration_move;
 | 
					  uint32_t animation_duration_move;
 | 
				
			||||||
  uint32_t animation_duration_open;
 | 
					  uint32_t animation_duration_open;
 | 
				
			||||||
  uint32_t animation_duration_tag;
 | 
					  uint32_t animation_duration_tag;
 | 
				
			||||||
| 
						 | 
					@ -447,6 +448,8 @@ void parse_config_line(Config *config, const char *line) {
 | 
				
			||||||
    config->zoom_initial_ratio = atof(value);
 | 
					    config->zoom_initial_ratio = atof(value);
 | 
				
			||||||
  } else if (strcmp(key, "fadein_begin_opacity") == 0) {
 | 
					  } else if (strcmp(key, "fadein_begin_opacity") == 0) {
 | 
				
			||||||
    config->fadein_begin_opacity = atof(value);
 | 
					    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) {
 | 
					  } else if (strcmp(key, "animation_duration_move") == 0) {
 | 
				
			||||||
    config->animation_duration_move = atoi(value);
 | 
					    config->animation_duration_move = atoi(value);
 | 
				
			||||||
  } else if (strcmp(key, "animation_duration_open") == 0) {
 | 
					  } else if (strcmp(key, "animation_duration_open") == 0) {
 | 
				
			||||||
| 
						 | 
					@ -876,6 +879,7 @@ void override_config(void) {
 | 
				
			||||||
  animation_fade_in = config.animation_fade_in;
 | 
					  animation_fade_in = config.animation_fade_in;
 | 
				
			||||||
  zoom_initial_ratio = config.zoom_initial_ratio;
 | 
					  zoom_initial_ratio = config.zoom_initial_ratio;
 | 
				
			||||||
  fadein_begin_opacity = config.fadein_begin_opacity;
 | 
					  fadein_begin_opacity = config.fadein_begin_opacity;
 | 
				
			||||||
 | 
					  fadeout_begin_opacity = config.fadeout_begin_opacity;
 | 
				
			||||||
  animation_duration_move = config.animation_duration_move;
 | 
					  animation_duration_move = config.animation_duration_move;
 | 
				
			||||||
  animation_duration_open = config.animation_duration_open;
 | 
					  animation_duration_open = config.animation_duration_open;
 | 
				
			||||||
  animation_duration_tag = config.animation_duration_tag;
 | 
					  animation_duration_tag = config.animation_duration_tag;
 | 
				
			||||||
| 
						 | 
					@ -927,7 +931,8 @@ void set_value_default() {
 | 
				
			||||||
config.animations = 1;             // 是否启用动画
 | 
					config.animations = 1;             // 是否启用动画
 | 
				
			||||||
config.animation_fade_in = 1;     // Enable animation fade in
 | 
					config.animation_fade_in = 1;     // Enable animation fade in
 | 
				
			||||||
config.zoom_initial_ratio = 0.5; // 动画起始窗口比例
 | 
					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_move = 500;              // Animation move speed
 | 
				
			||||||
config.animation_duration_open = 400;              // Animation open speed
 | 
					config.animation_duration_open = 400;              // Animation open speed
 | 
				
			||||||
config.animation_duration_tag = 300;               // Animation tag speed
 | 
					config.animation_duration_tag = 300;               // Animation tag speed
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,7 +9,8 @@ char *animation_type = "slide"; // 是否启用动画 //slide,zoom
 | 
				
			||||||
int animations = 1;             // 是否启用动画
 | 
					int animations = 1;             // 是否启用动画
 | 
				
			||||||
char animation_fade_in = 1;     // Enable animation fade in
 | 
					char animation_fade_in = 1;     // Enable animation fade in
 | 
				
			||||||
float zoom_initial_ratio = 0.5; // 动画起始窗口比例
 | 
					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_move = 500;              // Animation move speed
 | 
				
			||||||
uint32_t animation_duration_open = 400;              // Animation open speed
 | 
					uint32_t animation_duration_open = 400;              // Animation open speed
 | 
				
			||||||
uint32_t animation_duration_tag = 300;               // Animation tag speed
 | 
					uint32_t animation_duration_tag = 300;               // Animation tag speed
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue