summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <halfline@gmail.com>2021-11-16 17:31:55 +0000
committerRay Strode <halfline@gmail.com>2021-11-16 17:31:55 +0000
commit5b91b9ed84cc91759c986634a4d64d474e6092cf (patch)
tree306f6e98d9a4fec080482b50f6fe5c4c9095ceb9
parent18363cd887dbfe7e82a2f4cc1a49ef9513919142 (diff)
parent4d3f553efcc3cae1399d1c5715259174e9147ab1 (diff)
Merge branch 'configurable-show-animation-fraction' into 'main'
two-step: Make SHOW_ANIMATION_FRACTION configurable See merge request plymouth/plymouth!151
-rw-r--r--src/plugins/splash/two-step/plugin.c13
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: