partly revert last commit

revert part of
306e353fe6

if a framesvgitem has an implicitsize explicitly set, it shouldn't be overwritten

Change-Id: I931ca8acafdc2f6908945d03fca97487ced22988
This commit is contained in:
Marco Martin 2014-09-17 20:21:34 +02:00
parent 306e353fe6
commit ac0c457b65

View File

@ -273,9 +273,13 @@ void FrameSvgItem::setImagePath(const QString &path)
m_frameSvg->setElementPrefix(m_prefix);
updateDevicePixelRatio();
if (implicitWidth() <= 0) {
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
}
if (implicitHeight() <= 0) {
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
}
emit imagePathChanged();
m_margins->update();
@ -301,9 +305,13 @@ void FrameSvgItem::setPrefix(const QString &prefix)
m_frameSvg->setElementPrefix(prefix);
m_prefix = prefix;
if (implicitWidth() <= 0) {
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
}
if (implicitHeight() <= 0) {
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
}
emit prefixChanged();
m_margins->update();
@ -364,9 +372,13 @@ void FrameSvgItem::geometryChanged(const QRectF &newGeometry,
void FrameSvgItem::doUpdate()
{
if (implicitWidth() <= 0) {
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
}
if (implicitHeight() <= 0) {
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
}
QString prefix = m_frameSvg->actualPrefix();
bool hasOverlay = !prefix.startsWith(QStringLiteral("mask-")) && m_frameSvg->hasElement(prefix % "overlay");