From 117633d40db33b201d8b6aad3e5db9fc116fdee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Tue, 7 Sep 2010 21:52:51 +0000 Subject: [PATCH] config option to specify size of blocks to fall apart to svn path=/trunk/KDE/kdebase/workspace/; revision=1172706 --- effects/fallapart/fallapart.cpp | 13 ++++++++++++- effects/fallapart/fallapart.h | 4 +++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/effects/fallapart/fallapart.cpp b/effects/fallapart/fallapart.cpp index 7dd895d07b..8e3c0e7758 100644 --- a/effects/fallapart/fallapart.cpp +++ b/effects/fallapart/fallapart.cpp @@ -28,6 +28,17 @@ namespace KWin KWIN_EFFECT( fallapart, FallApartEffect ) +FallApartEffect::FallApartEffect() + { + reconfigure( ReconfigureAll ); + } + +void FallApartEffect::reconfigure( ReconfigureFlags ) + { + KConfigGroup conf = effects->effectConfig( "FallApart" ); + blockSize = qBound( 1, conf.readEntry( "BlockSize", 40 ), 100000 ); + } + void FallApartEffect::prePaintScreen( ScreenPrePaintData& data, int time ) { if( !windows.isEmpty()) @@ -45,7 +56,7 @@ void FallApartEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, data.setTransformed(); w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE ); // Request the window to be divided into cells - data.quads = data.quads.makeGrid( 40 ); + data.quads = data.quads.makeGrid( blockSize ); } else { diff --git a/effects/fallapart/fallapart.h b/effects/fallapart/fallapart.h index 24e988c197..5bdce5e242 100644 --- a/effects/fallapart/fallapart.h +++ b/effects/fallapart/fallapart.h @@ -30,6 +30,8 @@ class FallApartEffect : public Effect { public: + FallApartEffect(); + virtual void reconfigure( ReconfigureFlags ); virtual void prePaintScreen( ScreenPrePaintData& data, int time ); virtual void prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time ); virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ); @@ -39,7 +41,7 @@ class FallApartEffect private: QHash< const EffectWindow*, double > windows; bool isRealWindow ( EffectWindow* w ); - + int blockSize; }; } // namespace