Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QPalette QStyle::standardPalette (  )  const [virtual, inherited]

Returns the style's standard palette.

Note that on systems that support system colors, the style's standard palette is not used.

Reimplemented in QCDEStyle, QCleanlooksStyle, QMotifStyle, QPlastiqueStyle, QWindowsVistaStyle, and QWindowsXPStyle.

Definition at line 2099 of file qstyle.cpp.

References QX11Info::appDepth(), QColor::darker(), QColor::lighter(), and QPalette::setBrush().

Referenced by QCleanlooksStyle::standardPalette(), and QWindowsXPStyle::standardPalette().

{
#ifdef Q_WS_X11
    QColor background;
    if (QX11Info::appDepth() > 8)
        background = QColor(0xd4, 0xd0, 0xc8); // win 2000 grey
    else
        background = QColor(192, 192, 192);
#else
    QColor background(0xd4, 0xd0, 0xc8); // win 2000 grey
#endif
    QColor light(background.lighter());
    QColor dark(background.darker());
    QColor mid(Qt::gray);
    QPalette palette(Qt::black, background, light, dark, mid, Qt::black, Qt::white);
    palette.setBrush(QPalette::Disabled, QPalette::WindowText, dark);
    palette.setBrush(QPalette::Disabled, QPalette::Text, dark);
    palette.setBrush(QPalette::Disabled, QPalette::ButtonText, dark);
    palette.setBrush(QPalette::Disabled, QPalette::Base, background);
    return palette;
}


Generated by  Doxygen 1.6.0   Back to index