summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-07-16 01:15:24 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-07-16 01:15:24 (GMT)
commit17f3d0d2389619109a80c54240903a1534a86358 (patch)
treef65d8cdff42a1847f89e0aa65f6ee3e421caa927 /src
parent8e31e21bb4fc5630706cd21a4a74251c41563adb (diff)
downloadQt-17f3d0d2389619109a80c54240903a1534a86358.zip
Qt-17f3d0d2389619109a80c54240903a1534a86358.tar.gz
Qt-17f3d0d2389619109a80c54240903a1534a86358.tar.bz2
Add QmlPalette::darker() and QmlPalette::lighter().
Diffstat (limited to 'src')
-rw-r--r--src/declarative/util/qmlpalette.cpp10
-rw-r--r--src/declarative/util/qmlpalette.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp
index eda0ded..40cfa71 100644
--- a/src/declarative/util/qmlpalette.cpp
+++ b/src/declarative/util/qmlpalette.cpp
@@ -151,6 +151,16 @@ QColor QmlPalette::highlightedText() const
return d->palette.color(d->group, QPalette::HighlightedText);
}
+QColor QmlPalette::lighter(const QColor& color) const
+{
+ return color.lighter();
+}
+
+QColor QmlPalette::darker(const QColor& color) const
+{
+ return color.darker();
+}
+
void QmlPalette::setColorGroup(QPalette::ColorGroup colorGroup)
{
Q_D(QmlPalette);
diff --git a/src/declarative/util/qmlpalette.h b/src/declarative/util/qmlpalette.h
index 1401ad1..7f26f9a 100644
--- a/src/declarative/util/qmlpalette.h
+++ b/src/declarative/util/qmlpalette.h
@@ -101,6 +101,9 @@ public:
bool virtual eventFilter(QObject *watched, QEvent *event);
bool virtual event(QEvent *event);
+ Q_INVOKABLE QColor lighter(const QColor&) const;
+ Q_INVOKABLE QColor darker(const QColor&) const;
+
Q_SIGNALS:
void paletteChanged();
};