fix layout bug
This commit is contained in:
parent
738566e043
commit
50f80a3fe4
@ -113,12 +113,11 @@ QSizeF DoricScrollerNode::sizeThatFits(QSizeF size) {
|
|||||||
->property("doricLayout")
|
->property("doricLayout")
|
||||||
.toULongLong();
|
.toULongLong();
|
||||||
|
|
||||||
if (layout->getResolved()) {
|
if (!layout->getResolved()) {
|
||||||
layout->apply(size);
|
layout->apply(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
return QSizeF(qMax(size.width(), layout->getMeasuredWidth()),
|
return QSizeF(layout->getMeasuredWidth(), layout->getMeasuredHeight());
|
||||||
qMax(size.height(), layout->getMeasuredHeight()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DoricViewNode *DoricScrollerNode::getSubNodeById(QString id) {
|
DoricViewNode *DoricScrollerNode::getSubNodeById(QString id) {
|
||||||
|
@ -12,6 +12,8 @@ void DoricSuperNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
|
|||||||
mixinSubNode(subNode);
|
mixinSubNode(subNode);
|
||||||
blendSubNode(subNode);
|
blendSubNode(subNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getLayouts()->setResolved(false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DoricViewNode::blend(view, name, prop);
|
DoricViewNode::blend(view, name, prop);
|
||||||
|
@ -98,3 +98,9 @@ void DoricTextNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
|
|||||||
DoricViewNode::blend(view, name, prop);
|
DoricViewNode::blend(view, name, prop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DoricTextNode::blend(QJsonValue jsValue) {
|
||||||
|
DoricViewNode::blend(jsValue);
|
||||||
|
|
||||||
|
getLayouts()->setResolved(false);
|
||||||
|
}
|
||||||
|
@ -13,6 +13,8 @@ public:
|
|||||||
|
|
||||||
virtual void blendLayoutConfig(QJsonValue jsObject) override;
|
virtual void blendLayoutConfig(QJsonValue jsObject) override;
|
||||||
|
|
||||||
|
virtual void blend(QJsonValue jsValue) override;
|
||||||
|
|
||||||
virtual void blend(QQuickItem *view, QString name, QJsonValue prop) override;
|
virtual void blend(QQuickItem *view, QString name, QJsonValue prop) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -753,3 +753,5 @@ void DoricLayouts::setMeasuredY(qreal measuredY) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool DoricLayouts::getResolved() { return resolved; }
|
bool DoricLayouts::getResolved() { return resolved; }
|
||||||
|
|
||||||
|
void DoricLayouts::setResolved(bool resolved) { this->resolved = resolved; }
|
||||||
|
@ -94,6 +94,7 @@ public:
|
|||||||
qreal getMeasuredHeight();
|
qreal getMeasuredHeight();
|
||||||
|
|
||||||
bool getResolved();
|
bool getResolved();
|
||||||
|
void setResolved(bool resolved);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString tag;
|
QString tag;
|
||||||
|
Reference in New Issue
Block a user