aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material/qquickmaterialripple_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-07-09 15:35:47 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-07-11 07:17:34 +0000
commit538f47cb77f2dcc34383859bd64de3667987f17b (patch)
tree4e419daa811dfdcf874b929a440cc092316ceffa /src/imports/controls/material/qquickmaterialripple_p.h
parent09706e8f9fc481d848a3616cace58baf5bc8b67c (diff)
QQuickAbstractButton: make the press point available via private API
The Material style ripple effect needs it to be able to anchor waves at the press point. Export QQuickAbstractButtonPrivate to make it accessible, and update the press point before emitting pressedChanged() since that's what the ripple effect reacts to. Press point dependent ripple effects follow in separate commits. Change-Id: I63eb51eeabcbeb307dea9d0b1731bdb51b518ec7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/material/qquickmaterialripple_p.h')
-rw-r--r--src/imports/controls/material/qquickmaterialripple_p.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/imports/controls/material/qquickmaterialripple_p.h b/src/imports/controls/material/qquickmaterialripple_p.h
index bff714ea..14e31aa6 100644
--- a/src/imports/controls/material/qquickmaterialripple_p.h
+++ b/src/imports/controls/material/qquickmaterialripple_p.h
@@ -62,7 +62,7 @@ class QQuickMaterialRipple : public QQuickItem
Q_PROPERTY(qreal clipRadius READ clipRadius WRITE setClipRadius FINAL)
Q_PROPERTY(bool pressed READ isPressed WRITE setPressed FINAL)
Q_PROPERTY(bool active READ isActive WRITE setActive FINAL)
- Q_PROPERTY(QPointF anchor READ anchor WRITE setAnchor FINAL)
+ Q_PROPERTY(QQuickItem *anchor READ anchor WRITE setAnchor FINAL)
public:
QQuickMaterialRipple(QQuickItem *parent = nullptr);
@@ -79,8 +79,10 @@ public:
bool isPressed() const;
void setPressed(bool pressed);
- QPointF anchor() const;
- void setAnchor(const QPointF &anchor);
+ QPointF anchorPoint() const;
+
+ QQuickItem *anchor() const;
+ void setAnchor(QQuickItem *anchor);
protected:
void itemChange(ItemChange change, const ItemChangeData &data) override;
@@ -92,10 +94,9 @@ protected:
private:
bool m_active;
bool m_pressed;
- bool m_anchored;
qreal m_clipRadius;
- QPointF m_anchor;
QColor m_color;
+ QQuickItem *m_anchor;
QQuickOpacityAnimator *m_opacityAnimator;
QVector<QQuickMaterialRippleAnimator *> m_rippleAnimators;
};