changed window
authortanya <tanya@moshkanov.oblgaz>
Sat, 24 Apr 2010 22:26:58 +0000 (01:26 +0300)
committertanya <tanya@moshkanov.oblgaz>
Sat, 24 Apr 2010 22:26:58 +0000 (01:26 +0300)
applet/src/livewp-home-widget.c

index 86bc49d..d4ff7fd 100644 (file)
@@ -530,30 +530,33 @@ change_wind(Actor *actor, AWallpaperPlugin *desktop_plugin)
 void 
 change_window1(Actor * actor, AWallpaperPlugin *desktop_plugin)
 {
-    
     gint now = time(NULL);
     if (scene.daytime == TIME_DAY){
-        if (actor->visible){
+        if (actor->widget){
             actor->visible = FALSE;
             destroy_hildon_actor(actor);
         }
         actor->time_start_animation = 0;
         return;
-    }else if (actor->time_start_animation == 0){
-        actor->time_start_animation = now + fast_rnd(30);
-        return;
+    }else {
+        if (!actor->widget)
+            create_hildon_actor(actor, desktop_plugin);
+        if (actor->time_start_animation == 0){
+            actor->time_start_animation = now + fast_rnd(30);
+            return;
+        }
     }
 
-    if (!actor->visible){
+    if (!actor->visible)
         actor->visible = TRUE;
-        create_hildon_actor(actor, desktop_plugin);
-        actor->time_start_animation = now + fast_rnd(60) + 10;
-    }else {
+    else 
         actor->visible = FALSE;
-        destroy_hildon_actor(actor);
-        actor->time_start_animation = now + fast_rnd(60) + 10;
-    }
-   
+    hildon_animation_actor_set_show(
+            HILDON_ANIMATION_ACTOR(actor->widget), 
+            actor->visible
+    );
+    actor->time_start_animation = now + fast_rnd(60) + 10;
+
 }
 
 void