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

List:       kde-commits
Subject:    branches/KDE/4.4/kdebase/workspace/kwin/clients/oxygen
From:       Hugo Pereira Da Costa <hugo.pereira () free ! fr>
Date:       2010-02-14 22:03:51
Message-ID: 1266185031.432737.10182.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1090210 by hpereiradacosta:

Backport: r1090208

Use KGlobalSettings::graphicEffectsLevel in conjunction with
OxygenConfiguration to 
determine if animations should be enabled.

This allows to turn off all animations if the "graphical effects" combobox in
"systemsettings->appearance->style->fine tunning" is set to either
- Low display resolution and low CPU
- High display resolution and low CPU

CCBUG: 226668



 M  +1 -1      oxygenbutton.cpp  
 M  +1 -1      oxygenclient.cpp  
 M  +16 -4     oxygenclient.h  


--- branches/KDE/4.4/kdebase/workspace/kwin/clients/oxygen/oxygenbutton.cpp #1090209:1090210
@@ -119,7 +119,7 @@
 
   //___________________________________________________
   bool OxygenButton::animateButtonHover( void ) const
-  { return client_.configuration().useAnimations(); }
+  { return client_.useAnimations(); }
 
   //___________________________________________________
   QSize OxygenButton::sizeHint() const
--- branches/KDE/4.4/kdebase/workspace/kwin/clients/oxygen/oxygenclient.cpp #1090209:1090210
@@ -174,7 +174,7 @@
     glowAnimation().data()->setDuration( configuration_.animationsDuration() );
     titleAnimationData_.data()->setDuration( configuration_.animationsDuration() );
     itemData_.animation().data()->setDuration( configuration_.animationsDuration() );
-    itemData_.setAnimationsEnabled( configuration_.useAnimations() );
+    itemData_.setAnimationsEnabled( useAnimations() );
 
     // reset title transitions
     titleAnimationData_.data()->reset();
--- branches/KDE/4.4/kdebase/workspace/kwin/clients/oxygen/oxygenclient.h #1090209:1090210
@@ -36,9 +36,11 @@
 #include "lib/helper.h"
 
 #include <kcommondecoration.h>
-#include <QBasicTimer>
-#include <QTimerEvent>
+#include <KGlobalSettings>
+#include <QtCore/QBasicTimer>
+#include <QtCore/QTimerEvent>
 
+
 namespace Oxygen
 {
 
@@ -76,6 +78,16 @@
         virtual bool isMaximized( void ) const
         { return maximizeMode()==MaximizeFull && !options()->moveResizeMaximizedWindows();  }
 
+
+        //! true if animations are used
+        /*! this combines OxygenConfiguration and KGlobalSettings */
+        bool useAnimations( void ) const
+        {
+          return
+            configuration().useAnimations() &&
+            KGlobalSettings::graphicEffectsLevel() >= KGlobalSettings::SimpleAnimationEffects;
+        }
+
         //! true if glow is animated
         bool glowIsAnimated( void ) const
         { return glowAnimation_.data()->isRunning(); }
@@ -289,13 +301,13 @@
 
         //! return true when activity change are animated
         bool animateActiveChange( void ) const
-        { return ( configuration().useAnimations() && !isPreview() ); }
+        { return ( useAnimations() && !isPreview() ); }
 
         //! return true when activity change are animated
         bool animateTitleChange( void ) const
         {
             return
-                configuration().useAnimations() &&
+                useAnimations() &&
                 configuration().animateTitleChange() &&
                 !configuration().drawTitleOutline() &&
                 !configuration().hideTitleBar() &&
[prev in list] [next in list] [prev in thread] [next in thread] 

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