[glide] Turn on text below icons in menu



commit b3cb8b3b90ae9f128b42e241a323ebdad1bae134
Author: Robert Carr <racarr Valentine localdomain>
Date:   Thu May 6 05:48:44 2010 -0400

    Turn on text below icons in menu

 data/ui/glide-window.ui        |    1 +
 libglide/glide-stage-manager.c |   22 ++++++++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/data/ui/glide-window.ui b/data/ui/glide-window.ui
index 7b7a1df..5644711 100644
--- a/data/ui/glide-window.ui
+++ b/data/ui/glide-window.ui
@@ -239,6 +239,7 @@
         <child>
           <object class="GtkToolbar" id="main-toolbar">
             <property name="visible">True</property>
+            <property name="toolbar_style">both</property>
             <child>
               <object class="GtkToolButton" id="new-toolbutton">
                 <property name="visible">True</property>
diff --git a/libglide/glide-stage-manager.c b/libglide/glide-stage-manager.c
index 2b4d8c8..a71927f 100644
--- a/libglide/glide-stage-manager.c
+++ b/libglide/glide-stage-manager.c
@@ -789,19 +789,37 @@ glide_stage_manager_get_manipulator (GlideStageManager *m)
   return m->priv->manip;
 }
 
+static void
+glide_stage_manager_get_center_pos (ClutterActor *actor, 
+				    gfloat *x,
+				    gfloat *y)
+{
+  ClutterActor *parent = clutter_actor_get_stage (actor);
+  gfloat p_width, p_height, width, height;
+  
+  clutter_actor_get_size (parent, &p_width, &p_height);
+  clutter_actor_get_size (actor, &width, &height);
+  
+  *x = floor(p_width/2.0 - width/2.0);
+  *y = floor(p_height/2.0 - height/2.0);
+}
+
 void 
 glide_stage_manager_add_actor (GlideStageManager *manager,
 			       GlideActor *actor)
 {
   GlideSlide *current_slide;
+  gfloat x, y;
   glide_actor_set_stage_manager (actor, manager);
   
   current_slide = glide_document_get_nth_slide (manager->priv->document,
 						manager->priv->current_slide);
-  
-  clutter_actor_set_position (CLUTTER_ACTOR (actor), 200, 200);
+
   glide_slide_add_actor_content (current_slide, CLUTTER_ACTOR (actor));
   
+  glide_stage_manager_get_center_pos (CLUTTER_ACTOR (actor), &x, &y);
+  clutter_actor_set_position (CLUTTER_ACTOR (actor), x, y);
+  
   clutter_actor_show (CLUTTER_ACTOR (actor));
   
   glide_stage_manager_set_selection (manager, actor);



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