summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qpalette.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@digia.com>2013-04-08 14:12:43 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-17 07:43:11 +0200
commit3ae271523ff7fb951df16cfccfaf84c0aa298e16 (patch)
tree446402cb007ac348c67ea35b44baedb4f8c3681e /src/gui/kernel/qpalette.cpp
parentd42e54c8626ee0d42d4df40e8f2a83df0698190a (diff)
Move Fusion styles palette into QtGui
So that it can be used as the standard palette for QtGui applications instead of the absolutely useless black palette. Change-Id: Ie001439fcd8840a66275009c9f42cbf8bab4864a Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/gui/kernel/qpalette.cpp')
-rw-r--r--src/gui/kernel/qpalette.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index f15559981b..df3d4dfef0 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -1096,6 +1096,40 @@ void QPalette::setColorGroup(ColorGroup cg, const QBrush &foreground, const QBru
setBrush(cg, ToolTipText, toolTipText);
}
+Q_GUI_EXPORT QPalette qt_fusionPalette()
+{
+ QColor backGround(239, 235, 231);
+ QColor light = backGround.lighter(150);
+ QColor mid(backGround.darker(130));
+ QColor midLight = mid.lighter(110);
+ QColor base = Qt::white;
+ QColor disabledBase(backGround);
+ QColor dark = backGround.darker(150);
+ QColor darkDisabled = QColor(209, 200, 191).darker(110);
+ QColor text = Qt::black;
+ QColor hightlightedText = Qt::white;
+ QColor disabledText = QColor(190, 190, 190);
+ QColor button = backGround;
+ QColor shadow = dark.darker(135);
+ QColor disabledShadow = shadow.lighter(150);
+
+ QPalette fusionPalette(Qt::black,backGround,light,dark,mid,text,base);
+ fusionPalette.setBrush(QPalette::Midlight, midLight);
+ fusionPalette.setBrush(QPalette::Button, button);
+ fusionPalette.setBrush(QPalette::Shadow, shadow);
+ fusionPalette.setBrush(QPalette::HighlightedText, hightlightedText);
+
+ fusionPalette.setBrush(QPalette::Disabled, QPalette::Text, disabledText);
+ fusionPalette.setBrush(QPalette::Disabled, QPalette::Base, disabledBase);
+ fusionPalette.setBrush(QPalette::Disabled, QPalette::Dark, darkDisabled);
+ fusionPalette.setBrush(QPalette::Disabled, QPalette::Shadow, disabledShadow);
+
+ fusionPalette.setBrush(QPalette::Active, QPalette::Highlight, QColor(48, 140, 198));
+ fusionPalette.setBrush(QPalette::Inactive, QPalette::Highlight, QColor(145, 141, 126));
+ fusionPalette.setBrush(QPalette::Disabled, QPalette::Highlight, QColor(145, 141, 126));
+ return fusionPalette;
+}
+
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QPalette &)
{