[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/tasks
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2008-02-14 8:32:44
Message-ID: 1202977964.041607.5601.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 774858 by aseigo:

delete the animator by giving it a qobject parent; store it as a member var for when \
we have multiple containers of tasks so we can share it


 M  +10 -11    tasks.cpp  
 M  +6 -0      tasks.h  


--- trunk/KDE/kdebase/workspace/plasma/applets/tasks/tasks.cpp #774857:774858
@@ -60,16 +60,15 @@
             this, SLOT(launchActivated()));
 
     // set up the animator used in the root item
-    // TODO: this really should be moved to TaskGroupItem
-    Plasma::LayoutAnimator* animator = new Plasma::LayoutAnimator;
-    animator->setAutoDeleteOnRemoval(true);
-    animator->setEffect(Plasma::LayoutAnimator::InsertedState,
-                        Plasma::LayoutAnimator::FadeInMoveEffect);
-    animator->setEffect(Plasma::LayoutAnimator::StandardState,
-                        Plasma::LayoutAnimator::MoveEffect);
-    animator->setEffect(Plasma::LayoutAnimator::RemovedState,
-                        Plasma::LayoutAnimator::FadeOutMoveEffect);
-    animator->setTimeLine(new QTimeLine(200, this));
+    m_animator = new Plasma::LayoutAnimator(this);
+    m_animator->setAutoDeleteOnRemoval(true);
+    m_animator->setEffect(Plasma::LayoutAnimator::InsertedState,
+                          Plasma::LayoutAnimator::FadeEffect);
+    m_animator->setEffect(Plasma::LayoutAnimator::StandardState,
+                          Plasma::LayoutAnimator::MoveEffect);
+    m_animator->setEffect(Plasma::LayoutAnimator::RemovedState,
+                          Plasma::LayoutAnimator::FadeEffect);
+    m_animator->setTimeLine(new QTimeLine(100, this));
 
     layout->addItem(m_rootTaskGroup);
 
@@ -105,7 +104,7 @@
             this, SLOT(removeStartingTask(StartupPtr)));
 
     // add the animator once we're initialized to avoid animating like mad on start \
                up
-    m_rootTaskGroup->layout()->setAnimator(animator);
+    m_rootTaskGroup->layout()->setAnimator(m_animator);
 }
 
 void Tasks::addStartingTask(StartupPtr task)
--- trunk/KDE/kdebase/workspace/plasma/applets/tasks/tasks.h #774857:774858
@@ -30,6 +30,11 @@
 // Plasma
 #include <plasma/applet.h>
 
+namespace Plasma
+{
+    class LayoutAnimator;
+} // namespace Plasma
+
 class AbstractTaskItem;
 class TaskGroupItem;
 
@@ -108,6 +113,7 @@
 
         bool m_showTooltip;
         bool m_showOnlyCurrentDesktop;
+        Plasma::LayoutAnimator *m_animator;
         KDialog *m_dialog;
         Ui::tasksConfig m_ui;
 };


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic