[two-step] Pull background color from theme

The OLPC theme looks best when it's white, so we need to be able to
specify the background color from the theme.  If the theme doesn't
specify a background color, we fall back to the old behavior of using
the distro default.
This commit is contained in:
Ray Strode 2009-05-01 23:08:09 -04:00
parent c9e00b603e
commit d35ec8bd03

View file

@ -93,6 +93,9 @@ struct _ply_boot_splash_plugin
double animation_vertical_alignment;
char *animation_dir;
uint32_t background_start_color;
uint32_t background_end_color;
ply_trigger_t *idle_trigger;
uint32_t root_is_mounted : 1;
@ -110,6 +113,7 @@ create_plugin (ply_key_file_t *key_file)
ply_boot_splash_plugin_t *plugin;
char *image_dir, *image_path;
char *alignment;
char *color;
srand ((int) ply_get_timestamp ());
plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
@ -142,6 +146,24 @@ create_plugin (ply_key_file_t *key_file)
plugin->animation_vertical_alignment = .5;
free (alignment);
color = ply_key_file_get_value (key_file, "two-step", "BackgroundStartColor");
if (color != NULL)
plugin->background_start_color = strtol (color, NULL, 0);
else
plugin->background_start_color = PLYMOUTH_BACKGROUND_START_COLOR;
free (color);
color = ply_key_file_get_value (key_file, "two-step", "BackgroundEndColor");
if (color != NULL)
plugin->background_end_color = strtol (color, NULL, 0);
else
plugin->background_end_color = PLYMOUTH_BACKGROUND_END_COLOR;
free (color);
return plugin;
}
@ -349,9 +371,13 @@ on_erase (ply_boot_splash_plugin_t *plugin,
area.width = width;
area.height = height;
ply_frame_buffer_fill_with_gradient (plugin->frame_buffer, &area,
PLYMOUTH_BACKGROUND_START_COLOR,
PLYMOUTH_BACKGROUND_END_COLOR);
if (plugin->background_start_color != plugin->background_end_color)
ply_frame_buffer_fill_with_gradient (plugin->frame_buffer, &area,
plugin->background_start_color,
plugin->background_end_color);
else
ply_frame_buffer_fill_with_hex_color (plugin->frame_buffer, &area,
plugin->background_start_color);
}
static void