the contents rect check is a cheap cop out mostly, but it works a lot. when it doesn't, also make sure we aren't dealing with an applets whose shape is the bounding rect

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=866793
This commit is contained in:
Aaron J. Seigo 2008-10-01 22:26:43 +00:00
parent fbc68c415f
commit 2f87c469f7

View File

@ -1011,9 +1011,19 @@ void AppletHandle::calculateSize()
if (m_applet->contentsRect().height() > qreal(minimumHeight()) * 1.25) { if (m_applet->contentsRect().height() > qreal(minimumHeight()) * 1.25) {
int addedMargin = marginLeft/2; int addedMargin = marginLeft/2;
// now we check to see if the shape is smaller than the contents,
// and that the shape is not just the bounding rect; in those cases
// we have a shaped guy and we draw a full panel;
// TODO: allow applets to mark when they have translucent areas and
// should therefore skip this test?
if (!m_applet->shape().contains(m_applet->contentsRect())) { if (!m_applet->shape().contains(m_applet->contentsRect())) {
QPainterPath p;
p.addRect(m_applet->boundingRect());
if (m_applet->shape() != p) {
addedMargin = m_applet->contentsRect().width()/2; addedMargin = m_applet->contentsRect().width()/2;
} }
}
if (m_buttonsOnRight) { if (m_buttonsOnRight) {
marginLeft += addedMargin; marginLeft += addedMargin;