[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/shells/desktop
From: Thomas Zander <zander () kde ! org>
Date: 2008-12-23 0:36:48
Message-ID: 1229992608.853320.27006.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 900491 by zander:
* Limit the amount of repaints to only when needed.
* Don't delete a timer usign delete (from the slot), use deleteLater()
* Start with a slight glow to not have a flickr when just showing for the first time.
M +11 -7 panelview.cpp
--- trunk/KDE/kdebase/workspace/plasma/shells/desktop/panelview.cpp #900490:900491
@@ -48,7 +48,7 @@
public:
GlowBar(Plasma::Direction direction, const QRect &triggerZone)
: QWidget(0),
- m_strength(0),
+ m_strength(0.3),
m_svg(new Plasma::Svg(this)),
m_direction(direction)
{
@@ -150,23 +150,26 @@
{
QPoint localPoint = mapFromGlobal(point);
+ qreal newStrength;
switch (m_direction) {
case Plasma::Up: // when the panel is at the bottom.
- m_strength = 1 - qreal(-localPoint.y())/m_triggerDistance;
+ newStrength = 1 - qreal(-localPoint.y())/m_triggerDistance;
break;
case Plasma::Right:
- m_strength = 1 - qreal(localPoint.x())/m_triggerDistance;
+ newStrength = 1 - qreal(localPoint.x())/m_triggerDistance;
break;
case Plasma::Left: // when the panel is right-aligned
- m_strength = 1 - qreal(-localPoint.x())/m_triggerDistance;
+ newStrength = 1 - qreal(-localPoint.x())/m_triggerDistance;
break;
case Plasma::Down:
default:
- m_strength = 1- qreal(localPoint.y())/m_triggerDistance;
+ newStrength = 1- qreal(localPoint.y())/m_triggerDistance;
break;
}
- if (m_strength >= 0 && m_strength <= 1)
+ if (qAbs(newStrength - m_strength) > 0.01 && newStrength >= 0 && newStrength <= 1) {
+ m_strength = newStrength;
update();
+ }
}
@@ -949,7 +952,8 @@
void PanelView::unhintHide()
{
//kDebug() << "hide the glow";
- delete m_mousePollTimer;
+ m_mousePollTimer->stop();
+ m_mousePollTimer->deleteLater();
m_mousePollTimer = 0;
delete m_glowBar;
m_glowBar = 0;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic