summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeho Kraav <leho@kraav.com>2011-08-18 18:06:17 +0300
committerRay Strode <rstrode@redhat.com>2011-08-18 11:23:44 -0400
commit5439ef520d2bd9400555824ec28b435952260eba (patch)
tree55346b38320a07c996f59bdac4f82a3997f019b6
parentb7701d690a0ea1fda036d48aeda8ba85fd41257b (diff)
throbgress: make colors configurable
This commit makes the background start and background end colors configurable in throbgress.
-rw-r--r--src/plugins/splash/throbgress/plugin.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/plugins/splash/throbgress/plugin.c b/src/plugins/splash/throbgress/plugin.c
index 895541cb..3737a9fa 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;
+ if (plugin->background_start_color != plugin->background_end_color)
ply_pixel_buffer_fill_with_gradient (pixel_buffer, &area,
- PLYMOUTH_BACKGROUND_START_COLOR,
- PLYMOUTH_BACKGROUND_END_COLOR);
+ 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