diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-10-29 17:13:52 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-10-30 08:18:50 +0000 |
commit | 390fb0d4a8e4f308b225a86b48205b14633cf0e2 (patch) | |
tree | 873c89575197999773950aaa7748a72e4c4abb3f /src | |
parent | deac7d30a51d785ed01994b5cb0239a9f6b3f12e (diff) |
Remove PageIndicator::color
The color property was added in e828b9514. The idea was that it would
be convenient to match the indicator against a specific background color,
and that the property would be designable. However, the color property
is basically impossible to support for styles that have specific color
palettes for dark and light themes. => Implement a custom delegate if
customization is required.
Change-Id: I044bbe560a59362c585c801271cd2852456287b7
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/controls/PageIndicator.qml | 3 | ||||
-rw-r--r-- | src/templates/qquickpageindicator.cpp | 25 | ||||
-rw-r--r-- | src/templates/qquickpageindicator_p.h | 6 |
3 files changed, 1 insertions, 33 deletions
diff --git a/src/imports/controls/PageIndicator.qml b/src/imports/controls/PageIndicator.qml index 445c51d3..e1361b83 100644 --- a/src/imports/controls/PageIndicator.qml +++ b/src/imports/controls/PageIndicator.qml @@ -48,7 +48,6 @@ T.PageIndicator { padding: 6 spacing: 6 - color: Theme.shadowColor // TODO //! [delegate] delegate: Rectangle { @@ -56,7 +55,7 @@ T.PageIndicator { implicitHeight: 8 radius: width / 2 - color: control.color + color: control.Theme.shadowColor // TODO opacity: index === currentIndex ? 0.95 : pressed ? 0.7 : 0.45 Behavior on opacity { OpacityAnimator { duration: 100 } } diff --git a/src/templates/qquickpageindicator.cpp b/src/templates/qquickpageindicator.cpp index c8518b6f..31fe28db 100644 --- a/src/templates/qquickpageindicator.cpp +++ b/src/templates/qquickpageindicator.cpp @@ -81,7 +81,6 @@ public: bool interactive; QQmlComponent *delegate; QQuickItem *pressedItem; - QColor color; }; QQuickItem *QQuickPageIndicatorPrivate::itemAt(const QPoint &pos) const @@ -200,8 +199,6 @@ void QQuickPageIndicator::setInteractive(bool interactive) \row \li \b index : int \li The index of the item \row \li \b pressed : bool \li Whether the item is pressed \endtable - - \sa color */ QQmlComponent *QQuickPageIndicator::delegate() const { @@ -218,28 +215,6 @@ void QQuickPageIndicator::setDelegate(QQmlComponent *delegate) } } -/*! - \qmlproperty color Qt.labs.controls::PageIndicator::color - - This property holds the color of the indicator. - - \sa delegate -*/ -QColor QQuickPageIndicator::color() const -{ - Q_D(const QQuickPageIndicator); - return d->color; -} - -void QQuickPageIndicator::setColor(const QColor &color) -{ - Q_D(QQuickPageIndicator); - if (d->color != color) { - d->color = color; - emit colorChanged(); - } -} - void QQuickPageIndicator::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) { Q_D(QQuickPageIndicator); diff --git a/src/templates/qquickpageindicator_p.h b/src/templates/qquickpageindicator_p.h index bb0bdf3c..46eb2cb2 100644 --- a/src/templates/qquickpageindicator_p.h +++ b/src/templates/qquickpageindicator_p.h @@ -49,7 +49,6 @@ // #include <QtLabsTemplates/private/qquickcontrol_p.h> -#include <QtGui/qcolor.h> QT_BEGIN_NAMESPACE @@ -63,7 +62,6 @@ class Q_LABSTEMPLATES_EXPORT QQuickPageIndicator : public QQuickControl Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL) Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged FINAL) Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL) - Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL) public: explicit QQuickPageIndicator(QQuickItem *parent = Q_NULLPTR); @@ -80,15 +78,11 @@ public: QQmlComponent *delegate() const; void setDelegate(QQmlComponent *delegate); - QColor color() const; - void setColor(const QColor &color); - Q_SIGNALS: void countChanged(); void currentIndexChanged(); void interactiveChanged(); void delegateChanged(); - void colorChanged(); protected: void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) Q_DECL_OVERRIDE; |