##// END OF EJS Templates
Default theme background, removed extra themes
Tero Ahola -
r692:339ba14ee2ea
parent child
Show More
@@ -64,9 +64,7 public:
64 m_themeComboBox->addItem("Dark", QChart::ChartThemeDark);
64 m_themeComboBox->addItem("Dark", QChart::ChartThemeDark);
65 m_themeComboBox->addItem("Brown Sand", QChart::ChartThemeBrownSand);
65 m_themeComboBox->addItem("Brown Sand", QChart::ChartThemeBrownSand);
66 m_themeComboBox->addItem("Blue NCS", QChart::ChartThemeBlueNcs);
66 m_themeComboBox->addItem("Blue NCS", QChart::ChartThemeBlueNcs);
67 m_themeComboBox->addItem("Vanilla", QChart::ChartThemeVanilla);
68 m_themeComboBox->addItem("Icy", QChart::ChartThemeIcy);
67 m_themeComboBox->addItem("Icy", QChart::ChartThemeIcy);
69 m_themeComboBox->addItem("Grayscale", QChart::ChartThemeGrayscale);
70 m_themeComboBox->addItem("Scientific", QChart::ChartThemeScientific);
68 m_themeComboBox->addItem("Scientific", QChart::ChartThemeScientific);
71 connect(m_themeComboBox, SIGNAL(currentIndexChanged(int)), this ,SLOT(updateTheme()));
69 connect(m_themeComboBox, SIGNAL(currentIndexChanged(int)), this ,SLOT(updateTheme()));
72 QCheckBox *antialiasCheckBox = new QCheckBox("Anti aliasing");
70 QCheckBox *antialiasCheckBox = new QCheckBox("Anti aliasing");
@@ -308,9 +308,7 public:
308 m_themeComboBox->addItem("Dark", QChart::ChartThemeDark);
308 m_themeComboBox->addItem("Dark", QChart::ChartThemeDark);
309 m_themeComboBox->addItem("BrownSand", QChart::ChartThemeBrownSand);
309 m_themeComboBox->addItem("BrownSand", QChart::ChartThemeBrownSand);
310 m_themeComboBox->addItem("BlueNcs", QChart::ChartThemeBlueNcs);
310 m_themeComboBox->addItem("BlueNcs", QChart::ChartThemeBlueNcs);
311 m_themeComboBox->addItem("Vanilla", QChart::ChartThemeVanilla);
312 m_themeComboBox->addItem("Icy", QChart::ChartThemeIcy);
311 m_themeComboBox->addItem("Icy", QChart::ChartThemeIcy);
313 m_themeComboBox->addItem("Grayscale", QChart::ChartThemeGrayscale);
314 m_themeComboBox->addItem("Scientific", QChart::ChartThemeScientific);
312 m_themeComboBox->addItem("Scientific", QChart::ChartThemeScientific);
315
313
316 m_aaCheckBox = new QCheckBox();
314 m_aaCheckBox = new QCheckBox();
@@ -77,7 +77,7 int main(int argc, char *argv[])
77
77
78 DrilldownChart* drilldownChart = new DrilldownChart(&window);
78 DrilldownChart* drilldownChart = new DrilldownChart(&window);
79 drilldownChart->setRenderHint(QPainter::Antialiasing);
79 drilldownChart->setRenderHint(QPainter::Antialiasing);
80 drilldownChart->setChartTheme(QChart::ChartThemeVanilla);
80 drilldownChart->setChartTheme(QChart::ChartThemeLight);
81 drilldownChart->setAnimationOptions(QChart::AllAnimations);
81 drilldownChart->setAnimationOptions(QChart::AllAnimations);
82
82
83 QPieSeries* yearSeries = new QPieSeries(&window);
83 QPieSeries* yearSeries = new QPieSeries(&window);
@@ -23,9 +23,7 public:
23 ThemeDark,
23 ThemeDark,
24 ThemeBrownSand,
24 ThemeBrownSand,
25 ThemeBlueNcs,
25 ThemeBlueNcs,
26 ThemeVanilla,
27 ThemeIcy,
26 ThemeIcy,
28 ThemeGrayscale,
29 ThemeScientific
27 ThemeScientific
30 };
28 };
31 DeclarativeChart(QDeclarativeItem *parent = 0);
29 DeclarativeChart(QDeclarativeItem *parent = 0);
@@ -35,9 +35,7
35 #include "chartthemedark_p.h"
35 #include "chartthemedark_p.h"
36 #include "chartthemebrownsand_p.h"
36 #include "chartthemebrownsand_p.h"
37 #include "chartthemebluencs_p.h"
37 #include "chartthemebluencs_p.h"
38 #include "chartthemevanilla_p.h"
39 #include "chartthemeicy_p.h"
38 #include "chartthemeicy_p.h"
40 #include "chartthemegrayscale_p.h"
41 #include "chartthemescientific_p.h"
39 #include "chartthemescientific_p.h"
42
40
43 QTCOMMERCIALCHART_BEGIN_NAMESPACE
41 QTCOMMERCIALCHART_BEGIN_NAMESPACE
@@ -70,12 +68,8 ChartTheme* ChartTheme::createTheme(QChart::ChartTheme theme)
70 return new ChartThemeBrownSand();
68 return new ChartThemeBrownSand();
71 case QChart::ChartThemeBlueNcs:
69 case QChart::ChartThemeBlueNcs:
72 return new ChartThemeBlueNcs();
70 return new ChartThemeBlueNcs();
73 case QChart::ChartThemeVanilla:
74 return new ChartThemeVanilla();
75 case QChart::ChartThemeIcy:
71 case QChart::ChartThemeIcy:
76 return new ChartThemeIcy();
72 return new ChartThemeIcy();
77 case QChart::ChartThemeGrayscale:
78 return new ChartThemeGrayscale();
79 case QChart::ChartThemeScientific:
73 case QChart::ChartThemeScientific:
80 return new ChartThemeScientific();
74 return new ChartThemeScientific();
81 default:
75 default:
@@ -16,12 +16,13 QTCOMMERCIALCHART_BEGIN_NAMESPACE
16 This enum describes the theme used by the chart.
16 This enum describes the theme used by the chart.
17
17
18 \value ChartThemeDefault Follows the GUI style of the Operating System
18 \value ChartThemeDefault Follows the GUI style of the Operating System
19 \value ChartThemeVanilla
19 \value ChartThemeLight
20 \value ChartThemeBlueCerulean
21 \value ChartThemeDark
22 \value ChartThemeBrownSand
23 \value ChartThemeBlueNcs
20 \value ChartThemeIcy
24 \value ChartThemeIcy
21 \value ChartThemeGrayscale
22 \value ChartThemeScientific
25 \value ChartThemeScientific
23 \value ChartThemeBlueCerulean
24 \value ChartThemeLight
25 \value ChartThemeCount Not really a theme; the total count of themes.
26 \value ChartThemeCount Not really a theme; the total count of themes.
26 */
27 */
27
28
@@ -35,9 +35,7 public:
35 ChartThemeDark,
35 ChartThemeDark,
36 ChartThemeBrownSand,
36 ChartThemeBrownSand,
37 ChartThemeBlueNcs,
37 ChartThemeBlueNcs,
38 ChartThemeVanilla,
39 ChartThemeIcy,
38 ChartThemeIcy,
40 ChartThemeGrayscale,
41 ChartThemeScientific,
39 ChartThemeScientific,
42 ChartThemeCount
40 ChartThemeCount
43 };
41 };
@@ -52,9 +52,7 THEMES += themes/chartthemedefault_p.h \
52 themes/chartthemebrownsand_p.h \
52 themes/chartthemebrownsand_p.h \
53 themes/chartthemebluencs_p.h \
53 themes/chartthemebluencs_p.h \
54 themes/chartthemeicy_p.h \
54 themes/chartthemeicy_p.h \
55 themes/chartthemegrayscale_p.h \
55 themes/chartthemescientific_p.h
56 themes/chartthemescientific_p.h \
57 themes/chartthemevanilla_p.h
58
56
59 HEADERS += $$PUBLIC_HEADERS
57 HEADERS += $$PUBLIC_HEADERS
60 HEADERS += $$PRIVATE_HEADERS
58 HEADERS += $$PRIVATE_HEADERS
@@ -30,6 +30,7 public:
30 m_axisLabelBrush = QBrush(QRgb(0xffffff));
30 m_axisLabelBrush = QBrush(QRgb(0xffffff));
31 m_gridLinePen = QPen(QRgb(0x84a2b0));
31 m_gridLinePen = QPen(QRgb(0x84a2b0));
32 m_gridLinePen.setWidth(1);
32 m_gridLinePen.setWidth(1);
33 m_backgroundShades = BackgroundShadesNone;
33 }
34 }
34 };
35 };
35
36
@@ -30,6 +30,7 public:
30 m_axisLabelBrush = QBrush(QRgb(0x404044));
30 m_axisLabelBrush = QBrush(QRgb(0x404044));
31 m_gridLinePen = QPen(QRgb(0xe2e2e2));
31 m_gridLinePen = QPen(QRgb(0xe2e2e2));
32 m_gridLinePen.setWidth(1);
32 m_gridLinePen.setWidth(1);
33 m_backgroundShades = BackgroundShadesNone;
33 }
34 }
34 };
35 };
35
36
@@ -30,6 +30,7 public:
30 m_axisLabelBrush = QBrush(QRgb(0x404044));
30 m_axisLabelBrush = QBrush(QRgb(0x404044));
31 m_gridLinePen = QPen(QRgb(0xd4cec3));
31 m_gridLinePen = QPen(QRgb(0xd4cec3));
32 m_gridLinePen.setWidth(1);
32 m_gridLinePen.setWidth(1);
33 m_backgroundShades = BackgroundShadesNone;
33 }
34 }
34 };
35 };
35
36
@@ -30,6 +30,7 public:
30 m_axisLabelBrush = QBrush(QRgb(0xffffff));
30 m_axisLabelBrush = QBrush(QRgb(0xffffff));
31 m_gridLinePen = QPen(QRgb(0x86878c));
31 m_gridLinePen = QPen(QRgb(0x86878c));
32 m_gridLinePen.setWidth(1);
32 m_gridLinePen.setWidth(1);
33 m_backgroundShades = BackgroundShadesNone;
33 }
34 }
34 };
35 };
35
36
@@ -63,8 +63,13 public:
63 GetGValue(colorWindow),
63 GetGValue(colorWindow),
64 GetBValue(colorWindow)));
64 GetBValue(colorWindow)));
65 // Axes and other
65 // Axes and other
66 m_backgroundShadesBrush = QBrush(QColor(0xaf, 0xaf, 0xaf, 0x50));
66 m_masterFont = QFont("arial");
67 m_backgroundShades = BackgroundShadesVertical;
67 m_axisLinePen = QPen(0xd6d6d6);
68 m_axisLinePen.setWidth(1);
69 m_axisLabelBrush = QBrush(QRgb(0x404044));
70 m_gridLinePen = QPen(QRgb(0xe2e2e2));
71 m_gridLinePen.setWidth(1);
72 m_backgroundShades = BackgroundShadesNone;
68
73
69 #elif defined(Q_OS_LINUX)
74 #elif defined(Q_OS_LINUX)
70 // TODO: replace this dummy theme with linux specific theme
75 // TODO: replace this dummy theme with linux specific theme
@@ -74,15 +79,21 public:
74 m_seriesColors << QRgb(0xfc5751);
79 m_seriesColors << QRgb(0xfc5751);
75 generateSeriesGradients();
80 generateSeriesGradients();
76
81
82 // Background
77 QLinearGradient backgroundGradient;
83 QLinearGradient backgroundGradient;
78 backgroundGradient.setColorAt(0.0, QRgb(0xffffff));
84 backgroundGradient.setColorAt(0.0, QRgb(0xffffff));
79 backgroundGradient.setColorAt(1.0, QRgb(0xe9e9e9));
85 backgroundGradient.setColorAt(1.0, QRgb(0xffffff));
80 backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode);
86 backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode);
81 m_chartBackgroundGradient = backgroundGradient;
87 m_chartBackgroundGradient = backgroundGradient;
82
88
83 // Axes and other
89 // Axes and other
84 m_backgroundShadesBrush = QBrush(QColor(0xaf, 0xaf, 0xaf, 0x50));
90 m_masterFont = QFont("arial");
85 m_backgroundShades = BackgroundShadesVertical;
91 m_axisLinePen = QPen(0xd6d6d6);
92 m_axisLinePen.setWidth(1);
93 m_axisLabelBrush = QBrush(QRgb(0x404044));
94 m_gridLinePen = QPen(QRgb(0xe2e2e2));
95 m_gridLinePen.setWidth(1);
96 m_backgroundShades = BackgroundShadesNone;
86
97
87 #elif defined(Q_OS_MAC)
98 #elif defined(Q_OS_MAC)
88 // TODO: replace this dummy theme with OSX specific theme
99 // TODO: replace this dummy theme with OSX specific theme
@@ -92,15 +103,21 public:
92 m_seriesColors << QRgb(0xfc5751);
103 m_seriesColors << QRgb(0xfc5751);
93 generateSeriesGradients();
104 generateSeriesGradients();
94
105
106 // Background
95 QLinearGradient backgroundGradient;
107 QLinearGradient backgroundGradient;
96 backgroundGradient.setColorAt(0.0, QRgb(0xffffff));
108 backgroundGradient.setColorAt(0.0, QRgb(0xffffff));
97 backgroundGradient.setColorAt(1.0, QRgb(0xe9e9e9));
109 backgroundGradient.setColorAt(1.0, QRgb(0xffffff));
98 backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode);
110 backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode);
99 m_chartBackgroundGradient = backgroundGradient;
111 m_chartBackgroundGradient = backgroundGradient;
100
112
101 // Axes and other
113 // Axes and other
102 m_backgroundShadesBrush = QBrush(QColor(0xaf, 0xaf, 0xaf, 0x50));
114 m_masterFont = QFont("arial");
103 m_backgroundShades = BackgroundShadesVertical;
115 m_axisLinePen = QPen(0xd6d6d6);
116 m_axisLinePen.setWidth(1);
117 m_axisLabelBrush = QBrush(QRgb(0x404044));
118 m_gridLinePen = QPen(QRgb(0xe2e2e2));
119 m_gridLinePen.setWidth(1);
120 m_backgroundShades = BackgroundShadesNone;
104
121
105 #else
122 #else
106 // TODO: replace this dummy theme with generic (not OS specific) theme
123 // TODO: replace this dummy theme with generic (not OS specific) theme
@@ -110,15 +127,21 public:
110 m_seriesColors << QRgb(0xfc5751);
127 m_seriesColors << QRgb(0xfc5751);
111 generateSeriesGradients();
128 generateSeriesGradients();
112
129
130 // Background
113 QLinearGradient backgroundGradient;
131 QLinearGradient backgroundGradient;
114 backgroundGradient.setColorAt(0.0, QRgb(0xffffff));
132 backgroundGradient.setColorAt(0.0, QRgb(0xffffff));
115 backgroundGradient.setColorAt(1.0, QRgb(0xafafaf));
133 backgroundGradient.setColorAt(1.0, QRgb(0xffffff));
116 backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode);
134 backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode);
117 m_backgroundGradient = backgroundGradient;
135 m_chartBackgroundGradient = backgroundGradient;
118
136
119 // Axes and other
137 // Axes and other
120 m_backgroundShadesBrush = QBrush(QColor(0xaf, 0xaf, 0xaf, 0x50));
138 m_masterFont = QFont("arial");
121 m_backgroundShades = BackgroundShadesVertical;
139 m_axisLinePen = QPen(0xd6d6d6);
140 m_axisLinePen.setWidth(1);
141 m_axisLabelBrush = QBrush(QRgb(0x404044));
142 m_gridLinePen = QPen(QRgb(0xe2e2e2));
143 m_gridLinePen.setWidth(1);
144 m_backgroundShades = BackgroundShadesNone;
122 #endif
145 #endif
123 }
146 }
124 };
147 };
@@ -27,6 +27,7 public:
27 m_axisLabelBrush = QBrush(QRgb(0x3f3f3f));
27 m_axisLabelBrush = QBrush(QRgb(0x3f3f3f));
28 m_gridLinePen = QPen(QRgb(0x0f0f0f));
28 m_gridLinePen = QPen(QRgb(0x0f0f0f));
29 m_gridLinePen.setWidth(2);
29 m_gridLinePen.setWidth(2);
30 m_backgroundShades = BackgroundShadesNone;
30 }
31 }
31 };
32 };
32
33
@@ -29,6 +29,7 public:
29 m_axisLabelBrush = QBrush(QRgb(0x404044));
29 m_axisLabelBrush = QBrush(QRgb(0x404044));
30 m_gridLinePen = QPen(QRgb(0xe2e2e2));
30 m_gridLinePen = QPen(QRgb(0xe2e2e2));
31 m_gridLinePen.setWidth(1);
31 m_gridLinePen.setWidth(1);
32 m_backgroundShades = BackgroundShadesNone;
32 }
33 }
33 };
34 };
34
35
@@ -25,10 +25,10 public:
25 m_axisLinePen = QPen(QRgb(0x0f0f0f));
25 m_axisLinePen = QPen(QRgb(0x0f0f0f));
26 m_axisLinePen.setWidth(2);
26 m_axisLinePen.setWidth(2);
27 m_axisLabelBrush = QBrush(QRgb(0x3f3f3f));
27 m_axisLabelBrush = QBrush(QRgb(0x3f3f3f));
28 m_backgroundShadesBrush = QBrush(QColor(0xff, 0xad, 0x00, 0x50));
29 m_backgroundShades = BackgroundShadesHorizontal;
30 m_gridLinePen = QPen(QRgb(0x0f0f0f));
28 m_gridLinePen = QPen(QRgb(0x0f0f0f));
31 m_gridLinePen.setWidth(2);
29 m_gridLinePen.setWidth(2);
30 m_backgroundShadesBrush = QBrush(QColor(0xff, 0xad, 0x00, 0x50));
31 m_backgroundShades = BackgroundShadesHorizontal;
32 }
32 }
33 };
33 };
34
34
@@ -115,11 +115,13 void MainWidget::initThemeCombo(QGridLayout *grid)
115 {
115 {
116 QComboBox *chartTheme = new QComboBox();
116 QComboBox *chartTheme = new QComboBox();
117 chartTheme->addItem("Default");
117 chartTheme->addItem("Default");
118 chartTheme->addItem("Vanilla");
118 chartTheme->addItem("Light");
119 chartTheme->addItem("Blue Cerulean");
120 chartTheme->addItem("Dark");
121 chartTheme->addItem("Brown Sand");
122 chartTheme->addItem("Blue NCS");
119 chartTheme->addItem("Icy");
123 chartTheme->addItem("Icy");
120 chartTheme->addItem("Grayscale");
121 chartTheme->addItem("Scientific");
124 chartTheme->addItem("Scientific");
122 chartTheme->addItem("Unnamed1");
123 connect(chartTheme, SIGNAL(currentIndexChanged(int)),
125 connect(chartTheme, SIGNAL(currentIndexChanged(int)),
124 this, SLOT(changeChartTheme(int)));
126 this, SLOT(changeChartTheme(int)));
125 grid->addWidget(new QLabel("Chart theme:"), 8, 0);
127 grid->addWidget(new QLabel("Chart theme:"), 8, 0);
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now