From 3ae271523ff7fb951df16cfccfaf84c0aa298e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 8 Apr 2013 14:12:43 +0200 Subject: 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 --- src/gui/kernel/qpalette.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/gui/kernel/qpalette.cpp') 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 &) { -- cgit v1.2.3