Implement reconfigure in SlidingPopups Effect

FEATURE: 264277
FIXED-IN: 4.7.0
remotes/origin/Plasma/5.0
Martin Gräßlin 15 years ago
parent e0906c8766
commit 2a91623891
  1. 28
      effects/slidingpopups/slidingpopups.cpp
  2. 1
      effects/slidingpopups/slidingpopups.h

@ -31,9 +31,6 @@ KWIN_EFFECT(slidingpopups, SlidingPopupsEffect)
SlidingPopupsEffect::SlidingPopupsEffect()
{
KConfigGroup conf = effects->effectConfig("SlidingPopups");
mFadeInTime = animationTime(conf, "SlideInTime", 250);
mFadeOutTime = animationTime(conf, "SlideOutTime", 250);
mAtom = XInternAtom(display(), "_KDE_SLIDE", False);
effects->registerPropertyType(mAtom, true);
// TODO hackish way to announce support, make better after 4.0
@ -43,6 +40,7 @@ SlidingPopupsEffect::SlidingPopupsEffect()
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
connect(effects, SIGNAL(windowDeleted(EffectWindow*)), this, SLOT(slotWindowDeleted(EffectWindow*)));
connect(effects, SIGNAL(propertyNotify(EffectWindow*,long)), this, SLOT(slotPropertyNotify(EffectWindow*,long)));
reconfigure(ReconfigureAll);
}
SlidingPopupsEffect::~SlidingPopupsEffect()
@ -51,6 +49,30 @@ SlidingPopupsEffect::~SlidingPopupsEffect()
effects->registerPropertyType(mAtom, false);
}
void SlidingPopupsEffect::reconfigure(ReconfigureFlags flags)
{
Q_UNUSED(flags)
KConfigGroup conf = effects->effectConfig("SlidingPopups");
mFadeInTime = animationTime(conf, "SlideInTime", 250);
mFadeOutTime = animationTime(conf, "SlideOutTime", 250);
QHash< const EffectWindow*, QTimeLine* >::iterator it = mAppearingWindows.begin();
while (it != mAppearingWindows.end()) {
it.value()->setDuration(animationTime(mFadeInTime));
it++;
}
it = mDisappearingWindows.begin();
while (it != mDisappearingWindows.end()) {
it.value()->setDuration(animationTime(mFadeOutTime));
it++;
}
QHash< const EffectWindow*, Data >::iterator wIt = mWindowsData.begin();
while (wIt != mWindowsData.end()) {
wIt.value().fadeInDuration = mFadeInTime;
wIt.value().fadeOutDuration = mFadeOutTime;
wIt++;
}
}
void SlidingPopupsEffect::prePaintScreen(ScreenPrePaintData& data, int time)
{
if (!mAppearingWindows.isEmpty() || !mDisappearingWindows.isEmpty())

@ -40,6 +40,7 @@ public:
virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void postPaintWindow(EffectWindow* w);
virtual void reconfigure(ReconfigureFlags flags);
// TODO react also on virtual desktop changes
public Q_SLOTS:

Loading…
Cancel
Save