diff options
author | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-09-16 08:05:18 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-09-16 08:10:31 +0300 |
commit | 2f9fe2d24df97f1bffca578d6a97c9c7e603440c (patch) | |
tree | 0cfcfdaa70e219b5df82c19dc77f0b90925a04e0 | |
parent | 76c4cfa1693230c569fc34c0fb595de59d73a49d (diff) |
Theme draft
Task-number: QTRD-2277
Change-Id: I9d35587e0442c648073e533d5619da301d48af17
Change-Id: I9d35587e0442c648073e533d5619da301d48af17
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
-rw-r--r-- | examples/scatterchart/main.cpp | 8 | ||||
-rw-r--r-- | examples/widget/main.cpp | 8 | ||||
-rw-r--r-- | src/datavisualization/engine/bars3drenderer.cpp | 2 | ||||
-rw-r--r-- | src/datavisualization/engine/scatter3drenderer.cpp | 2 | ||||
-rw-r--r-- | src/datavisualization/engine/theme.cpp | 152 | ||||
-rw-r--r-- | src/datavisualization/global/qdatavisualizationenums.h | 10 | ||||
-rw-r--r-- | src/datavisualization/global/qtdatavisualizationenums.qdoc | 10 |
7 files changed, 180 insertions, 12 deletions
diff --git a/examples/scatterchart/main.cpp b/examples/scatterchart/main.cpp index 635ea0a5..8b18f5d4 100644 --- a/examples/scatterchart/main.cpp +++ b/examples/scatterchart/main.cpp @@ -61,6 +61,14 @@ int main(int argc, char **argv) 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")); + themeList->addItem(QStringLiteral("Stone Moss")); + themeList->addItem(QStringLiteral("Army Blue")); + themeList->addItem(QStringLiteral("Retro")); + themeList->addItem(QStringLiteral("Ebony")); + themeList->addItem(QStringLiteral("Isabelle")); themeList->setCurrentIndex(4); QPushButton *labelButton = new QPushButton(widget); diff --git a/examples/widget/main.cpp b/examples/widget/main.cpp index 3c369063..de2776fd 100644 --- a/examples/widget/main.cpp +++ b/examples/widget/main.cpp @@ -61,6 +61,14 @@ int main(int argc, char **argv) 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")); + 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); QPushButton *labelButton = new QPushButton(widget); diff --git a/src/datavisualization/engine/bars3drenderer.cpp b/src/datavisualization/engine/bars3drenderer.cpp index eb8b3a6d..a397647f 100644 --- a/src/datavisualization/engine/bars3drenderer.cpp +++ b/src/datavisualization/engine/bars3drenderer.cpp @@ -906,7 +906,7 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle) m_backgroundShader->setUniformValue(m_backgroundShader->MVP(), MVPMatrix); m_backgroundShader->setUniformValue(m_backgroundShader->color(), backgroundColor); m_backgroundShader->setUniformValue(m_backgroundShader->ambientS(), - m_cachedTheme.m_ambientStrength * 4.0f); + m_cachedTheme.m_ambientStrength * 2.0f); #if !defined(QT_OPENGL_ES_2) if (m_cachedShadowQuality > QDataVis::ShadowNone) { diff --git a/src/datavisualization/engine/scatter3drenderer.cpp b/src/datavisualization/engine/scatter3drenderer.cpp index a8c68fb1..eac165d7 100644 --- a/src/datavisualization/engine/scatter3drenderer.cpp +++ b/src/datavisualization/engine/scatter3drenderer.cpp @@ -611,7 +611,7 @@ void Scatter3DRenderer::drawScene(const GLuint defaultFboHandle) m_backgroundShader->setUniformValue(m_backgroundShader->MVP(), MVPMatrix); m_backgroundShader->setUniformValue(m_backgroundShader->color(), backgroundColor); m_backgroundShader->setUniformValue(m_backgroundShader->ambientS(), - m_cachedTheme.m_ambientStrength * 4.0f); + m_cachedTheme.m_ambientStrength * 2.0f); #if !defined(QT_OPENGL_ES_2) if (m_cachedShadowQuality > QDataVis::ShadowNone) { diff --git a/src/datavisualization/engine/theme.cpp b/src/datavisualization/engine/theme.cpp index a4404a34..89d6101e 100644 --- a/src/datavisualization/engine/theme.cpp +++ b/src/datavisualization/engine/theme.cpp @@ -142,7 +142,6 @@ void Theme::useColorTheme(QDataVis::ColorTheme colorTheme) m_highlightLightStrength = 6.0f; m_uniformColor = true; #endif - //qDebug("ThemeSystem"); break; } case QDataVis::ThemeBlueCerulean: { @@ -162,7 +161,6 @@ void Theme::useColorTheme(QDataVis::ColorTheme colorTheme) m_ambientStrength = 0.2f; m_highlightLightStrength = 10.0f; m_uniformColor = true; - //qDebug("ThemeBlueCerulean"); break; } case QDataVis::ThemeBlueIcy: { @@ -184,7 +182,6 @@ void Theme::useColorTheme(QDataVis::ColorTheme colorTheme) m_ambientStrength = 0.3f; m_highlightLightStrength = 8.0f; m_uniformColor = true; - //qDebug("ThemeBlueIcy"); break; } case QDataVis::ThemeBlueNcs: { @@ -206,7 +203,6 @@ void Theme::useColorTheme(QDataVis::ColorTheme colorTheme) m_ambientStrength = 0.2f; m_highlightLightStrength = 6.0f; m_uniformColor = true; - //qDebug("ThemeBlueNcs"); break; } case QDataVis::ThemeBrownSand: { @@ -227,7 +223,6 @@ void Theme::useColorTheme(QDataVis::ColorTheme colorTheme) m_ambientStrength = 0.3f; m_highlightLightStrength = 8.0f; m_uniformColor = false; - //qDebug("ThemeBrownSand"); break; } case QDataVis::ThemeDark: { @@ -247,7 +242,6 @@ void Theme::useColorTheme(QDataVis::ColorTheme colorTheme) m_ambientStrength = 0.2f; m_highlightLightStrength = 8.0f; m_uniformColor = false; - //qDebug("ThemeDark"); break; } case QDataVis::ThemeHighContrast: { @@ -270,7 +264,6 @@ void Theme::useColorTheme(QDataVis::ColorTheme colorTheme) m_ambientStrength = 0.3f; m_highlightLightStrength = 10.0f; m_uniformColor = false; - //qDebug("ThemeHighContrast"); break; } case QDataVis::ThemeLight: { @@ -292,7 +285,150 @@ void Theme::useColorTheme(QDataVis::ColorTheme colorTheme) m_ambientStrength = 0.3f; m_highlightLightStrength = 7.0f; m_uniformColor = true; - //qDebug("ThemeLight"); + break; + } + case QDataVis::ThemeQt: { + m_baseColor = QColor(QRgb(0x80c342)); + //m_heightColor = QColor(QRgb(0x)); + //m_depthColor = QColor(QRgb(0x)); + m_backgroundColor = QColor(QRgb(0xffffff)); + m_windowColor = QColor(QRgb(0xffffff)); + m_textColor = QColor(QRgb(0x35322f)); + m_textBackgroundColor = QColor(0xff, 0xff, 0xff, 0x99); + m_gridLine = QColor(QRgb(0xd7d6d5)); + m_highlightBarColor = QColor(QRgb(0x14aaff)); + m_highlightRowColor = QColor(QRgb(0x6400aa)); + m_highlightColumnColor = QColor(QRgb(0x6400aa)); + m_lightStrength = 5.0f; + m_ambientStrength = 0.5f; + m_highlightLightStrength = 5.0f; + m_uniformColor = true; + break; + } + case QDataVis::ThemePrimaryColors: { + m_baseColor = QColor(QRgb(0xffe400)); + //m_heightColor = QColor(QRgb(0x)); + //m_depthColor = QColor(QRgb(0x)); + m_backgroundColor = QColor(QRgb(0xffffff)); + m_windowColor = QColor(QRgb(0xffffff)); + m_textColor = QColor(QRgb(0x000000)); + m_textBackgroundColor = QColor(0xff, 0xff, 0xff, 0x01); + m_gridLine = QColor(QRgb(0xd7d6d5)); + m_highlightBarColor = QColor(QRgb(0x27beee)); + m_highlightRowColor = QColor(QRgb(0xee1414)); + m_highlightColumnColor = QColor(QRgb(0xee1414)); + m_lightStrength = 5.0f; + m_ambientStrength = 0.5f; + m_highlightLightStrength = 5.0f; + m_uniformColor = true; + break; + } + case QDataVis::ThemeDigia: { + m_baseColor = QColor(QRgb(0xcccccc)); + //m_heightColor = QColor(QRgb(0x)); + //m_depthColor = QColor(QRgb(0x)); + m_backgroundColor = QColor(QRgb(0xffffff)); + m_windowColor = QColor(QRgb(0xffffff)); + m_textColor = QColor(QRgb(0x000000)); + m_textBackgroundColor = QColor(0xff, 0xff, 0xff, 0x80); + m_gridLine = QColor(QRgb(0xd7d6d5)); + m_highlightBarColor = QColor(QRgb(0xfa0000)); + m_highlightRowColor = QColor(QRgb(0x555555)); + m_highlightColumnColor = QColor(QRgb(0x555555)); + m_lightStrength = 5.0f; + m_ambientStrength = 0.5f; + m_highlightLightStrength = 5.0f; + m_uniformColor = true; + break; + } + case QDataVis::ThemeStoneMoss: { + m_baseColor = QColor(QRgb(0xbeb32b)); + //m_heightColor = QColor(QRgb(0x)); + //m_depthColor = QColor(QRgb(0x)); + m_backgroundColor = QColor(QRgb(0x4d4d4f)); + m_windowColor = QColor(QRgb(0x4d4d4f)); + m_textColor = QColor(QRgb(0xffffff)); + m_textBackgroundColor = QColor(0x4d, 0x4d, 0x4f, 0xcd); + m_gridLine = QColor(QRgb(0x3e3e40)); + m_highlightBarColor = QColor(QRgb(0xfbf6d6)); + m_highlightRowColor = QColor(QRgb(0x442f20)); + m_highlightColumnColor = QColor(QRgb(0x442f20)); + m_lightStrength = 5.0f; + m_ambientStrength = 0.5f; + m_highlightLightStrength = 5.0f; + m_uniformColor = true; + break; + } + case QDataVis::ThemeArmyBlue: { + m_baseColor = QColor(QRgb(0x495f76)); + //m_heightColor = QColor(QRgb(0x)); + //m_depthColor = QColor(QRgb(0x)); + m_backgroundColor = QColor(QRgb(0xd5d6d7)); + m_windowColor = QColor(QRgb(0xd5d6d7)); + m_textColor = QColor(QRgb(0x000000)); + m_textBackgroundColor = QColor(0xd5, 0xd6, 0xd7, 0xcd); + m_gridLine = QColor(QRgb(0xaeadac)); + m_highlightBarColor = QColor(QRgb(0x2aa2f9)); + m_highlightRowColor = QColor(QRgb(0x103753)); + m_highlightColumnColor = QColor(QRgb(0x103753)); + m_lightStrength = 5.0f; + m_ambientStrength = 0.5f; + m_highlightLightStrength = 5.0f; + m_uniformColor = true; + break; + } + case QDataVis::ThemeRetro: { + m_baseColor = QColor(QRgb(0x533b23)); + //m_heightColor = QColor(QRgb(0x)); + //m_depthColor = QColor(QRgb(0x)); + m_backgroundColor = QColor(QRgb(0xe9e2ce)); + m_windowColor = QColor(QRgb(0xe9e2ce)); + m_textColor = QColor(QRgb(0x000000)); + m_textBackgroundColor = QColor(0xe9, 0xe2, 0xce, 0xc0); + m_gridLine = QColor(QRgb(0xd0c0b0)); + m_highlightBarColor = QColor(QRgb(0x8ea317)); + m_highlightRowColor = QColor(QRgb(0xc25708)); + m_highlightColumnColor = QColor(QRgb(0xc25708)); + m_lightStrength = 5.0f; + m_ambientStrength = 0.5f; + m_highlightLightStrength = 5.0f; + m_uniformColor = true; + break; + } + case QDataVis::ThemeEbony: { + m_baseColor = QColor(QRgb(0xffffff)); + //m_heightColor = QColor(QRgb(0x)); + //m_depthColor = QColor(QRgb(0x)); + m_backgroundColor = QColor(QRgb(0x000000)); + m_windowColor = QColor(QRgb(0x000000)); + m_textColor = QColor(QRgb(0xaeadac)); + m_textBackgroundColor = QColor(0x00, 0x00, 0x00, 0xcd); + m_gridLine = QColor(QRgb(0x35322f)); + m_highlightBarColor = QColor(QRgb(0xf5dc0d)); + m_highlightRowColor = QColor(QRgb(0xd72222)); + m_highlightColumnColor = QColor(QRgb(0xd72222)); + m_lightStrength = 5.0f; + m_ambientStrength = 0.5f; + m_highlightLightStrength = 5.0f; + m_uniformColor = true; + break; + } + case QDataVis::ThemeIsabelle: { + m_baseColor = QColor(QRgb(0xf9d900)); + //m_heightColor = QColor(QRgb(0x)); + //m_depthColor = QColor(QRgb(0x)); + m_backgroundColor = QColor(QRgb(0x000000)); + m_windowColor = QColor(QRgb(0x000000)); + m_textColor = QColor(QRgb(0xaeadac)); + m_textBackgroundColor = QColor(0x00, 0x00, 0x00, 0xc0); + m_gridLine = QColor(QRgb(0x35322f)); + m_highlightBarColor = QColor(QRgb(0xfff7cc)); + m_highlightRowColor = QColor(QRgb(0xde0a0a)); + m_highlightColumnColor = QColor(QRgb(0xde0a0a)); + m_lightStrength = 5.0f; + m_ambientStrength = 0.5f; + m_highlightLightStrength = 5.0f; + m_uniformColor = true; break; } default: diff --git a/src/datavisualization/global/qdatavisualizationenums.h b/src/datavisualization/global/qdatavisualizationenums.h index c62f8c94..06365950 100644 --- a/src/datavisualization/global/qdatavisualizationenums.h +++ b/src/datavisualization/global/qdatavisualizationenums.h @@ -92,7 +92,15 @@ public: ThemeBrownSand, ThemeDark, ThemeHighContrast, - ThemeLight + ThemeLight, + ThemeQt, + ThemePrimaryColors, + ThemeDigia, + ThemeStoneMoss, + ThemeArmyBlue, + ThemeRetro, + ThemeEbony, + ThemeIsabelle }; enum SelectionMode { diff --git a/src/datavisualization/global/qtdatavisualizationenums.qdoc b/src/datavisualization/global/qtdatavisualizationenums.qdoc index a81b38f1..6304b85e 100644 --- a/src/datavisualization/global/qtdatavisualizationenums.qdoc +++ b/src/datavisualization/global/qtdatavisualizationenums.qdoc @@ -68,7 +68,7 @@ Predefined positions for camera. \value NoPreset - Used only in QML to indicate a preset has not been set. + Used to indicate a preset has not been set, or the scene has been rotated freely. \value PresetFrontLow \value PresetFront \value PresetFrontHigh @@ -113,6 +113,14 @@ \value ThemeDark \value ThemeHighContrast \value ThemeLight + \value ThemeQt + \value ThemePrimaryColors + \value ThemeDigia + \value ThemeStoneMoss + \value ThemeArmyBlue + \value ThemeRetro + \value ThemeEbony + \value ThemeIsabelle */ /*! |