void QTitleBar::readColors() { QPalette pal = palette(); bool colorsInitialized = FALSE; #ifdef Q_WS_WIN // ask system properties on windows #ifndef SPI_GETGRADIENTCAPTIONS #define SPI_GETGRADIENTCAPTIONS 0x1008 #endif #ifndef COLOR_GRADIENTACTIVECAPTION #define COLOR_GRADIENTACTIVECAPTION 27 #endif #ifndef COLOR_GRADIENTINACTIVECAPTION #define COLOR_GRADIENTINACTIVECAPTION 28 #endif if ( QApplication::desktopSettingsAware() ) { pal.setColor( QPalette::Active, QColorGroup::Highlight, qt_colorref2qrgb(GetSysColor(COLOR_ACTIVECAPTION)) ); pal.setColor( QPalette::Inactive, QColorGroup::Highlight, qt_colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTION)) ); pal.setColor( QPalette::Active, QColorGroup::HighlightedText, qt_colorref2qrgb(GetSysColor(COLOR_CAPTIONTEXT)) ); pal.setColor( QPalette::Inactive, QColorGroup::HighlightedText, qt_colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTIONTEXT)) ); if ( qt_winver != Qt::WV_95 && qt_winver != WV_NT ) { colorsInitialized = TRUE; BOOL gradient; QT_WA( { SystemParametersInfo( SPI_GETGRADIENTCAPTIONS, 0, &gradient, 0 ); } , { SystemParametersInfoA( SPI_GETGRADIENTCAPTIONS, 0, &gradient, 0 ); } );
QColor KGlobalSettings::activeTextColor() { #ifdef Q_WS_WIN return qt_colorref2qrgb(GetSysColor(COLOR_CAPTIONTEXT)); #else KConfigGroup g( KGlobal::config(), "WM" ); return g.readColorEntry( "activeForeground", &Qt::white ); #endif }
QColor KGlobalSettings::inactiveTextColor() { #ifdef Q_WS_WIN return qt_colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTIONTEXT)); #else if (!_inactiveForeground) _inactiveForeground = new QColor(221,221,221); KConfigGroup g( KGlobal::config(), "WM" ); return g.readColorEntry( "inactiveForeground", _inactiveForeground ); #endif }
QColor KGlobalSettings::inactiveTitleColor() { #ifdef Q_WS_WIN return qt_colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTION)); #else if (!_inactiveBackground) _inactiveBackground = new QColor(157, 170, 186); KConfigGroup g( KGlobal::config(), "WM" ); return g.readColorEntry( "inactiveBackground", _inactiveBackground ); #endif }
QColor KGlobalSettings::activeTitleColor() { #ifdef Q_WS_WIN return qt_colorref2qrgb(GetSysColor(COLOR_ACTIVECAPTION)); #else initColors(); if (!_activeBackground) _activeBackground = new QColor(65,142,220); KConfigGroup g( KGlobal::config(), "WM" ); return g.readColorEntry( "activeBackground", _activeBackground); #endif }