[glide] Now we add a box with flow layout



commit c630a00f421f24cf0e6e3aba2580241af4e7ab9b
Author: Robert Carr <racarr Valentine localdomain>
Date:   Sat Jun 5 16:58:12 2010 -0400

    Now we add a box with flow layout

 libglide/glide-theme-chooser-priv.h |    3 ++
 libglide/glide-theme-chooser.c      |   38 +++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/libglide/glide-theme-chooser-priv.h b/libglide/glide-theme-chooser-priv.h
index 7c69776..3b2623e 100644
--- a/libglide/glide-theme-chooser-priv.h
+++ b/libglide/glide-theme-chooser-priv.h
@@ -30,6 +30,9 @@ struct _GlideThemeChooserPrivate
   
   GtkWidget *embed;
   ClutterActor *stage;
+  
+  ClutterActor *theme_box;
+  ClutterLayoutManager *layout;
 
   GlideTheme *theme;
 };
diff --git a/libglide/glide-theme-chooser.c b/libglide/glide-theme-chooser.c
index 889cb0d..15e62a2 100644
--- a/libglide/glide-theme-chooser.c
+++ b/libglide/glide-theme-chooser.c
@@ -92,6 +92,44 @@ glide_theme_chooser_set_property (GObject *object,
     }
 }
 
+static ClutterLayoutManager *
+glide_theme_chooser_make_layout (GlideThemeChooser *chooser)
+{
+  // TODO: What is the deal with references on these?
+  ClutterLayoutManager *layout = clutter_flow_layout_new (CLUTTER_FLOW_HORIZONTAL);
+  
+  clutter_flow_layout_set_homogenous (CLUTTER_FLOW_LAYOUT (layout),
+				      TRUE);
+  clutter_flow_layout_set_column_spacing (CLUTTER_FLOW_LAYOUT (layout), 10);
+  clutter_flow_layout_set_row_spacing (CLUTTER_FLOW_LAYOUT (layout),
+				       10);
+  
+  chooser->priv->layout = layout;
+  
+  return layout;
+}
+
+static ClutterActor *
+glide_theme_chooser_make_theme_box (GlideThemeChooser *chooser)
+{
+  ClutterActor *box;
+  ClutterLayoutManager *layout = glide_theme_chooser_make_layout (chooser);
+  
+  box = clutter_box_new (layout);
+  
+  chooser->priv->theme_box = box;
+  
+  return box;  
+}
+
+static void
+glide_theme_chooser_populate_stage (GlideThemeChooser *chooser)
+{
+  ClutterActor *box = glide_theme_chooser_make_theme_box (chooser);
+  
+  clutter_container_add_actor (CLUTTER_CONTAINER (chooser->priv->stage), box);
+}
+
 static void
 glide_theme_chooser_setup_stage (GlideThemeChooser *chooser)
 {



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