opt code struct

This commit is contained in:
DreamMaoMao 2025-06-29 14:11:05 +08:00
parent 58e0227a1f
commit 9319ff5478
3 changed files with 32 additions and 15 deletions

View file

@ -130,6 +130,7 @@ typedef struct {
typedef struct {
int animations;
int layer_animations;
char animation_type_open[10];
char animation_type_close[10];
int animation_fade_in;
@ -832,6 +833,8 @@ void parse_config_line(Config *config, const char *line) {
if (strcmp(key, "animations") == 0) {
config->animations = atoi(value);
} else if (strcmp(key, "layer_animations") == 0) {
config->layer_animations = atoi(value);
} else if (strcmp(key, "animation_type_open") == 0) {
snprintf(config->animation_type_open,
sizeof(config->animation_type_open), "%.9s",
@ -2057,6 +2060,7 @@ void free_config(void) {
void override_config(void) {
// 动画启用
animations = CLAMP_INT(config.animations, 0, 1);
layer_animations = CLAMP_INT(config.layer_animations, 0, 1);
// 标签动画方向
tag_animation_direction = CLAMP_INT(config.tag_animation_direction, 0, 1);
@ -2199,6 +2203,7 @@ void override_config(void) {
void set_value_default() {
/* animaion */
config.animations = animations; // 是否启用动画
config.layer_animations = layer_animations; // 是否启用layer动画
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; // 标签动画方向