diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2015-02-26 17:14:57 -0800 |
---|---|---|
committer | João Paulo Rechi Vita <jprvita@endlessos.org> | 2021-11-15 19:25:59 -0500 |
commit | 4d3f553efcc3cae1399d1c5715259174e9147ab1 (patch) | |
tree | 306f6e98d9a4fec080482b50f6fe5c4c9095ceb9 | |
parent | 18363cd887dbfe7e82a2f4cc1a49ef9513919142 (diff) |
two-step: Make SHOW_ANIMATION_FRACTION configurable
Allow themes to configure at which percentage of the boot progress the
animation should transition to the end animation.
At Endless we use this to only show the end animation from the start of
the boot splash by setting it to 0.0.
-rw-r--r-- | src/plugins/splash/two-step/plugin.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index 9c8bc439..8aab3b99 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -174,6 +174,7 @@ struct _ply_boot_splash_plugin uint32_t progress_bar_bg_color; uint32_t progress_bar_fg_color; + double show_animation_fraction; progress_function_t progress_function; ply_trigger_t *idle_trigger; @@ -1048,6 +1049,7 @@ create_plugin (ply_key_file_t *key_file) char *image_dir, *image_path; char *transition; char *progress_function; + char *show_animation_fraction; srand ((int) ply_get_timestamp ()); plugin = calloc (1, sizeof(ply_boot_splash_plugin_t)); @@ -1209,6 +1211,13 @@ create_plugin (ply_key_file_t *key_file) free (progress_function); } + show_animation_fraction = ply_key_file_get_value (key_file, "two-step", "ShowAnimationPercent"); + if (show_animation_fraction != NULL) + plugin->show_animation_fraction = strtod (show_animation_fraction, NULL); + else + plugin->show_animation_fraction = SHOW_ANIMATION_FRACTION; + free (show_animation_fraction); + plugin->views = ply_list_new (); return plugin; @@ -1795,7 +1804,7 @@ on_boot_progress (ply_boot_splash_plugin_t *plugin, * become_idle gets called. */ if (plugin->mode_settings[plugin->mode].use_end_animation && - fraction_done >= SHOW_ANIMATION_FRACTION) { + fraction_done >= plugin->show_animation_fraction) { if (plugin->stop_trigger == NULL) { ply_trace ("boot progressed to end"); @@ -1809,7 +1818,7 @@ on_boot_progress (ply_boot_splash_plugin_t *plugin, } else { double total_duration; - fraction_done *= (1 / SHOW_ANIMATION_FRACTION); + fraction_done *= (1 / plugin->show_animation_fraction); switch (plugin->progress_function) { /* Fun made-up smoothing function to make the growth asymptotic: |