Changeset View
Changeset View
Standalone View
Standalone View
effects/magiclamp/magiclamp.cpp
Show All 28 Lines | |||||
29 | 29 | | |||
30 | MagicLampEffect::MagicLampEffect() | 30 | MagicLampEffect::MagicLampEffect() | ||
31 | { | 31 | { | ||
32 | initConfig<MagicLampConfig>(); | 32 | initConfig<MagicLampConfig>(); | ||
33 | reconfigure(ReconfigureAll); | 33 | reconfigure(ReconfigureAll); | ||
34 | connect(effects, &EffectsHandler::windowDeleted, this, &MagicLampEffect::slotWindowDeleted); | 34 | connect(effects, &EffectsHandler::windowDeleted, this, &MagicLampEffect::slotWindowDeleted); | ||
35 | connect(effects, &EffectsHandler::windowMinimized, this, &MagicLampEffect::slotWindowMinimized); | 35 | connect(effects, &EffectsHandler::windowMinimized, this, &MagicLampEffect::slotWindowMinimized); | ||
36 | connect(effects, &EffectsHandler::windowUnminimized, this, &MagicLampEffect::slotWindowUnminimized); | 36 | connect(effects, &EffectsHandler::windowUnminimized, this, &MagicLampEffect::slotWindowUnminimized); | ||
37 | connect(effects, &EffectsHandler::activeFullScreenEffectChanged, this, &MagicLampEffect::slotActiveFullScreenEffectChanged); | ||||
37 | } | 38 | } | ||
38 | 39 | | |||
39 | bool MagicLampEffect::supported() | 40 | bool MagicLampEffect::supported() | ||
40 | { | 41 | { | ||
41 | return effects->isOpenGLCompositing() && effects->animationsSupported(); | 42 | return effects->isOpenGLCompositing() && effects->animationsSupported(); | ||
42 | } | 43 | } | ||
43 | 44 | | |||
44 | void MagicLampEffect::reconfigure(ReconfigureFlags) | 45 | void MagicLampEffect::reconfigure(ReconfigureFlags) | ||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 125 | } else { | |||
129 | else if (pt.y() > geo.bottom()) | 130 | else if (pt.y() > geo.bottom()) | ||
130 | position = Bottom; | 131 | position = Bottom; | ||
131 | else if (pt.x() > geo.right()) | 132 | else if (pt.x() > geo.right()) | ||
132 | position = Right; | 133 | position = Right; | ||
133 | } | 134 | } | ||
134 | icon = QRect(pt, QSize(0, 0)); | 135 | icon = QRect(pt, QSize(0, 0)); | ||
135 | } else { | 136 | } else { | ||
136 | // Assumption: there is a panel containing the icon position | 137 | // Assumption: there is a panel containing the icon position | ||
137 | EffectWindow* panel = NULL; | 138 | EffectWindow* panel = NULL; | ||
zzag: unrealated change | |||||
138 | foreach (EffectWindow * window, effects->stackingOrder()) { | 139 | foreach (EffectWindow * window, effects->stackingOrder()) { | ||
139 | if (!window->isDock()) | 140 | if (!window->isDock()) | ||
140 | continue; | 141 | continue; | ||
141 | // we have to use intersects as there seems to be a Plasma bug | 142 | // we have to use intersects as there seems to be a Plasma bug | ||
142 | // the published icon geometry might be bigger than the panel | 143 | // the published icon geometry might be bigger than the panel | ||
143 | if (window->geometry().intersects(icon)) { | 144 | if (window->geometry().intersects(icon)) { | ||
144 | panel = window; | 145 | panel = window; | ||
145 | break; | 146 | break; | ||
▲ Show 20 Lines • Show All 215 Lines • ▼ Show 20 Line(s) | 361 | } else { | |||
361 | timeLine.setDirection(TimeLine::Backward); | 362 | timeLine.setDirection(TimeLine::Backward); | ||
362 | timeLine.setDuration(m_duration); | 363 | timeLine.setDuration(m_duration); | ||
363 | timeLine.setEasingCurve(QEasingCurve::Linear); | 364 | timeLine.setEasingCurve(QEasingCurve::Linear); | ||
364 | } | 365 | } | ||
365 | 366 | | |||
366 | effects->addRepaintFull(); | 367 | effects->addRepaintFull(); | ||
367 | } | 368 | } | ||
368 | 369 | | |||
370 | void MagicLampEffect::slotActiveFullScreenEffectChanged() | ||||
371 | { | ||||
372 | m_animations.clear(); | ||||
373 | } | ||||
374 | | ||||
369 | bool MagicLampEffect::isActive() const | 375 | bool MagicLampEffect::isActive() const | ||
370 | { | 376 | { | ||
371 | return !m_animations.isEmpty(); | 377 | return !m_animations.isEmpty(); | ||
372 | } | 378 | } | ||
373 | 379 | | |||
374 | } // namespace | 380 | } // namespace |
unrealated change