diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-09-23 16:13:51 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-26 03:24:42 +0200 |
commit | 14228a41471a327f6e600220a795a1c6cb23c2b2 (patch) | |
tree | c7c9f127b8dfc9f9e608ab421a692be7896d0c18 /src/declarative/items/qsgflickable_p_p.h | |
parent | 2790f9b1d5488f7f29903408eaa5d2a6118f55ee (diff) |
Support margins in Flickable.
It is sometimes desireable to leave a margin/add decoration around the
content of a Flickable. This adds topMargin, leftMargin, bottomMargin
rightMargin, xOrigin and yOrigin properties to Flickable.
Task-number: QTBUG-21362
Change-Id: Ia24ea4c63e7a8de683b68100baac782c6f3a66bb
Reviewed-on: http://codereview.qt-project.org/5445
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src/declarative/items/qsgflickable_p_p.h')
-rw-r--r-- | src/declarative/items/qsgflickable_p_p.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/declarative/items/qsgflickable_p_p.h b/src/declarative/items/qsgflickable_p_p.h index 21c31060b8..b3690b4651 100644 --- a/src/declarative/items/qsgflickable_p_p.h +++ b/src/declarative/items/qsgflickable_p_p.h @@ -95,8 +95,10 @@ public: struct AxisData { AxisData(QSGFlickablePrivate *fp, void (QSGFlickablePrivate::*func)(qreal)) - : move(fp, func), viewSize(-1), smoothVelocity(fp), atEnd(false), atBeginning(true) - , fixingUp(false), inOvershoot(false), dragging(false) + : move(fp, func), viewSize(-1), startMargin(0), endMargin(0) + , smoothVelocity(fp), atEnd(false), atBeginning(true) + , fixingUp(false), inOvershoot(false), dragging(false), extentsChanged(false) + , explicitValue(false), minExtentDirty(true), maxExtentDirty(true) {} void reset() { @@ -106,6 +108,12 @@ public: inOvershoot = false; } + void markExtentsDirty() { + minExtentDirty = true; + maxExtentDirty = true; + extentsChanged = true; + } + void addVelocitySample(qreal v, qreal maxVelocity); void updateVelocity(); @@ -117,6 +125,8 @@ public: qreal dragMaxBound; qreal velocity; qreal flickTarget; + qreal startMargin; + qreal endMargin; QSGFlickablePrivate::Velocity smoothVelocity; QPODVector<qreal,10> velocityBuffer; bool atEnd : 1; @@ -124,6 +134,10 @@ public: bool fixingUp : 1; bool inOvershoot : 1; bool dragging : 1; + bool extentsChanged : 1; + bool explicitValue : 1; + mutable bool minExtentDirty : 1; + mutable bool maxExtentDirty : 1; }; void flickX(qreal velocity); |