diff options
Diffstat (limited to 'src/charts/themes')
-rw-r--r-- | src/charts/themes/charttheme_p.h | 93 | ||||
-rw-r--r-- | src/charts/themes/chartthemebluecerulean_p.h | 70 | ||||
-rw-r--r-- | src/charts/themes/chartthemeblueicy_p.h | 72 | ||||
-rw-r--r-- | src/charts/themes/chartthemebluencs_p.h | 71 | ||||
-rw-r--r-- | src/charts/themes/chartthemebrownsand_p.h | 71 | ||||
-rw-r--r-- | src/charts/themes/chartthemedark_p.h | 71 | ||||
-rw-r--r-- | src/charts/themes/chartthemehighcontrast_p.h | 73 | ||||
-rw-r--r-- | src/charts/themes/chartthemelight_p.h | 73 | ||||
-rw-r--r-- | src/charts/themes/chartthemeqt_p.h | 74 | ||||
-rw-r--r-- | src/charts/themes/chartthemesystem_p.h | 177 | ||||
-rw-r--r-- | src/charts/themes/themes.pri | 14 |
11 files changed, 859 insertions, 0 deletions
diff --git a/src/charts/themes/charttheme_p.h b/src/charts/themes/charttheme_p.h new file mode 100644 index 00000000..58510bd7 --- /dev/null +++ b/src/charts/themes/charttheme_p.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the Qt Enterprise Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTTHEME_H +#define CHARTTHEME_H + +#include "chartthememanager_p.h" +#include <QColor> +#include <QGradientStops> + +QT_CHARTS_BEGIN_NAMESPACE + +class ChartTheme +{ + +public: + enum BackgroundShadesMode { + BackgroundShadesNone = 0, + BackgroundShadesVertical, + BackgroundShadesHorizontal, + BackgroundShadesBoth + }; + +protected: + explicit ChartTheme(QChart::ChartTheme id = QChart::ChartThemeLight):m_id(id), + m_backgroundShadesBrush(Qt::SolidPattern), + m_backgroundShades(BackgroundShadesNone), + m_backgroundDropShadowEnabled(false) + {}; +public: + QChart::ChartTheme id() const { return m_id; } + QList<QGradient> seriesGradients() const { return m_seriesGradients; } + QList<QColor> seriesColors() const { return m_seriesColors; } + QLinearGradient chartBackgroundGradient() const { return m_chartBackgroundGradient; } + QFont masterFont() const { return m_masterFont; } + QFont labelFont() const { return m_labelFont; } + QBrush labelBrush() const { return m_labelBrush; } + QPen axisLinePen() const { return m_axisLinePen; } + QPen backgroundShadesPen() const { return m_backgroundShadesPen; } + QPen outlinePen() const { return m_outlinePen; } + QBrush backgroundShadesBrush() const { return m_backgroundShadesBrush; } + BackgroundShadesMode backgroundShades() const { return m_backgroundShades; } + bool isBackgroundDropShadowEnabled() const { return m_backgroundDropShadowEnabled; } + QPen girdLinePen() const { return m_gridLinePen; } + +protected: + QChart::ChartTheme m_id; + QList<QColor> m_seriesColors; + QList<QGradient> m_seriesGradients; + QLinearGradient m_chartBackgroundGradient; + + QFont m_masterFont; + QFont m_labelFont; + QBrush m_labelBrush; + QPen m_axisLinePen; + QPen m_backgroundShadesPen; + QPen m_outlinePen; + QBrush m_backgroundShadesBrush; + BackgroundShadesMode m_backgroundShades; + bool m_backgroundDropShadowEnabled; + QPen m_gridLinePen; + +}; + +QT_CHARTS_END_NAMESPACE + +#endif // CHARTTHEME_H diff --git a/src/charts/themes/chartthemebluecerulean_p.h b/src/charts/themes/chartthemebluecerulean_p.h new file mode 100644 index 00000000..83f1441a --- /dev/null +++ b/src/charts/themes/chartthemebluecerulean_p.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the Qt Enterprise Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTTHEMEBLUECERULEAN_P_H +#define CHARTTHEMEBLUECERULEAN_P_H + +#include "charttheme_p.h" + +QT_CHARTS_BEGIN_NAMESPACE + +class ChartThemeBlueCerulean: public ChartTheme +{ +public: + ChartThemeBlueCerulean() : ChartTheme(QChart::ChartThemeBlueCerulean) { + // Series colors + m_seriesColors << QRgb(0xc7e85b); + m_seriesColors << QRgb(0x1cb54f); + m_seriesColors << QRgb(0x5cbf9b); + m_seriesColors << QRgb(0x009fbf); + m_seriesColors << QRgb(0xee7392); + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background + QLinearGradient backgroundGradient(0.5, 0.0, 0.5, 1.0); + backgroundGradient.setColorAt(0.0, QRgb(0x056189)); + backgroundGradient.setColorAt(1.0, QRgb(0x101a31)); + backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + m_chartBackgroundGradient = backgroundGradient; + + // Axes and other + m_labelBrush = QBrush(QRgb(0xffffff)); + m_axisLinePen = QPen(QRgb(0xd6d6d6)); + m_axisLinePen.setWidth(2); + m_gridLinePen = QPen(QRgb(0x84a2b0)); + m_gridLinePen.setWidth(1); + m_backgroundShades = BackgroundShadesNone; + m_outlinePen = QPen(QRgb(0xebebeb)); + m_outlinePen.setWidthF(2.0); + } +}; + +QT_CHARTS_END_NAMESPACE + +#endif diff --git a/src/charts/themes/chartthemeblueicy_p.h b/src/charts/themes/chartthemeblueicy_p.h new file mode 100644 index 00000000..6dc6c9c4 --- /dev/null +++ b/src/charts/themes/chartthemeblueicy_p.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the Qt Enterprise Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTTHEMEBLUEICY_P_H +#define CHARTTHEMEBLUEICY_P_H + +#include "charttheme_p.h" + +QT_CHARTS_BEGIN_NAMESPACE + +class ChartThemeBlueIcy: public ChartTheme +{ +public: + ChartThemeBlueIcy() : ChartTheme(QChart::ChartThemeBlueIcy) + { + // Series colors + m_seriesColors << QRgb(0x3daeda); + m_seriesColors << QRgb(0x2685bf); + m_seriesColors << QRgb(0x0c2673); + m_seriesColors << QRgb(0x5f3dba); + m_seriesColors << QRgb(0x2fa3b4); + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background + QLinearGradient backgroundGradient(0.5, 0.0, 0.5, 1.0); + backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); + backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); + backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + m_chartBackgroundGradient = backgroundGradient; + m_backgroundDropShadowEnabled = true; + + // Axes and other + m_labelBrush = QBrush(QRgb(0x404044)); + m_axisLinePen = QPen(QRgb(0xd6d6d6)); + m_axisLinePen.setWidth(2); + m_gridLinePen = QPen(QRgb(0xe2e2e2)); + m_gridLinePen.setWidth(1); + m_backgroundShades = BackgroundShadesNone; + m_outlinePen = QPen(QRgb(0x474747)); + m_outlinePen.setWidthF(2.0); + } +}; + +QT_CHARTS_END_NAMESPACE + +#endif diff --git a/src/charts/themes/chartthemebluencs_p.h b/src/charts/themes/chartthemebluencs_p.h new file mode 100644 index 00000000..7806fd02 --- /dev/null +++ b/src/charts/themes/chartthemebluencs_p.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the Qt Enterprise Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTTHEMEBLUENCS_P_H +#define CHARTTHEMEBLUENCS_P_H + +#include "charttheme_p.h" + +QT_CHARTS_BEGIN_NAMESPACE + +class ChartThemeBlueNcs: public ChartTheme +{ +public: + ChartThemeBlueNcs() : ChartTheme(QChart::ChartThemeBlueNcs) + { + // Series colors + m_seriesColors << QRgb(0x1db0da); + m_seriesColors << QRgb(0x1341a6); + m_seriesColors << QRgb(0x88d41e); + m_seriesColors << QRgb(0xff8e1a); + m_seriesColors << QRgb(0x398ca3); + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background + QLinearGradient backgroundGradient; + backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); + backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); + backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + m_chartBackgroundGradient = backgroundGradient; + + // Axes and other + m_labelBrush = QBrush(QRgb(0x404044)); + m_axisLinePen = QPen(QRgb(0xd6d6d6)); + m_axisLinePen.setWidth(2); + m_gridLinePen = QPen(QRgb(0xe2e2e2)); + m_gridLinePen.setWidth(1); + m_backgroundShades = BackgroundShadesNone; + m_outlinePen = QPen(QRgb(0x474747)); + m_outlinePen.setWidthF(2.0); + } +}; + +QT_CHARTS_END_NAMESPACE + +#endif diff --git a/src/charts/themes/chartthemebrownsand_p.h b/src/charts/themes/chartthemebrownsand_p.h new file mode 100644 index 00000000..9a980855 --- /dev/null +++ b/src/charts/themes/chartthemebrownsand_p.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the Qt Enterprise Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTTHEMEBROWNSAND_P_H +#define CHARTTHEMEBROWNSAND_P_H + +#include "charttheme_p.h" + +QT_CHARTS_BEGIN_NAMESPACE + +class ChartThemeBrownSand: public ChartTheme +{ +public: + ChartThemeBrownSand() : ChartTheme(QChart::ChartThemeBrownSand) + { + // Series colors + m_seriesColors << QRgb(0xb39b72); + m_seriesColors << QRgb(0xb3b376); + m_seriesColors << QRgb(0xc35660); + m_seriesColors << QRgb(0x536780); + m_seriesColors << QRgb(0x494345); + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background + QLinearGradient backgroundGradient; + backgroundGradient.setColorAt(0.0, QRgb(0xf3ece0)); + backgroundGradient.setColorAt(1.0, QRgb(0xf3ece0)); + backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + m_chartBackgroundGradient = backgroundGradient; + + // Axes and other + m_labelBrush = QBrush(QRgb(0x404044)); + m_axisLinePen = QPen(QRgb(0xb5b0a7)); + m_axisLinePen.setWidth(2); + m_gridLinePen = QPen(QRgb(0xd4cec3)); + m_gridLinePen.setWidth(1); + m_backgroundShades = BackgroundShadesNone; + m_outlinePen = QPen(QRgb(0x222222)); + m_outlinePen.setWidthF(2.0); + } +}; + +QT_CHARTS_END_NAMESPACE + +#endif diff --git a/src/charts/themes/chartthemedark_p.h b/src/charts/themes/chartthemedark_p.h new file mode 100644 index 00000000..6ad3eaf7 --- /dev/null +++ b/src/charts/themes/chartthemedark_p.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the Qt Enterprise Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTTHEMEDARK_P_H +#define CHARTTHEMEDARK_P_H + +#include "charttheme_p.h" + +QT_CHARTS_BEGIN_NAMESPACE + +class ChartThemeDark : public ChartTheme +{ +public: + ChartThemeDark() : ChartTheme(QChart::ChartThemeDark) + { + // Series colors + m_seriesColors << QRgb(0x38ad6b); + m_seriesColors << QRgb(0x3c84a7); + m_seriesColors << QRgb(0xeb8817); + m_seriesColors << QRgb(0x7b7f8c); + m_seriesColors << QRgb(0xbf593e); + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background + QLinearGradient backgroundGradient(0.5, 0.0, 0.5, 1.0); + backgroundGradient.setColorAt(0.0, QRgb(0x2e303a)); + backgroundGradient.setColorAt(1.0, QRgb(0x121218)); + backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + m_chartBackgroundGradient = backgroundGradient; + + // Axes and other + m_labelBrush = QBrush(QRgb(0xffffff)); + m_axisLinePen = QPen(QRgb(0x86878c)); + m_axisLinePen.setWidth(2); + m_gridLinePen = QPen(QRgb(0x86878c)); + m_gridLinePen.setWidth(1); + m_backgroundShades = BackgroundShadesNone; + m_outlinePen = QPen(QRgb(0xd6d6d6)); + m_outlinePen.setWidthF(2.0); + } +}; + +QT_CHARTS_END_NAMESPACE + +#endif diff --git a/src/charts/themes/chartthemehighcontrast_p.h b/src/charts/themes/chartthemehighcontrast_p.h new file mode 100644 index 00000000..353cc659 --- /dev/null +++ b/src/charts/themes/chartthemehighcontrast_p.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the Qt Enterprise Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTTHEMEHIGHCONTRAST_P_H +#define CHARTTHEMEHIGHCONTRAST_P_H + +#include "charttheme_p.h" + +QT_CHARTS_BEGIN_NAMESPACE + +class ChartThemeHighContrast : public ChartTheme +{ +public: + ChartThemeHighContrast() : ChartTheme(QChart::ChartThemeHighContrast) + { + // Series colors + m_seriesColors << QRgb(0x202020); + m_seriesColors << QRgb(0x596a74); + m_seriesColors << QRgb(0xffab03); + m_seriesColors << QRgb(0x038e9b); + m_seriesColors << QRgb(0xff4a41); + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background + QLinearGradient backgroundGradient(0.5, 0.0, 0.5, 1.0); + backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); + backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); + backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + m_chartBackgroundGradient = backgroundGradient; + m_backgroundDropShadowEnabled = true; + + // Axes and other + m_labelBrush = QBrush(QRgb(0x181818)); + m_axisLinePen = QPen(QRgb(0x8c8c8c)); + m_axisLinePen.setWidth(2); + m_gridLinePen = QPen(QRgb(0x8c8c8c)); + m_gridLinePen.setWidth(1); + m_backgroundShadesBrush = QBrush(QRgb(0xffeecd)); + m_backgroundShades = BackgroundShadesHorizontal; + m_outlinePen = QPen(QColor(Qt::black)); + m_outlinePen.setWidthF(2.0); + } +}; + +QT_CHARTS_END_NAMESPACE + +#endif diff --git a/src/charts/themes/chartthemelight_p.h b/src/charts/themes/chartthemelight_p.h new file mode 100644 index 00000000..161c3567 --- /dev/null +++ b/src/charts/themes/chartthemelight_p.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the Qt Enterprise Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTTHEMELIGHT_P_H +#define CHARTTHEMELIGHT_P_H + +#include "charttheme_p.h" + +QT_CHARTS_BEGIN_NAMESPACE + +class ChartThemeLight: public ChartTheme +{ +public: + ChartThemeLight() : ChartTheme(QChart::ChartThemeLight) + { + // Series colors + m_seriesColors << QRgb(0x209fdf); + m_seriesColors << QRgb(0x99ca53); + m_seriesColors << QRgb(0xf6a625); + m_seriesColors << QRgb(0x6d5fd5); + m_seriesColors << QRgb(0xbf593e); + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background + QLinearGradient backgroundGradient; + backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); + backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); + backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + m_chartBackgroundGradient = backgroundGradient; + // There is a performance issue in the drop shadow implementation, so disabled for now +// m_backgroundDropShadowEnabled = true; + + // Axes and other + m_axisLinePen = QPen(0xd6d6d6); + m_axisLinePen.setWidth(1); + m_labelBrush = QBrush(QRgb(0x404044)); + m_gridLinePen = QPen(QRgb(0xe2e2e2)); + m_gridLinePen.setWidth(1); + m_backgroundShades = BackgroundShadesNone; + m_outlinePen = QPen(0x4d4d4d); + m_outlinePen.setWidthF(2.0); + } +}; + +QT_CHARTS_END_NAMESPACE + +#endif diff --git a/src/charts/themes/chartthemeqt_p.h b/src/charts/themes/chartthemeqt_p.h new file mode 100644 index 00000000..06c10eee --- /dev/null +++ b/src/charts/themes/chartthemeqt_p.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the Qt Enterprise Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTTHEMEQT_P_H +#define CHARTTHEMEQT_P_H + +#include "charttheme_p.h" + +QT_CHARTS_BEGIN_NAMESPACE + +class ChartThemeQt : public ChartTheme +{ +public: + ChartThemeQt() : ChartTheme(QChart::ChartThemeQt) + { + // Series colors + m_seriesColors << QRgb(0x80c342); + m_seriesColors << QRgb(0x328930); + m_seriesColors << QRgb(0x006325); + m_seriesColors << QRgb(0x35322f); + m_seriesColors << QRgb(0x5d5b59); + m_seriesColors << QRgb(0x868482); + m_seriesColors << QRgb(0xaeadac); + m_seriesColors << QRgb(0xd7d6d5); + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background + QLinearGradient backgroundGradient(0.5, 0.0, 0.5, 1.0); + backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); + backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); + backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + m_chartBackgroundGradient = backgroundGradient; + + // Axes and other + m_labelBrush = QBrush(QRgb(0x35322f)); + m_axisLinePen = QPen(QRgb(0xd7d6d5)); + m_axisLinePen.setWidth(1); + m_gridLinePen = QPen(QRgb(0xd7d6d5)); + m_gridLinePen.setWidth(1); + m_backgroundShades = BackgroundShadesNone; + m_outlinePen = QPen(QRgb(0x35322f)); + m_outlinePen.setWidthF(2.0); + } +}; + +QT_CHARTS_END_NAMESPACE + +#endif diff --git a/src/charts/themes/chartthemesystem_p.h b/src/charts/themes/chartthemesystem_p.h new file mode 100644 index 00000000..8d99d5b1 --- /dev/null +++ b/src/charts/themes/chartthemesystem_p.h @@ -0,0 +1,177 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the Qt Enterprise Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef CHARTTHEMESYSTEM_P_H +#define CHARTTHEMESYSTEM_P_H + +#include "charttheme_p.h" +#ifdef Q_OS_WIN +#include <windows.h> +#include <stdio.h> +#endif + +QT_CHARTS_BEGIN_NAMESPACE + +class ChartThemeSystem: public ChartTheme +{ +public: + // System theme not used at the moment (the user is not able to select this theme) + ChartThemeSystem() : ChartTheme(QChart::ChartThemeLight /*QChart::ChartThemeSystem*/) + { +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) + // We could also use theme specific window frame color as a series base color (it would give more + // variation to the base colors in addition to the blue and black used now) + + // First series base color from COLOR_HIGHLIGHT + DWORD colorHighlight; + colorHighlight = GetSysColor(COLOR_HIGHLIGHT); + m_seriesColors.append(QColor(GetRValue(colorHighlight), + GetGValue(colorHighlight), + GetBValue(colorHighlight))); + + // Second series base color from COLOR_WINDOWFRAME + DWORD colorWindowFrame; + colorWindowFrame = GetSysColor(COLOR_WINDOWFRAME); + m_seriesColors.append(QColor(GetRValue(colorWindowFrame), + GetGValue(colorWindowFrame), + GetBValue(colorWindowFrame))); + + // Third series base color from the middle of the COLOR_ACTIVECAPTION / + // COLOR_GRADIENTACTIVECAPTION gradient + DWORD colorGradientActiveCaptionLeft; + colorGradientActiveCaptionLeft = GetSysColor(COLOR_ACTIVECAPTION); + DWORD colorGradientActiveCaptionRight; + colorGradientActiveCaptionRight = GetSysColor(COLOR_GRADIENTACTIVECAPTION); + QLinearGradient g; + QColor start = QColor(GetRValue(colorGradientActiveCaptionLeft), + GetGValue(colorGradientActiveCaptionLeft), + GetBValue(colorGradientActiveCaptionLeft)); + g.setColorAt(0.0, start); + QColor end = QColor(GetRValue(colorGradientActiveCaptionRight), + GetGValue(colorGradientActiveCaptionRight), + GetBValue(colorGradientActiveCaptionRight)); + g.setColorAt(1.0, end); + m_seriesColors.append(ChartThemeManager::colorAt(g, 0.5)); + + // Generate gradients from the base colors + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background fill color from COLOR_WINDOW + QLinearGradient backgroundGradient; + DWORD colorWindow; + colorWindow = GetSysColor(COLOR_WINDOW); + backgroundGradient.setColorAt(0.0, QColor(GetRValue(colorWindow), + GetGValue(colorWindow), + GetBValue(colorWindow))); + backgroundGradient.setColorAt(1.0, QColor(GetRValue(colorWindow), + GetGValue(colorWindow), + GetBValue(colorWindow))); + // Axes and other + m_axisLinePen = QPen(0xd6d6d6); + m_axisLinePen.setWidth(1); + m_labelBrush = QBrush(QRgb(0x404044)); + m_gridLinePen = QPen(QRgb(0xe2e2e2)); + m_gridLinePen.setWidth(1); + m_backgroundShades = BackgroundShadesNone; + +#elif defined(Q_OS_LINUX) + // Using a hard coded theme for Linux system theme + m_seriesColors << QRgb(0x60a6e6); + m_seriesColors << QRgb(0x92ca66); + m_seriesColors << QRgb(0xeba85f); + m_seriesColors << QRgb(0xfc5751); + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background + QLinearGradient backgroundGradient; + backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); + backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); + backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + m_chartBackgroundGradient = backgroundGradient; + + // Axes and other + m_axisLinePen = QPen(0xd6d6d6); + m_axisLinePen.setWidth(1); + m_labelBrush = QBrush(QRgb(0x404044)); + m_gridLinePen = QPen(QRgb(0xe2e2e2)); + m_gridLinePen.setWidth(1); + m_backgroundShades = BackgroundShadesNone; + +#elif defined(Q_OS_MAC) + // Using a hard coded theme for OSX system theme; the colors match the OSX 10.7 colors + m_seriesColors << QRgb(0x60a6e6); + m_seriesColors << QRgb(0x92ca66); + m_seriesColors << QRgb(0xeba85f); + m_seriesColors << QRgb(0xfc5751); + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background + QLinearGradient backgroundGradient; + backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); + backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); + backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + m_chartBackgroundGradient = backgroundGradient; + + // Axes and other + m_axisLinePen = QPen(0xd6d6d6); + m_axisLinePen.setWidth(1); + m_labelBrush = QBrush(QRgb(0x404044)); + m_gridLinePen = QPen(QRgb(0xe2e2e2)); + m_gridLinePen.setWidth(1); + m_backgroundShades = BackgroundShadesNone; + +#else + // Hard coded theme + m_seriesColors << QRgb(0x60a6e6); + m_seriesColors << QRgb(0x92ca66); + m_seriesColors << QRgb(0xeba85f); + m_seriesColors << QRgb(0xfc5751); + m_seriesGradients = ChartThemeManager::generateSeriesGradients(m_seriesColors); + + // Background + QLinearGradient backgroundGradient; + backgroundGradient.setColorAt(0.0, QRgb(0xffffff)); + backgroundGradient.setColorAt(1.0, QRgb(0xffffff)); + backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + m_chartBackgroundGradient = backgroundGradient; + + // Axes and other + m_axisLinePen = QPen(0xd6d6d6); + m_axisLinePen.setWidth(1); + m_labelBrush = QBrush(QRgb(0x404044)); + m_gridLinePen = QPen(QRgb(0xe2e2e2)); + m_gridLinePen.setWidth(1); + m_backgroundShades = BackgroundShadesNone; +#endif + } +}; + +QT_CHARTS_END_NAMESPACE + +#endif // CHARTTHEMESYSTEM_P_H diff --git a/src/charts/themes/themes.pri b/src/charts/themes/themes.pri new file mode 100644 index 00000000..656552af --- /dev/null +++ b/src/charts/themes/themes.pri @@ -0,0 +1,14 @@ +INCLUDEPATH += $$PWD +DEPENDPATH += $$PWD + +THEMES += \ + $$PWD/charttheme_p.h \ + $$PWD/chartthemesystem_p.h \ + $$PWD/chartthemelight_p.h \ + $$PWD/chartthemebluecerulean_p.h \ + $$PWD/chartthemedark_p.h \ + $$PWD/chartthemebrownsand_p.h \ + $$PWD/chartthemebluencs_p.h \ + $$PWD/chartthemehighcontrast_p.h \ + $$PWD/chartthemeblueicy_p.h \ + $$PWD/chartthemeqt_p.h |