[glide] Theme preview actor renders actual theme previews now



commit e2f864d97164f4c83dd1b3628bd835637d147323
Author: Robert Carr <racarr Valentine localdomain>
Date:   Sat Jun 5 17:54:05 2010 -0400

    Theme preview actor renders actual theme previews now

 libglide/glide-theme-preview-actor.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/libglide/glide-theme-preview-actor.c b/libglide/glide-theme-preview-actor.c
index 0157976..ac2806b 100644
--- a/libglide/glide-theme-preview-actor.c
+++ b/libglide/glide-theme-preview-actor.c
@@ -39,6 +39,18 @@ enum {
 };
 
 static void
+glide_theme_preview_actor_update_texture (GlideThemePreviewActor *preview)
+{
+  guint width, height;
+  cairo_t *cr;
+  
+  clutter_cairo_texture_get_surface_size (CLUTTER_CAIRO_TEXTURE (preview->priv->preview_texture), &width, &height);
+  cr = clutter_cairo_texture_create (CLUTTER_CAIRO_TEXTURE (preview->priv->preview_texture));
+  glide_theme_preview (preview->priv->theme, cr, width, height);
+  cairo_destroy (cr);
+}
+
+static void
 glide_theme_preview_actor_finalize (GObject *object)
 {
 }
@@ -82,18 +94,12 @@ glide_theme_preview_actor_set_property (GObject *object,
 static void
 glide_theme_preview_actor_init (GlideThemePreviewActor *preview)
 {
-  cairo_t *cr;
   preview->priv = GLIDE_THEME_PREVIEW_ACTOR_GET_PRIVATE (preview);
   
   preview->priv->preview_texture = clutter_cairo_texture_new (100, 100);
   
   clutter_container_add_actor (CLUTTER_CONTAINER (preview), preview->priv->preview_texture);
   clutter_actor_set_position (preview->priv->preview_texture, 0, 0);
-  
-  cr = clutter_cairo_texture_create (CLUTTER_CAIRO_TEXTURE (preview->priv->preview_texture));
-  cairo_set_source_rgba (cr, 1, 1, 1, 1);
-  cairo_paint (cr);
-  cairo_destroy (cr);
 }
 
 static void
@@ -130,6 +136,8 @@ glide_theme_preview_actor_set_theme (GlideThemePreviewActor *preview,
 {
   preview->priv->theme = theme;
   g_object_notify (G_OBJECT (preview), "theme");
+  
+  glide_theme_preview_actor_update_texture (preview);
 }
 
 GlideTheme *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]