diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-08-20 07:37:59 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-08-20 07:37:59 (GMT) |
commit | fd7dca696e09f3f57c54406fe1393fccdc298a36 (patch) | |
tree | 6d7e79254555ee1c2950572fac9644ac358bdd07 | |
parent | 50fd8253b534d657d7ab6e2dd88c14d3943f869c (diff) | |
download | Qt-fd7dca696e09f3f57c54406fe1393fccdc298a36.zip Qt-fd7dca696e09f3f57c54406fe1393fccdc298a36.tar.gz Qt-fd7dca696e09f3f57c54406fe1393fccdc298a36.tar.bz2 |
Renaming Palette -> SystemPalette
-rw-r--r-- | demos/declarative/calculator/calculator.qml | 2 | ||||
-rw-r--r-- | demos/declarative/samegame/SameGame.qml | 14 | ||||
-rw-r--r-- | examples/declarative/fonts/fonts.qml | 2 | ||||
-rw-r--r-- | examples/declarative/loader/Browser.qml | 18 | ||||
-rw-r--r-- | src/declarative/util/qmlsystempalette.cpp (renamed from src/declarative/util/qmlpalette.cpp) | 132 | ||||
-rw-r--r-- | src/declarative/util/qmlsystempalette.h (renamed from src/declarative/util/qmlpalette.h) | 18 | ||||
-rw-r--r-- | src/declarative/util/util.pri | 4 |
7 files changed, 95 insertions, 95 deletions
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 56fdc59..fd5002b 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -4,7 +4,7 @@ Rectangle { id: MainWindow; width: 320; height: 270; color: Palette.window - Palette { id: Palette } + SystemPalette { id: Palette; colorGroup: Qt.Active } Script { source: "calculator.js" } VerticalPositioner { diff --git a/demos/declarative/samegame/SameGame.qml b/demos/declarative/samegame/SameGame.qml index 00853ad..d476e8b 100644 --- a/demos/declarative/samegame/SameGame.qml +++ b/demos/declarative/samegame/SameGame.qml @@ -5,13 +5,13 @@ import "content" Rectangle { id: page; width: 460; height: 700; color: activePalette.window Script { source: "content/samegame.js" } - Palette { id: activePalette; colorGroup: "Active" } + SystemPalette { id: activePalette; colorGroup: Qt.Active } Rectangle { id: gameCanvas property int score: 0 z:20; y:20; color: "white"; border.width: 1 - width:parent.width - tileSize - (parent.width % tileSize); - height:parent.height - tileSize - (parent.height % tileSize); + width:parent.width - tileSize - (parent.width % tileSize); + height:parent.height - tileSize - (parent.height % tileSize); anchors.horizontalCenter: parent.horizontalCenter Image { id:background; source: "content/pics/background.png" @@ -23,12 +23,12 @@ Rectangle { } Dialog { id: dialog; anchors.centerIn: parent; z: 21} - Button { - id: btnA; text: "New Game"; onClicked: {initBoard();} + Button { + id: btnA; text: "New Game"; onClicked: {initBoard();} anchors.top: gameCanvas.bottom; anchors.topMargin: 4; anchors.left: gameCanvas.left; } - Text { - text: "Score: " + gameCanvas.score; width:100; font.pointSize:14 + Text { + text: "Score: " + gameCanvas.score; width:100; font.pointSize:14 anchors.top: gameCanvas.bottom; anchors.topMargin: 4; anchors.right: gameCanvas.right; } } diff --git a/examples/declarative/fonts/fonts.qml b/examples/declarative/fonts/fonts.qml index 3620a00..2aa4851 100644 --- a/examples/declarative/fonts/fonts.qml +++ b/examples/declarative/fonts/fonts.qml @@ -6,7 +6,7 @@ Rectangle { width: 800; height: 600 color: Palette.base - Palette { id: Palette; colorGroup: "Active" } + SystemPalette { id: Palette; colorGroup: Qt.Active } FontLoader { id: FixedFont; name: "Courier" } diff --git a/examples/declarative/loader/Browser.qml b/examples/declarative/loader/Browser.qml index d3566da..e152779 100644 --- a/examples/declarative/loader/Browser.qml +++ b/examples/declarative/loader/Browser.qml @@ -4,14 +4,14 @@ Rectangle { id: Root width: parent.width height: parent.height - color: activePalette.base + color: Palette.base FolderListModel { id: folders nameFilters: [ "*.qml" ] // folder: "E:" } - Palette { id: activePalette; colorGroup: "Active" } + SystemPalette { id: Palette; colorGroup: Qt.Active } Component { id: FolderDelegate @@ -31,8 +31,8 @@ Rectangle { id: Highlight; visible: false anchors.fill: parent gradient: Gradient { - GradientStop { id: t1; position: 0.0; color: activePalette.highlight } - GradientStop { id: t2; position: 1.0; color: activePalette.lighter(activePalette.highlight) } + GradientStop { id: t1; position: 0.0; color: Palette.highlight } + GradientStop { id: t2; position: 1.0; color: Palette.lighter(Palette.highlight) } } } Item { @@ -44,7 +44,7 @@ Rectangle { anchors.fill: parent; verticalAlignment: "AlignVCenter" text: fileName; anchors.leftMargin: 32 font.pointSize: 10 - color: activePalette.windowText + color: Palette.windowText } MouseRegion { id: Mouse @@ -56,7 +56,7 @@ Rectangle { name: "pressed" when: Mouse.pressed SetProperties { target: Highlight; visible: true } - SetProperties { target: NameText; color: activePalette.highlightedText } + SetProperties { target: NameText; color: Palette.highlightedText } } ] } @@ -92,13 +92,13 @@ Rectangle { id: TitleBar width: parent.width height: 32 - color: activePalette.button; border.color: activePalette.mid + color: Palette.button; border.color: Palette.mid Rectangle { id: UpButton width: 30 height: TitleBar.height - border.color: activePalette.mid; color: "transparent" + border.color: Palette.mid; color: "transparent" MouseRegion { anchors.fill: parent; onClicked: folders.folder = up(folders.folder) } Image { anchors.centerIn: parent; source: "images/up.png" } } @@ -106,7 +106,7 @@ Rectangle { Text { anchors.left: UpButton.right; anchors.right: parent.right; height: parent.height anchors.leftMargin: 4; anchors.rightMargin: 4 - text: folders.folder; color: activePalette.buttonText + text: folders.folder; color: Palette.buttonText elide: "ElideLeft"; horizontalAlignment: "AlignRight"; verticalAlignment: "AlignVCenter" } } diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlsystempalette.cpp index d86f98f..88278c3 100644 --- a/src/declarative/util/qmlpalette.cpp +++ b/src/declarative/util/qmlsystempalette.cpp @@ -40,29 +40,29 @@ ****************************************************************************/ #include "private/qobject_p.h" -#include "qmlpalette.h" +#include "qmlsystempalette.h" #include <QApplication> QT_BEGIN_NAMESPACE -class QmlPalettePrivate : public QObjectPrivate +class QmlSystemPalettePrivate : public QObjectPrivate { public: QPalette palette; QPalette::ColorGroup group; }; -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Palette,QmlPalette) +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SystemPalette,QmlSystemPalette) /*! - \qmlclass Palette QmlPalette + \qmlclass SystemPalette QmlSystemPalette \ingroup group_utility - \brief The Palette item gives access to the Qt palettes. + \brief The SystemPalette item gives access to the Qt palettes. \sa QPalette Example: - \code - Palette { id: MyPalette; colorGroup: Qt.Active } + \qml + SystemPalette { id: MyPalette; colorGroup: Qt.Active } Rectangle { width: 640; height: 480 @@ -72,227 +72,227 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Palette,QmlPalette) text: "Hello!"; color: MyPalette.windowText } } - \endcode + \endqml */ -QmlPalette::QmlPalette(QObject *parent) - : QObject(*(new QmlPalettePrivate), parent) +QmlSystemPalette::QmlSystemPalette(QObject *parent) + : QObject(*(new QmlSystemPalettePrivate), parent) { - Q_D(QmlPalette); + Q_D(QmlSystemPalette); d->palette = qApp->palette(); d->group = QPalette::Active; qApp->installEventFilter(this); } -QmlPalette::~QmlPalette() +QmlSystemPalette::~QmlSystemPalette() { } /*! - \qmlproperty color Palette::window + \qmlproperty color SystemPalette::window The window (general background) color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::window() const +QColor QmlSystemPalette::window() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::Window); } /*! - \qmlproperty color Palette::windowText + \qmlproperty color SystemPalette::windowText The window text (general foreground) color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::windowText() const +QColor QmlSystemPalette::windowText() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::WindowText); } /*! - \qmlproperty color Palette::base + \qmlproperty color SystemPalette::base The base color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::base() const +QColor QmlSystemPalette::base() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::Base); } /*! - \qmlproperty color Palette::text + \qmlproperty color SystemPalette::text The text color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::text() const +QColor QmlSystemPalette::text() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::Text); } /*! - \qmlproperty color Palette::alternateBase + \qmlproperty color SystemPalette::alternateBase The alternate base color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::alternateBase() const +QColor QmlSystemPalette::alternateBase() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::AlternateBase); } /*! - \qmlproperty color Palette::button + \qmlproperty color SystemPalette::button The button color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::button() const +QColor QmlSystemPalette::button() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::Button); } /*! - \qmlproperty color Palette::buttonText + \qmlproperty color SystemPalette::buttonText The button text foreground color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::buttonText() const +QColor QmlSystemPalette::buttonText() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::ButtonText); } /*! - \qmlproperty color Palette::light + \qmlproperty color SystemPalette::light The light color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::light() const +QColor QmlSystemPalette::light() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::Light); } /*! - \qmlproperty color Palette::midlight + \qmlproperty color SystemPalette::midlight The midlight color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::midlight() const +QColor QmlSystemPalette::midlight() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::Midlight); } /*! - \qmlproperty color Palette::dark + \qmlproperty color SystemPalette::dark The dark color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::dark() const +QColor QmlSystemPalette::dark() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::Dark); } /*! - \qmlproperty color Palette::mid + \qmlproperty color SystemPalette::mid The mid color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::mid() const +QColor QmlSystemPalette::mid() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::Mid); } /*! - \qmlproperty color Palette::shadow + \qmlproperty color SystemPalette::shadow The shadow color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::shadow() const +QColor QmlSystemPalette::shadow() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::Shadow); } /*! - \qmlproperty color Palette::highlight + \qmlproperty color SystemPalette::highlight The highlight color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::highlight() const +QColor QmlSystemPalette::highlight() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::Highlight); } /*! - \qmlproperty color Palette::highlightedText + \qmlproperty color SystemPalette::highlightedText The highlighted text color of the current color group. \sa QPalette::ColorRole */ -QColor QmlPalette::highlightedText() const +QColor QmlSystemPalette::highlightedText() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->palette.color(d->group, QPalette::HighlightedText); } /*! - \qmlproperty color Palette::lighter + \qmlproperty color SystemPalette::lighter */ -QColor QmlPalette::lighter(const QColor& color) const +QColor QmlSystemPalette::lighter(const QColor& color) const { return color.lighter(); } /*! - \qmlproperty color Palette::darker + \qmlproperty color SystemPalette::darker */ -QColor QmlPalette::darker(const QColor& color) const +QColor QmlSystemPalette::darker(const QColor& color) const { return color.darker(); } /*! - \qmlproperty QPalette::ColorGroup Palette::colorGroup + \qmlproperty QPalette::ColorGroup SystemPalette::colorGroup The color group of the palette. It can be Active, Inactive or Disabled. Active is the default. \sa QPalette::ColorGroup */ -QPalette::ColorGroup QmlPalette::colorGroup() const +QPalette::ColorGroup QmlSystemPalette::colorGroup() const { - Q_D(const QmlPalette); + Q_D(const QmlSystemPalette); return d->group; } -void QmlPalette::setColorGroup(QPalette::ColorGroup colorGroup) +void QmlSystemPalette::setColorGroup(QPalette::ColorGroup colorGroup) { - Q_D(QmlPalette); + Q_D(QmlSystemPalette); d->group = colorGroup; emit paletteChanged(); } -bool QmlPalette::eventFilter(QObject *watched, QEvent *event) +bool QmlSystemPalette::eventFilter(QObject *watched, QEvent *event) { if (watched == qApp) { if (event->type() == QEvent::ApplicationPaletteChange) { @@ -303,9 +303,9 @@ bool QmlPalette::eventFilter(QObject *watched, QEvent *event) return QObject::eventFilter(watched, event); } -bool QmlPalette::event(QEvent *event) +bool QmlSystemPalette::event(QEvent *event) { - Q_D(QmlPalette); + Q_D(QmlSystemPalette); if (event->type() == QEvent::ApplicationPaletteChange) { d->palette = qApp->palette(); emit paletteChanged(); diff --git a/src/declarative/util/qmlpalette.h b/src/declarative/util/qmlsystempalette.h index e381814..6558c7e 100644 --- a/src/declarative/util/qmlpalette.h +++ b/src/declarative/util/qmlsystempalette.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QMLPALETTE_H -#define QMLPALETTE_H +#ifndef QMLSYSTEMPALETTE_H +#define QMLSYSTEMPALETTE_H #include <QtCore/qobject.h> #include <QtDeclarative/qml.h> @@ -52,11 +52,11 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QmlPalettePrivate; -class Q_DECLARATIVE_EXPORT QmlPalette : public QObject +class QmlSystemPalettePrivate; +class Q_DECLARATIVE_EXPORT QmlSystemPalette : public QObject { Q_OBJECT - Q_DECLARE_PRIVATE(QmlPalette) + Q_DECLARE_PRIVATE(QmlSystemPalette) Q_PROPERTY(QPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged) Q_PROPERTY(QColor window READ window NOTIFY paletteChanged) @@ -75,8 +75,8 @@ class Q_DECLARATIVE_EXPORT QmlPalette : public QObject Q_PROPERTY(QColor highlightedText READ highlightedText NOTIFY paletteChanged) public: - QmlPalette(QObject *parent=0); - ~QmlPalette(); + QmlSystemPalette(QObject *parent=0); + ~QmlSystemPalette(); QColor window() const; QColor windowText() const; @@ -115,8 +115,8 @@ private: QT_END_NAMESPACE -QML_DECLARE_TYPE(QmlPalette) +QML_DECLARE_TYPE(QmlSystemPalette) QT_END_HEADER -#endif // QMLPALETTE_H +#endif // QMLSYSTEMPALETTE_H diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri index 9374f00..1a0d402 100644 --- a/src/declarative/util/util.pri +++ b/src/declarative/util/util.pri @@ -6,7 +6,7 @@ SOURCES += \ util/qmlpackage.cpp \ util/qmlscript.cpp \ util/qmlanimation.cpp \ - util/qmlpalette.cpp \ + util/qmlsystempalette.cpp \ util/qmlfollow.cpp \ util/qmlstate.cpp\ util/qmltransitionmanager.cpp \ @@ -31,7 +31,7 @@ HEADERS += \ util/qmlscript.h \ util/qmlanimation.h \ util/qmlanimation_p.h \ - util/qmlpalette.h \ + util/qmlsystempalette.h \ util/qmlfollow.h \ util/qmlstate.h\ util/qmlstateoperations.h \ |