[glide] Add an effect to fading in



commit 3d996b414d7a64132dfef268295c5631d4640126
Author: Robert Carr <racarr Valentine localdomain>
Date:   Thu May 6 06:03:41 2010 -0400

    Add an effect to fading in

 data/ui/glide-window.ui        |   92 ++++++++++-----------------------------
 libglide/glide-stage-manager.c |    9 ++++
 2 files changed, 33 insertions(+), 68 deletions(-)
---
diff --git a/data/ui/glide-window.ui b/data/ui/glide-window.ui
index 5644711..46d0b24 100644
--- a/data/ui/glide-window.ui
+++ b/data/ui/glide-window.ui
@@ -22,8 +22,8 @@
                     <child>
                       <object class="GtkImageMenuItem" id="new-menuitem">
                         <property name="visible">True</property>
-                        <property name="use_action_appearance">True</property>
                         <property name="related_action">new-action</property>
+                        <property name="use_action_appearance">True</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                         <accelerator key="n" signal="activate" modifiers="GDK_CONTROL_MASK"/>
@@ -62,8 +62,8 @@
                             <child>
                               <object class="GtkImageMenuItem" id="export-pdf-menuitem">
                                 <property name="visible">True</property>
-                                <property name="use_action_appearance">True</property>
                                 <property name="related_action">pdf-export-action</property>
+                                <property name="use_action_appearance">True</property>
                                 <property name="use_underline">True</property>
                                 <property name="use_stock">True</property>
                               </object>
@@ -71,8 +71,8 @@
                             <child>
                               <object class="GtkImageMenuItem" id="export-image-menuitem">
                                 <property name="visible">True</property>
-                                <property name="use_action_appearance">True</property>
                                 <property name="related_action">png-export-action</property>
+                                <property name="use_action_appearance">True</property>
                                 <property name="use_underline">True</property>
                                 <property name="use_stock">True</property>
                               </object>
@@ -136,8 +136,8 @@
                     <child>
                       <object class="GtkImageMenuItem" id="undo-menuitem">
                         <property name="visible">True</property>
-                        <property name="use_action_appearance">True</property>
                         <property name="related_action">undo-action</property>
+                        <property name="use_action_appearance">True</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                         <accelerator key="z" signal="activate" modifiers="GDK_CONTROL_MASK"/>
@@ -146,8 +146,8 @@
                     <child>
                       <object class="GtkImageMenuItem" id="redo-menuitem">
                         <property name="visible">True</property>
-                        <property name="use_action_appearance">True</property>
                         <property name="related_action">redo-action</property>
+                        <property name="use_action_appearance">True</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                         <accelerator key="z" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
@@ -171,8 +171,8 @@
                     <child>
                       <object class="GtkImageMenuItem" id="copy-menuitem">
                         <property name="visible">True</property>
-                        <property name="use_action_appearance">True</property>
                         <property name="related_action">copy-action</property>
+                        <property name="use_action_appearance">True</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                         <accelerator key="c" signal="activate" modifiers="GDK_CONTROL_MASK"/>
@@ -240,78 +240,61 @@
           <object class="GtkToolbar" id="main-toolbar">
             <property name="visible">True</property>
             <property name="toolbar_style">both</property>
+            <property name="icon_size">2</property>
             <child>
-              <object class="GtkToolButton" id="new-toolbutton">
-                <property name="visible">True</property>
-                <property name="use_action_appearance">True</property>
-                <property name="related_action">new-action</property>
-                <property name="label" translatable="yes">New File</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkToolButton" id="open-toolbutton">
+              <object class="GtkToolButton" id="present-toolbutton">
                 <property name="visible">True</property>
+                <property name="related_action">present-action</property>
                 <property name="use_action_appearance">True</property>
-                <property name="related_action">open-action</property>
-                <property name="label" translatable="yes">Open File</property>
+                <property name="label" translatable="yes">Present</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
-              <object class="GtkToolButton" id="save-toolbutton">
+              <object class="GtkToolButton" id="insert-slide-toolbutton">
                 <property name="visible">True</property>
+                <property name="related_action">add-slide-action</property>
                 <property name="use_action_appearance">True</property>
-                <property name="related_action">save-action</property>
-                <property name="label" translatable="yes">Save File</property>
+                <property name="label" translatable="yes">Insert slide</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
-              <object class="GtkSeparatorToolItem" id="separator4">
+              <object class="GtkSeparatorToolItem" id="toolbutton1">
                 <property name="visible">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
               <object class="GtkToolButton" id="undo-toolbutton">
                 <property name="visible">True</property>
-                <property name="use_action_appearance">True</property>
                 <property name="related_action">undo-action</property>
+                <property name="use_action_appearance">True</property>
                 <property name="label" translatable="yes">Undo</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
               <object class="GtkToolButton" id="Redo">
                 <property name="visible">True</property>
-                <property name="use_action_appearance">True</property>
                 <property name="related_action">redo-action</property>
+                <property name="use_action_appearance">True</property>
                 <property name="label" translatable="yes">Redo</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
@@ -320,35 +303,32 @@
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
               <object class="GtkToolButton" id="text-toolbutton">
                 <property name="visible">True</property>
                 <property name="sensitive">False</property>
-                <property name="use_action_appearance">True</property>
                 <property name="related_action">new-text-action</property>
+                <property name="use_action_appearance">True</property>
                 <property name="label" translatable="yes">Text</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
               <object class="GtkToolButton" id="image-toolbutton">
                 <property name="visible">True</property>
                 <property name="sensitive">False</property>
-                <property name="use_action_appearance">True</property>
                 <property name="related_action">new-image-action</property>
+                <property name="use_action_appearance">True</property>
                 <property name="label" translatable="yes">Image</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
@@ -357,42 +337,18 @@
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
               <object class="GtkToolButton" id="inspector-button">
                 <property name="visible">True</property>
-                <property name="use_action_appearance">True</property>
                 <property name="related_action">inspector-action</property>
-                <property name="label" translatable="yes">Inspector</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkSeparatorToolItem" id="separatorafteri">
-                <property name="visible">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="homogeneous">True</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkToolButton" id="present-toolbutton">
-                <property name="visible">True</property>
                 <property name="use_action_appearance">True</property>
-                <property name="related_action">present-action</property>
-                <property name="label" translatable="yes">Present</property>
+                <property name="label" translatable="yes">Inspector</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
-                <property name="homogeneous">True</property>
               </packing>
             </child>
           </object>
@@ -620,7 +576,7 @@
   </object>
   <object class="GtkAction" id="add-slide-action">
     <property name="label">Add Slide</property>
-    <property name="short_label">Add Slide to Document</property>
+    <property name="short_label">New</property>
     <property name="tooltip">Insert a new Slide in the current document.</property>
     <property name="stock_id">gtk-add</property>
     <property name="sensitive">False</property>
@@ -644,7 +600,7 @@
   </object>
   <object class="GtkAction" id="new-text-action">
     <property name="label">Insert Text</property>
-    <property name="short_label">Insert Text</property>
+    <property name="short_label">Text Box</property>
     <property name="tooltip">Insert a new text object in to the document.</property>
     <property name="icon_name">format-text-italic</property>
     <property name="sensitive">False</property>
@@ -652,7 +608,7 @@
   </object>
   <object class="GtkAction" id="new-image-action">
     <property name="label">New Image</property>
-    <property name="short_label">New Image</property>
+    <property name="short_label">Image</property>
     <property name="tooltip">Insert a new image object in to the document.</property>
     <property name="icon_name">image-x-generic</property>
     <property name="sensitive">False</property>
@@ -660,7 +616,7 @@
   </object>
   <object class="GtkAction" id="present-action">
     <property name="label">Start Presentation</property>
-    <property name="short_label">Present</property>
+    <property name="short_label">Play</property>
     <property name="tooltip">Starts the current presentation</property>
     <property name="stock_id">gtk-media-play</property>
     <property name="sensitive">False</property>
@@ -740,7 +696,7 @@
   </object>
   <object class="GtkAction" id="inspector-action">
     <property name="label">Inspector</property>
-    <property name="short_label">Show Inspector</property>
+    <property name="short_label">Inspector</property>
     <property name="tooltip">Show the inspector pane</property>
     <property name="stock_id">gtk-info</property>
     <property name="sensitive">False</property>
diff --git a/libglide/glide-stage-manager.c b/libglide/glide-stage-manager.c
index a71927f..658d125 100644
--- a/libglide/glide-stage-manager.c
+++ b/libglide/glide-stage-manager.c
@@ -53,6 +53,13 @@ enum {
 static guint stage_manager_signals[LAST_SIGNAL] = { 0, };
 
 static void
+glide_stage_manager_effect_fade_in (ClutterActor *actor) 
+{
+  clutter_actor_set_opacity (actor, 0x00);
+  clutter_actor_animate (actor, CLUTTER_LINEAR, 300, "opacity", 0xff, NULL);
+}
+
+static void
 glide_stage_manager_finalize (GObject *object)
 {
   GlideStageManager *manager = GLIDE_STAGE_MANAGER (object);
@@ -822,6 +829,8 @@ glide_stage_manager_add_actor (GlideStageManager *manager,
   
   clutter_actor_show (CLUTTER_ACTOR (actor));
   
+  glide_stage_manager_effect_fade_in (CLUTTER_ACTOR (actor));
+  
   glide_stage_manager_set_selection (manager, actor);
 }
 



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