summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-12-10 10:33:50 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-12-10 10:58:24 (GMT)
commit8d3596fefc882a4194c665bcde4e8309dbdcc85f (patch)
treef8957887296695990d2c4bf6f2512deb91881d1e /src/declarative
parentd1fa2391bf53e43e1952c6722e2525cc947557f2 (diff)
downloadQt-8d3596fefc882a4194c665bcde4e8309dbdcc85f.zip
Qt-8d3596fefc882a4194c665bcde4e8309dbdcc85f.tar.gz
Qt-8d3596fefc882a4194c665bcde4e8309dbdcc85f.tar.bz2
Update centerIn when center offsets change
Also adds functionality to update fill when margins change. Task-number: QTBUG-6631
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsanchors.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
index b72f010..c28ca02 100644
--- a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
@@ -833,7 +833,10 @@ void QmlGraphicsAnchors::setLeftMargin(qreal offset)
if (d->leftMargin == offset)
return;
d->leftMargin = offset;
- d->updateHorizontalAnchors();
+ if(d->fill)
+ d->fillChanged();
+ else
+ d->updateHorizontalAnchors();
emit leftMarginChanged();
}
@@ -849,7 +852,10 @@ void QmlGraphicsAnchors::setRightMargin(qreal offset)
if (d->rightMargin == offset)
return;
d->rightMargin = offset;
- d->updateHorizontalAnchors();
+ if(d->fill)
+ d->fillChanged();
+ else
+ d->updateHorizontalAnchors();
emit rightMarginChanged();
}
@@ -865,7 +871,10 @@ void QmlGraphicsAnchors::setHorizontalCenterOffset(qreal offset)
if (d->hCenterOffset == offset)
return;
d->hCenterOffset = offset;
- d->updateHorizontalAnchors();
+ if(d->centerIn)
+ d->centerInChanged();
+ else
+ d->updateHorizontalAnchors();
emit horizontalCenterOffsetChanged();
}
@@ -881,7 +890,10 @@ void QmlGraphicsAnchors::setTopMargin(qreal offset)
if (d->topMargin == offset)
return;
d->topMargin = offset;
- d->updateVerticalAnchors();
+ if(d->fill)
+ d->fillChanged();
+ else
+ d->updateVerticalAnchors();
emit topMarginChanged();
}
@@ -897,7 +909,10 @@ void QmlGraphicsAnchors::setBottomMargin(qreal offset)
if (d->bottomMargin == offset)
return;
d->bottomMargin = offset;
- d->updateVerticalAnchors();
+ if(d->fill)
+ d->fillChanged();
+ else
+ d->updateVerticalAnchors();
emit bottomMarginChanged();
}
@@ -913,7 +928,10 @@ void QmlGraphicsAnchors::setVerticalCenterOffset(qreal offset)
if (d->vCenterOffset == offset)
return;
d->vCenterOffset = offset;
- d->updateVerticalAnchors();
+ if(d->centerIn)
+ d->centerInChanged();
+ else
+ d->updateVerticalAnchors();
emit verticalCenterOffsetChanged();
}