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:
parent
306e353fe6
commit
ac0c457b65
@ -273,9 +273,13 @@ void FrameSvgItem::setImagePath(const QString &path)
|
|||||||
m_frameSvg->setElementPrefix(m_prefix);
|
m_frameSvg->setElementPrefix(m_prefix);
|
||||||
updateDevicePixelRatio();
|
updateDevicePixelRatio();
|
||||||
|
|
||||||
|
if (implicitWidth() <= 0) {
|
||||||
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
|
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));
|
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
|
||||||
|
}
|
||||||
|
|
||||||
emit imagePathChanged();
|
emit imagePathChanged();
|
||||||
m_margins->update();
|
m_margins->update();
|
||||||
@ -301,9 +305,13 @@ void FrameSvgItem::setPrefix(const QString &prefix)
|
|||||||
m_frameSvg->setElementPrefix(prefix);
|
m_frameSvg->setElementPrefix(prefix);
|
||||||
m_prefix = prefix;
|
m_prefix = prefix;
|
||||||
|
|
||||||
|
if (implicitWidth() <= 0) {
|
||||||
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
|
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));
|
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
|
||||||
|
}
|
||||||
|
|
||||||
emit prefixChanged();
|
emit prefixChanged();
|
||||||
m_margins->update();
|
m_margins->update();
|
||||||
@ -364,9 +372,13 @@ void FrameSvgItem::geometryChanged(const QRectF &newGeometry,
|
|||||||
|
|
||||||
void FrameSvgItem::doUpdate()
|
void FrameSvgItem::doUpdate()
|
||||||
{
|
{
|
||||||
|
if (implicitWidth() <= 0) {
|
||||||
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
|
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));
|
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
|
||||||
|
}
|
||||||
|
|
||||||
QString prefix = m_frameSvg->actualPrefix();
|
QString prefix = m_frameSvg->actualPrefix();
|
||||||
bool hasOverlay = !prefix.startsWith(QStringLiteral("mask-")) && m_frameSvg->hasElement(prefix % "overlay");
|
bool hasOverlay = !prefix.startsWith(QStringLiteral("mask-")) && m_frameSvg->hasElement(prefix % "overlay");
|
||||||
|
Loading…
Reference in New Issue
Block a user