summaryrefslogtreecommitdiff
authorLeho Kraav <leho@kraav.com>2011-08-18 15:06:17 (GMT)
committer Ray Strode <rstrode@redhat.com>2011-08-18 15:23:44 (GMT)
commit5439ef520d2bd9400555824ec28b435952260eba (patch) (side-by-side diff)
tree55346b38320a07c996f59bdac4f82a3997f019b6
parentb7701d690a0ea1fda036d48aeda8ba85fd41257b (diff)
downloadplymouth-5439ef520d2bd9400555824ec28b435952260eba.zip
plymouth-5439ef520d2bd9400555824ec28b435952260eba.tar.gz
throbgress: make colors configurable
This commit makes the background start and background end colors configurable in throbgress.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/plugins/splash/throbgress/plugin.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/plugins/splash/throbgress/plugin.c b/src/plugins/splash/throbgress/plugin.c
index 895541c..3737a9f 100644
--- a/src/plugins/splash/throbgress/plugin.c
+++ b/src/plugins/splash/throbgress/plugin.c
@@ -94,6 +94,9 @@ struct _ply_boot_splash_plugin
char *image_dir;
ply_boot_splash_display_type_t state;
+ uint32_t background_start_color;
+ uint32_t background_end_color;
+
ply_trigger_t *idle_trigger;
uint32_t root_is_mounted : 1;
@@ -373,6 +376,7 @@ create_plugin (ply_key_file_t *key_file)
{
ply_boot_splash_plugin_t *plugin;
char *image_dir, *image_path;
+ char *color;
srand ((int) ply_get_timestamp ());
plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
@@ -391,6 +395,24 @@ create_plugin (ply_key_file_t *key_file)
plugin->image_dir = image_dir;
plugin->views = ply_list_new ();
+ color = ply_key_file_get_value (key_file, "throbgress", "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, "throbgress", "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;
}
@@ -427,14 +449,20 @@ draw_background (view_t *view,
{
ply_rectangle_t area;
+ plugin = view->plugin;
+
area.x = x;
area.y = y;
area.width = width;
area.height = height;
- ply_pixel_buffer_fill_with_gradient (pixel_buffer, &area,
- PLYMOUTH_BACKGROUND_START_COLOR,
- PLYMOUTH_BACKGROUND_END_COLOR);
+ if (plugin->background_start_color != plugin->background_end_color)
+ ply_pixel_buffer_fill_with_gradient (pixel_buffer, &area,
+ plugin->background_start_color,
+ plugin->background_end_color);
+ else
+ ply_pixel_buffer_fill_with_hex_color (pixel_buffer, &area,
+ plugin->background_start_color);
}
static void