fade-out skeleton

This commit is contained in:
William McKinnon 2023-07-05 22:59:12 -04:00
parent 5bfa2e030e
commit 6084ea42ec

View file

@ -522,15 +522,24 @@ static bool scan_out_fullscreen_view(struct sway_output *output,
} }
static void containers_tick_alpha(list_t *containers, struct sway_output *output) { static void containers_tick_alpha(list_t *containers, struct sway_output *output) {
if (config->animation_duration == 0) {
return;
}
float alpha_step; float alpha_step;
for (int i = 0; i < containers->length; ++i) { for (int i = 0; i < containers->length; ++i) {
struct sway_container *con = containers->items[i]; struct sway_container *con = containers->items[i];
if (con->pending.children) { if (con->pending.children) {
containers_tick_alpha(con->pending.children, output); containers_tick_alpha(con->pending.children, output);
} else if (con->alpha < con->target_alpha) { } else { // should this else be removed?
if (con->alpha == con->target_alpha) {
continue;
} else if (con->alpha < con->target_alpha) { // fade-in animation
alpha_step = (con->target_alpha * output->refresh_sec) / config->animation_duration; alpha_step = (con->target_alpha * output->refresh_sec) / config->animation_duration;
// ensure that the alpha does not exceed the target_alpha
con->alpha = MIN(con->alpha + alpha_step, con->target_alpha); con->alpha = MIN(con->alpha + alpha_step, con->target_alpha);
} else if (con->alpha > con->target_alpha) { // fade-out animation
// TODO
}
output_damage_whole_container(output, con); output_damage_whole_container(output, con);
} }
} }