Removed old themes

Task-number: QTRD-2319

Change-Id: I90e6add03fdca157fec6aa2398488982ab05d104
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
This commit is contained in:
Tomi Korpipää 2013-09-23 06:13:23 +03:00
parent d57aabe85e
commit 611dfce313
26 changed files with 42 additions and 328 deletions

View File

@ -43,7 +43,7 @@ AudioLevels::AudioLevels(Q3DBars *chart, QObject *parent)
m_graph->valueAxis()->setRange(0.0, 1.0);
m_graph->setShadowQuality(QDataVis::ShadowNone);
m_graph->setCameraPosition(-20.0, 10.0, 10);
m_graph->setTheme(QDataVis::ThemeHighContrast);
m_graph->setTheme(QDataVis::ThemeIsabelle);
QAudioFormat formatAudio;
formatAudio.setSampleRate(8000);

View File

@ -95,11 +95,11 @@ ChartDataGenerator::ChartDataGenerator(Q3DBars *barchart, QTableWidget *tableWid
#else
// Set selection mode to zoom row
m_chart->setSelectionMode(QDataVis::ModeSliceRow);
m_chart->setFont(QFont("Impact", 25));
m_chart->setFont(QFont("Impact", 20));
#endif
// Set theme
m_chart->setTheme(QDataVis::ThemeLight);
m_chart->setTheme(QDataVis::ThemeDigia);
// Set preset camera position
m_chart->setCameraPreset(QDataVis::PresetFront);

View File

@ -48,7 +48,8 @@ Item {
shadowQuality: Bars3D.ShadowMedium
selectionMode: Bars3D.ModeItem
font.pointSize: 35
theme: Bars3D.ThemeBrownSand
theme: Bars3D.ThemeRetro
labelTransparency: Bars3D.TransparencyFromTheme
dataProxy: chartData.proxy
barThickness: 0.5
barSpacing: Qt.size(0.5, 0.5)

View File

@ -41,7 +41,7 @@ Item {
font.family: "Lucida Handwriting"
font.pointSize: 40
dataProxy: chartData.proxy
theme: Scatter3D.ThemeHighContrast
theme: Scatter3D.ThemeIsabelle
shadowQuality: Scatter3D.ShadowSoftLow
selectionMode: Scatter3D.ModeItem
itemLabelFormat: "X:@xLabel Y:@yLabel Z:@zLabel"
@ -110,10 +110,10 @@ Item {
text: "Change Theme"
anchors.left: cameraToggle.right
onClicked: {
if (testscatter.theme === Scatter3D.ThemeBlueCerulean) {
testscatter.theme = Scatter3D.ThemeHighContrast;
if (testscatter.theme === Scatter3D.ThemeArmyBlue) {
testscatter.theme = Scatter3D.ThemeIsabelle;
} else {
testscatter.theme = Scatter3D.ThemeBlueCerulean;
testscatter.theme = Scatter3D.ThemeArmyBlue;
}
}
}

View File

@ -69,7 +69,7 @@ RainfallChart::RainfallChart(Q3DBars *rainfall)
m_chart->setSelectionMode(QDataVis::ModeSliceColumn);
// Set theme
m_chart->setTheme(QDataVis::ThemeBlueNcs);
m_chart->setTheme(QDataVis::ThemeArmyBlue);
// Set preset camera position
m_chart->setCameraPreset(QDataVis::PresetIsometricRightHigh);

View File

@ -53,14 +53,6 @@ int main(int argc, char **argv)
hLayout->addLayout(vLayout);
QComboBox *themeList = new QComboBox(widget);
themeList->addItem(QStringLiteral("System"));
themeList->addItem(QStringLiteral("Blue Cerulean"));
themeList->addItem(QStringLiteral("Blue Icy"));
themeList->addItem(QStringLiteral("Blue Ncs"));
themeList->addItem(QStringLiteral("Brown Sand"));
themeList->addItem(QStringLiteral("Dark"));
themeList->addItem(QStringLiteral("High Contrast"));
themeList->addItem(QStringLiteral("Light"));
themeList->addItem(QStringLiteral("Qt"));
themeList->addItem(QStringLiteral("Primary Colors"));
themeList->addItem(QStringLiteral("Digia"));
@ -69,7 +61,7 @@ int main(int argc, char **argv)
themeList->addItem(QStringLiteral("Retro"));
themeList->addItem(QStringLiteral("Ebony"));
themeList->addItem(QStringLiteral("Isabelle"));
themeList->setCurrentIndex(4);
themeList->setCurrentIndex(6);
QPushButton *labelButton = new QPushButton(widget);
labelButton->setText(QStringLiteral("Change label style"));

View File

@ -36,7 +36,7 @@ ScatterDataModifier::ScatterDataModifier(Q3DScatter *scatter)
font.setPointSize(m_fontSize);
m_chart->setFont(font);
m_chart->setObjectType(QDataVis::Spheres, true);
m_chart->setTheme(QDataVis::ThemeBrownSand);
m_chart->setTheme(QDataVis::ThemeEbony);
m_chart->setShadowQuality(QDataVis::ShadowHigh);
m_chart->setCameraPreset(QDataVis::PresetFront);
m_chart->setAxisX(new Q3DValueAxis);
@ -117,16 +117,6 @@ void ScatterDataModifier::changePresetCamera()
preset = QDataVis::PresetFrontLow;
}
void ScatterDataModifier::changeTheme()
{
static int theme = QDataVis::ThemeSystem;
m_chart->setTheme((QDataVis::ColorTheme)theme);
if (++theme > QDataVis::ThemeLight)
theme = QDataVis::ThemeSystem;
}
void ScatterDataModifier::changeTransparency()
{
static int transparency = QDataVis::TransparencyNone;

View File

@ -34,7 +34,6 @@ public:
void addData();
void changeStyle();
void changePresetCamera();
void changeTheme();
void changeTransparency();
void changeFont(const QFont &font);
void changeFontSize(int fontsize);

View File

@ -116,15 +116,15 @@ int main(int argc, char *argv[])
labelButton->setText(QStringLiteral("Change label style"));
QComboBox *themeList = new QComboBox(widget);
themeList->addItem(QStringLiteral("System"));
themeList->addItem(QStringLiteral("Blue Cerulean"));
themeList->addItem(QStringLiteral("Blue Icy"));
themeList->addItem(QStringLiteral("Blue Ncs"));
themeList->addItem(QStringLiteral("Brown Sand"));
themeList->addItem(QStringLiteral("Dark"));
themeList->addItem(QStringLiteral("High Contrast"));
themeList->addItem(QStringLiteral("Light"));
themeList->setCurrentIndex(4);
themeList->addItem(QStringLiteral("Qt"));
themeList->addItem(QStringLiteral("Primary Colors"));
themeList->addItem(QStringLiteral("Digia"));
themeList->addItem(QStringLiteral("Stone Moss"));
themeList->addItem(QStringLiteral("Army Blue"));
themeList->addItem(QStringLiteral("Retro"));
themeList->addItem(QStringLiteral("Ebony"));
themeList->addItem(QStringLiteral("Isabelle"));
themeList->setCurrentIndex(0);
QComboBox *shadowQuality = new QComboBox(widget);
shadowQuality->addItem(QStringLiteral("None"));

View File

@ -53,14 +53,6 @@ int main(int argc, char **argv)
hLayout->addLayout(vLayout);
QComboBox *themeList = new QComboBox(widget);
themeList->addItem(QStringLiteral("System"));
themeList->addItem(QStringLiteral("Blue Cerulean"));
themeList->addItem(QStringLiteral("Blue Icy"));
themeList->addItem(QStringLiteral("Blue Ncs"));
themeList->addItem(QStringLiteral("Brown Sand"));
themeList->addItem(QStringLiteral("Dark"));
themeList->addItem(QStringLiteral("High Contrast"));
themeList->addItem(QStringLiteral("Light"));
themeList->addItem(QStringLiteral("Qt"));
themeList->addItem(QStringLiteral("Primary Colors"));
themeList->addItem(QStringLiteral("Digia"));

View File

@ -59,7 +59,7 @@ Abstract3DController::Abstract3DController(QRect boundRect, QObject *parent) :
m_data(0),
m_renderPending(false)
{
m_theme.useColorTheme(QDataVis::ThemeSystem);
m_theme.useColorTheme(QDataVis::ThemeQt);
// Populate the scene
m_scene->activeLight()->setPosition(defaultLightPos);

View File

@ -432,7 +432,7 @@ void Q3DBars::setCameraPosition(qreal horizontal, qreal vertical, int distance)
}
/*!
* Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeSystem by
* Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeQt by
* default. Theme affects bar colors, label colors, text color, background color, window color and
* grid color. Lighting is also adjusted by themes.
*

View File

@ -341,7 +341,7 @@ void Q3DScatter::setCameraPosition(qreal horizontal, qreal vertical, int distanc
}
/*!
* Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeSystem by
* Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeQt by
* default. Theme affects bar colors, label colors, text color, background color, window color and
* grid color. Lighting is also adjusted by themes.
*

View File

@ -315,7 +315,7 @@ bool Q3DSurface::isBackgroundVisible() const
}
/*!
* Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeSystem by
* Sets a predefined \a theme from \c QDataVis::ColorTheme. It is preset to \c QDataVis::ThemeQt by
* default. Theme affects label colors, text color, background color, window color and
* grid color. Lighting is also adjusted by themes.
*

View File

@ -60,236 +60,6 @@ void Theme::useColorTheme(QDataVis::ColorTheme colorTheme)
{
m_colorTheme = colorTheme;
switch (colorTheme) {
case QDataVis::ThemeSystem: {
#ifdef Q_OS_WIN
DWORD colorHighlight;
colorHighlight = GetSysColor(COLOR_HIGHLIGHT);
m_baseColor = QColor(GetRValue(colorHighlight),
GetGValue(colorHighlight),
GetBValue(colorHighlight));
DWORD colorWindowFrame;
colorWindowFrame = GetSysColor(COLOR_WINDOWFRAME);
m_heightColor = QColor(GetRValue(colorWindowFrame),
GetGValue(colorWindowFrame),
GetBValue(colorWindowFrame));
m_depthColor = QColor(Qt::black);
DWORD colorWindow;
colorWindow = GetSysColor(COLOR_WINDOW);
m_backgroundColor = QColor(GetRValue(colorWindow),
GetGValue(colorWindow),
GetBValue(colorWindow));
m_windowColor = QColor(GetRValue(colorWindow),
GetGValue(colorWindow),
GetBValue(colorWindow));
m_textColor = QColor(QRgb(0x404044));
m_textBackgroundColor = QColor(0xd6, 0xd6, 0xd6, 0xa0);
m_gridLine = QColor(QRgb(0xe2e2e2));
m_highlightBarColor = QColor(QRgb(0xe2e2e2));
m_highlightRowColor = QColor(QRgb(0xf2f2f2));
m_highlightColumnColor = QColor(QRgb(0xf2f2f2));
m_lightStrength = 4.0f;
m_ambientStrength = 0.3f;
m_highlightLightStrength = 6.0f;
#elif defined(Q_OS_LINUX)
m_baseColor = QColor(QRgb(0x60a6e6));
m_heightColor = QColor(QRgb(0xfc5751));
m_depthColor = QColor(QRgb(0x92ca66));
m_backgroundColor = QColor(QRgb(0xffffff));
m_windowColor = QColor(QRgb(0xffffff));
m_textColor = QColor(QRgb(0x404044));
m_textBackgroundColor = QColor(0xd6, 0xd6, 0xd6, 0xa0);
m_gridLine = QColor(QRgb(0xe2e2e2));
m_highlightBarColor = QColor(QRgb(0xeba85f));
m_highlightRowColor = QColor(QRgb(0xfc5751));
m_highlightColumnColor = QColor(QRgb(0xfc5751));
m_lightStrength = 4.0f;
m_ambientStrength = 0.3f;
m_highlightLightStrength = 6.0f;
#elif defined(Q_OS_MAC)
m_baseColor = QColor(QRgb(0x60a6e6));
m_heightColor = QColor(QRgb(0xfc5751));
m_depthColor = QColor(QRgb(0x92ca66));
m_backgroundColor = QColor(QRgb(0xffffff));
m_windowColor = QColor(QRgb(0xffffff));
m_textColor = QColor(QRgb(0x404044));
m_textBackgroundColor = QColor(0xd6, 0xd6, 0xd6, 0xa0);
m_gridLine = QColor(QRgb(0xe2e2e2));
m_highlightBarColor = QColor(QRgb(0xeba85f));
m_highlightRowColor = QColor(QRgb(0xfc5751));
m_highlightColumnColor = QColor(QRgb(0xfc5751));
m_lightStrength = 4.0f;
m_ambientStrength = 0.3f;
m_highlightLightStrength = 6.0f;
#else
m_baseColor = QColor(QRgb(0x60a6e6));
m_heightColor = QColor(QRgb(0xfc5751));
m_depthColor = QColor(QRgb(0x92ca66));
m_backgroundColor = QColor(QRgb(0xffffff));
m_windowColor = QColor(QRgb(0xffffff));
m_textColor = QColor(QRgb(0x404044));
m_textBackgroundColor = QColor(0xd6, 0xd6, 0xd6, 0xa0);
m_gridLine = QColor(QRgb(0xe2e2e2));
m_highlightBarColor = QColor(QRgb(0xeba85f));
m_highlightRowColor = QColor(QRgb(0xfc5751));
m_highlightColumnColor = QColor(QRgb(0xfc5751));
m_lightStrength = 4.0f;
m_ambientStrength = 0.3f;
m_highlightLightStrength = 6.0f;
#endif
m_uniformColor = true;
m_labelBorders = true;
break;
}
case QDataVis::ThemeBlueCerulean: {
m_baseColor = QColor(QRgb(0xc7e85b));
m_heightColor = QColor(QRgb(0xee7392));
m_depthColor = QColor(QRgb(0x1cb54f));
m_backgroundColor = QColor(QRgb(0x056189));
m_windowColor = QColor(QRgb(0x101a31));
m_textColor = QColor(QRgb(0xffffff));
m_textBackgroundColor = QColor(0x05, 0x61, 0x89, 0xa0);
m_gridLine = QColor(QRgb(0xee7392));
//m_gridLine = QColor(QRgb(0x84a2b0));
m_highlightBarColor = QColor(QRgb(0x5cbf9b));
m_highlightRowColor = QColor(QRgb(0x009fbf));
m_highlightColumnColor = QColor(QRgb(0x009fbf));
m_lightStrength = 5.0f;
m_ambientStrength = 0.2f;
m_highlightLightStrength = 10.0f;
m_uniformColor = true;
m_labelBorders = false;
break;
}
case QDataVis::ThemeBlueIcy: {
m_baseColor = QRgb(0x3daeda);
m_heightColor = QRgb(0x2fa3b4);
m_depthColor = QColor(QRgb(0x2685bf));
m_backgroundColor = QColor(QRgb(0x2fa3b4));
//m_backgroundColor = QColor(QRgb(0xffffff));
m_windowColor = QColor(QRgb(0xffffff));
m_textColor = QColor(QRgb(0x404044));
m_textBackgroundColor = QColor(0x26, 0x85, 0xbf, 0xa0);
//m_textBackgroundColor = QColor(0xff, 0xff, 0xff, 0x80);
m_gridLine = QColor(QRgb(0x2685bf));
//m_gridLine = QColor(QRgb(0xe2e2e2));
m_highlightBarColor = QColor(QRgb(0x0c2673));
m_highlightRowColor = QColor(QRgb(0x5f3dba));
m_highlightColumnColor = QColor(QRgb(0x5f3dba));
m_lightStrength = 5.0f;
m_ambientStrength = 0.3f;
m_highlightLightStrength = 8.0f;
m_uniformColor = true;
m_labelBorders = false;
break;
}
case QDataVis::ThemeBlueNcs: {
m_baseColor = QColor(QRgb(0x1db0da));
m_heightColor = QColor(QRgb(0x398ca3));
m_depthColor = QColor(QRgb(0x1341a6));
m_backgroundColor = QColor(QRgb(0x398ca3));
//m_backgroundColor = QColor(QRgb(0xffffff));
m_windowColor = QColor(QRgb(0xffffff));
m_textColor = QColor(QRgb(0x404044));
m_textBackgroundColor = QColor(0x1d, 0xb0, 0xda, 0xa0);
//m_textBackgroundColor = QColor(0xff, 0xff, 0xff, 0x80);
m_gridLine = QColor(QRgb(0x1341a6));
//m_gridLine = QColor(QRgb(0xe2e2e2));
m_highlightBarColor = QColor(QRgb(0x88d41e));
m_highlightRowColor = QColor(QRgb(0xff8e1a));
m_highlightColumnColor = QColor(QRgb(0xff8e1a));
m_lightStrength = 4.0f;
m_ambientStrength = 0.2f;
m_highlightLightStrength = 6.0f;
m_uniformColor = true;
m_labelBorders = false;
break;
}
case QDataVis::ThemeBrownSand: {
m_baseColor = QColor(QRgb(0xb39b72));
m_heightColor = QColor(QRgb(0x494345));
m_depthColor = QColor(QRgb(0xb3b376));
m_backgroundColor = QColor(QRgb(0x494345));
//m_backgroundColor = QColor(QRgb(0xf3ece0));
m_windowColor = QColor(QRgb(0xf3ece0));
m_textColor = QColor(QRgb(0x404044));
m_textBackgroundColor = QColor(0xb5, 0xb0, 0xa7, 0xa0);
m_gridLine = QColor(QRgb(0xb3b376));
//m_gridLine = QColor(QRgb(0xd4cec3));
m_highlightBarColor = QColor(QRgb(0xc35660));
m_highlightRowColor = QColor(QRgb(0x536780));
m_highlightColumnColor = QColor(QRgb(0x536780));
m_lightStrength = 6.0f;
m_ambientStrength = 0.3f;
m_highlightLightStrength = 8.0f;
m_uniformColor = false;
m_labelBorders = false;
break;
}
case QDataVis::ThemeDark: {
m_baseColor = QColor(QRgb(0x38ad6b)); // charts: series color 1
m_heightColor = QColor(QRgb(0xbf593e)); // charts: series color 5
m_depthColor = QColor(QRgb(0x3c84a7)); // charts: series color 2
m_backgroundColor = QColor(QRgb(0x2e303a)); // charts: background color 1
m_windowColor = QColor(QRgb(0x121218)); // charts: background color 2
m_textColor = QColor(QRgb(0xffffff)); // charts: label color
m_textBackgroundColor = QColor(0x86, 0x87, 0x8c, 0xa0); // charts: axis line pen OR background color 2
m_gridLine = QColor(QRgb(0xbf593e)); // charts: grid line color
//m_gridLine = QColor(QRgb(0x86878c)); // charts: grid line color
m_highlightBarColor = QColor(QRgb(0xeb8817)); // charts: series color 3
m_highlightRowColor = QColor(QRgb(0x7b7f8c)); // charts: series color 4
m_highlightColumnColor = QColor(QRgb(0x7b7f8c)); // charts: series color 4
m_lightStrength = 6.0f;
m_ambientStrength = 0.2f;
m_highlightLightStrength = 8.0f;
m_uniformColor = false;
m_labelBorders = true;
break;
}
case QDataVis::ThemeHighContrast: {
m_baseColor = QColor(QRgb(0xff4a41));
m_heightColor = QColor(QRgb(0x202020));
m_depthColor = QColor(QRgb(0x596a74));
m_backgroundColor = QColor(QRgb(0x596a74));
//m_backgroundColor = QColor(QRgb(0xffffff));
m_windowColor = QColor(QRgb(0x000000));
m_textColor = QColor(QRgb(0xffffff));
m_textBackgroundColor = QColor(0x20, 0x20, 0x20, 0xa0);
//m_textColor = QColor(QRgb(0x181818));
//m_textBackgroundColor = QColor(0xff, 0xff, 0xff, 0xa0);
m_gridLine = QColor(QRgb(0xffab03));
//m_gridLine = QColor(QRgb(0x8c8c8c));
m_highlightBarColor = QColor(QRgb(0xffab03));
m_highlightRowColor = QColor(QRgb(0x038e9b));
m_highlightColumnColor = QColor(QRgb(0x038e9b));
m_lightStrength = 8.0f;
m_ambientStrength = 0.3f;
m_highlightLightStrength = 10.0f;
m_uniformColor = false;
m_labelBorders = true;
break;
}
case QDataVis::ThemeLight: {
m_baseColor = QColor(QRgb(0x209fdf));
m_heightColor = QColor(QRgb(0xbf593e));
m_depthColor = QColor(QRgb(0x99ca53));
m_backgroundColor = QColor(QRgb(0x99ca53));
//m_backgroundColor = QColor(QRgb(0xffffff));
m_windowColor = QColor(QRgb(0xffffff));
m_textColor = QColor(QRgb(0x404044));
m_textBackgroundColor = QColor(0xf6, 0xa6, 0x25, 0xa0);
//m_textBackgroundColor = QColor(0xd6, 0xd6, 0xd6, 0xa0);
m_gridLine = QColor(QRgb(0x99ca53));
//m_gridLine = QColor(QRgb(0xe2e2e2));
m_highlightBarColor = QColor(QRgb(0xf6a625));
m_highlightRowColor = QColor(QRgb(0x6d5fd5));
m_highlightColumnColor = QColor(QRgb(0x6d5fd5));
m_lightStrength = 6.0f;
m_ambientStrength = 0.3f;
m_highlightLightStrength = 7.0f;
m_uniformColor = true;
m_labelBorders = false;
break;
}
case QDataVis::ThemeQt: {
m_baseColor = QColor(QRgb(0x80c342));
//m_heightColor = QColor(QRgb(0x));

View File

@ -37,7 +37,7 @@ class QColor;
QT_DATAVISUALIZATION_BEGIN_NAMESPACE
class Theme
class QT_DATAVISUALIZATION_EXPORT Theme
{
public:
explicit Theme();

View File

@ -85,14 +85,6 @@ public:
enum ColorTheme {
ThemeDefault = -1,
ThemeSystem = 0,
ThemeBlueCerulean,
ThemeBlueIcy,
ThemeBlueNcs,
ThemeBrownSand,
ThemeDark,
ThemeHighContrast,
ThemeLight,
ThemeQt,
ThemePrimaryColors,
ThemeDigia,

View File

@ -105,14 +105,6 @@
\value ThemeDefault
Used only in QML to indicate a theme has not been set.
\value ThemeSystem
\value ThemeBlueCerulean
\value ThemeBlueIcy
\value ThemeBlueNcs
\value ThemeBrownSand
\value ThemeDark
\value ThemeHighContrast
\value ThemeLight
\value ThemeQt
\value ThemePrimaryColors
\value ThemeDigia

View File

@ -20,6 +20,7 @@
#include "declarativebarsrenderer_p.h"
#include "q3dvalueaxis.h"
#include "qitemmodelbardataproxy.h"
#include "theme_p.h"
QT_DATAVISUALIZATION_BEGIN_NAMESPACE
@ -28,8 +29,7 @@ const QString smoothString(QStringLiteral("Smooth"));
DeclarativeBars::DeclarativeBars(QQuickItem *parent)
: QQuickItem(parent),
m_shared(0),
m_initialisedSize(0, 0),
m_theme(QDataVis::ThemeDefault)
m_initialisedSize(0, 0)
{
setFlags(QQuickItem::ItemHasContents);
setAcceptedMouseButtons(Qt::AllButtons);
@ -224,14 +224,12 @@ QDataVis::CameraPreset DeclarativeBars::cameraPreset()
void DeclarativeBars::setTheme(QDataVis::ColorTheme theme)
{
// TODO: Implement correctly once "user-modifiable themes" (QTRD-2120) is implemented
// We need to save this locally, as there are no getters for it in controller
m_theme = theme;
m_shared->setColorTheme(theme);
}
QDataVis::ColorTheme DeclarativeBars::theme()
{
return m_theme;
return m_shared->theme().colorTheme();
}
void DeclarativeBars::setFont(const QFont &font)

View File

@ -182,7 +182,6 @@ protected:
private:
QSize m_initialisedSize;
QDataVis::ColorTheme m_theme;
};
QT_DATAVISUALIZATION_END_NAMESPACE

View File

@ -19,6 +19,7 @@
#include "declarativescatter_p.h"
#include "declarativescatterrenderer_p.h"
#include "qitemmodelscatterdataproxy.h"
#include "theme_p.h"
QT_DATAVISUALIZATION_BEGIN_NAMESPACE
@ -27,8 +28,7 @@ const QString smoothString(QStringLiteral("Smooth"));
DeclarativeScatter::DeclarativeScatter(QQuickItem *parent)
: QQuickItem(parent),
m_shared(0),
m_initialisedSize(0, 0),
m_theme(QDataVis::ThemeDefault)
m_initialisedSize(0, 0)
{
setFlags(QQuickItem::ItemHasContents);
setAcceptedMouseButtons(Qt::AllButtons);
@ -189,19 +189,12 @@ QDataVis::CameraPreset DeclarativeScatter::cameraPreset()
void DeclarativeScatter::setTheme(QDataVis::ColorTheme theme)
{
// TODO: Implement correctly once "user-modifiable themes" (QTRD-2120) is implemented
// We need to save this locally, as there are no getters for it in controller
m_theme = theme;
m_shared->setColorTheme(theme);
// TODO: Investigate why the beforeSynchronizing() signal requires update and is not sent automatically when this value changes,
// but is sent wen e.g. enable/disable background changes.
update();
}
QDataVis::ColorTheme DeclarativeScatter::theme()
{
return m_theme;
return m_shared->theme().colorTheme();
}
void DeclarativeScatter::setFont(const QFont &font)

View File

@ -157,7 +157,6 @@ protected:
private:
QSize m_initialisedSize;
QDataVis::ColorTheme m_theme;
};
QT_DATAVISUALIZATION_END_NAMESPACE

View File

@ -20,14 +20,14 @@
#include "declarativesurfacerenderer_p.h"
#include "q3dvalueaxis.h"
#include "qitemmodelsurfacedataproxy.h"
#include "theme_p.h"
QT_DATAVISUALIZATION_BEGIN_NAMESPACE
DeclarativeSurface::DeclarativeSurface(QQuickItem *parent)
: QQuickItem(parent),
m_shared(0),
m_initialisedSize(0, 0),
m_theme(QDataVis::ThemeDefault)
m_initialisedSize(0, 0)
{
setFlags(QQuickItem::ItemHasContents);
setAcceptedMouseButtons(Qt::AllButtons);
@ -137,14 +137,12 @@ void DeclarativeSurface::setAxisZ(Q3DValueAxis *axis)
void DeclarativeSurface::setTheme(QDataVis::ColorTheme theme)
{
// TODO: Implement correctly once "user-modifiable themes" (QTRD-2120) is implemented
// We need to save this locally, as there are no getters for it in controller
m_theme = theme;
m_shared->setColorTheme(theme);
}
QDataVis::ColorTheme DeclarativeSurface::theme()
{
return m_theme;
return m_shared->theme().colorTheme();
}
void DeclarativeSurface::setFont(const QFont &font)

View File

@ -147,7 +147,6 @@ protected:
private:
QSize m_initialisedSize;
QDataVis::ColorTheme m_theme;
};
QT_DATAVISUALIZATION_END_NAMESPACE

View File

@ -453,12 +453,12 @@ void ChartModifier::changePresetCamera()
void ChartModifier::changeTheme()
{
static int theme = QDataVis::ThemeSystem;
static int theme = QDataVis::ThemeQt;
m_chart->setTheme((QDataVis::ColorTheme)theme);
if (++theme > QDataVis::ThemeLight)
theme = QDataVis::ThemeSystem;
if (++theme > QDataVis::ThemeIsabelle)
theme = QDataVis::ThemeQt;
}
void ChartModifier::changeTransparency()

View File

@ -35,7 +35,7 @@ ScatterDataModifier::ScatterDataModifier(Q3DScatter *scatter)
font.setPointSize(m_fontSize);
m_chart->setFont(font);
m_chart->setObjectType(QDataVis::Spheres, true);
m_chart->setTheme(QDataVis::ThemeBrownSand);
m_chart->setTheme(QDataVis::ThemeStoneMoss);
m_chart->setShadowQuality(QDataVis::ShadowHigh);
m_chart->setCameraPreset(QDataVis::PresetFront);
m_chart->setAxisX(new Q3DValueAxis);
@ -125,12 +125,12 @@ void ScatterDataModifier::changePresetCamera()
void ScatterDataModifier::changeTheme()
{
static int theme = QDataVis::ThemeSystem;
static int theme = QDataVis::ThemeQt;
m_chart->setTheme((QDataVis::ColorTheme)theme);
if (++theme > QDataVis::ThemeLight)
theme = QDataVis::ThemeSystem;
if (++theme > QDataVis::ThemeIsabelle)
theme = QDataVis::ThemeQt;
}
void ScatterDataModifier::changeTransparency()