From 390fb0d4a8e4f308b225a86b48205b14633cf0e2 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 29 Oct 2015 17:13:52 +0100 Subject: 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 --- src/imports/controls/PageIndicator.qml | 3 +-- src/templates/qquickpageindicator.cpp | 25 ------------------------- src/templates/qquickpageindicator_p.h | 6 ------ 3 files changed, 1 insertion(+), 33 deletions(-) (limited to 'src') 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 -#include 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; -- cgit v1.2.3