proper fix; now if we take the offset into consideration, they should even disappear perfectly behind translucent things =)

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=862853
This commit is contained in:
Aaron J. Seigo 2008-09-20 06:26:26 +00:00
parent c302aa3ff4
commit de163b5e37

View File

@ -254,20 +254,18 @@ void AppletHandle::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
//fading out panel //fading out panel
if (m_rect.height() > qreal(minimumHeight()) * 1.25) { if (m_rect.height() > qreal(minimumHeight()) * 1.25) {
if (m_buttonsOnRight) { if (m_buttonsOnRight) {
qreal opaquePoint = qMax(0.05, m_background->marginSize(LeftMargin) / qreal opaquePoint = m_background->marginSize(LeftMargin) / m_decorationRect.width();
m_decorationRect.width());
//kDebug() << "opaquePoint" << opaquePoint //kDebug() << "opaquePoint" << opaquePoint
// << m_background->marginSize(LeftMargin) << m_decorationRect.width(); // << m_background->marginSize(LeftMargin) << m_decorationRect.width();
g.setColorAt(0.0, Qt::transparent); g.setColorAt(0.0, Qt::transparent);
g.setColorAt(opaquePoint-0.05, Qt::transparent); g.setColorAt(qMax(0.0, opaquePoint - 0.05), Qt::transparent);
g.setColorAt(opaquePoint, transparencyColor); g.setColorAt(opaquePoint, transparencyColor);
g.setColorAt(1.0, transparencyColor); g.setColorAt(1.0, transparencyColor);
} else { } else {
qreal opaquePoint = 1 - qMin(0.05, (m_background->marginSize(RightMargin) / qreal opaquePoint = 1 - (m_background->marginSize(RightMargin) / m_decorationRect.width());
m_decorationRect.width()));
g.setColorAt(1.0, Qt::transparent); g.setColorAt(1.0, Qt::transparent);
g.setColorAt(opaquePoint, Qt::transparent); g.setColorAt(opaquePoint, Qt::transparent);
g.setColorAt(opaquePoint-0.05, transparencyColor); g.setColorAt(qMax(0.0, opaquePoint - 0.05), transparencyColor);
g.setColorAt(0.0, transparencyColor); g.setColorAt(0.0, transparencyColor);
} }
//complete panel //complete panel