Fix Plymouth theme

This commit is contained in:
Andrey Cherepanov 2019-05-30 14:48:58 +03:00
parent defe2d54e8
commit 18684c2c0e

View File

@ -115,7 +115,7 @@ Plymouth.SetDisplayPasswordFunction(display_password_callback);
# Define bar size and position
bar_height = 36;
bar_x = Window.GetWidth() * 0.10; # 10% from left edge
bar_y = Window.GetHeight() * 0.85; # from bar bottom to bottom screen edge: 10%
bar_y = Window.GetHeight() / 2; # top progressbar edge should be at middle of screen
bar_width = Window.GetWidth() * 0.80; # 80% of screen width
# Progress background spite
@ -127,17 +127,22 @@ progress_bg.sprite.SetZ (5);
# Progress bar sprite
progress_bar.raw = Image ("progress_bar.png");
progress_bar.image = imgscale (progress_bar.raw, 1);
progress_bar.image = progress_bar.raw;
# Maximum number of sprites
steps = Math.Int (bar_width/18);
# Show first step
progress_bar.sprites[0] = Sprite ();
progress_bar.sprites[0].SetImage (progress_bar.image);
progress_bar.sprites[0].SetPosition (bar_x, bar_y);
progress_bar.sprites[0].SetZ (10);
fun progress_callback (duration, progress)
{
# Redraw progress_bar with appropriate width with step 20% with 5% ahead
step = Math.Int ((progress+0.05) / steps) + 1;
step = Math.Int ((progress+0.05) * steps) + 1;
if ( step > steps ) step = steps;
for( i=0; i<step; i++ )
for( i=0; i<step; i++ ) {
progress_bar.sprites[i] = Sprite ();
progress_bar.sprites[i].SetImage (progress_bar.image);
progress_bar.sprites[i].SetPosition (bar_x+i*18, bar_y);