Ignore:
Timestamp:
Nov 6, 2007, 11:27:57 PM (18 years ago)
Author:
dmik
Message:

Styles: Implemented the first version of the Warp4 style (contributed by Cornelis Bockemuehl).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel/qapplication_pm.cpp

    r171 r174  
    131131                           const QPixmap *, int, int, int );
    132132
     133Q_EXPORT
    133134QRgb qt_sysclr2qrgb( LONG sysClr )
    134135{
     
    139140}
    140141
    141 QFont qt_sysfont2qfont( const PSZ scope ) {
     142static
     143QFont qt_sysfont2qfont( const PSZ scope )
     144{
    142145    static const PSZ app = "PM_SystemFonts";
    143     static const PSZ def = "8.Helv";
     146    static const PSZ def = "10.System Proportional";
    144147    ULONG keyLen = 0;
    145     QFont f( "Helv", 8 );
     148    QFont f( "System Proportional", 10 );
    146149
    147150    if ( PrfQueryProfileSize( HINI_USERPROFILE, app, scope, &keyLen ) && keyLen ) {
     
    369372    // Do the font settings
    370373
     374#ifndef QT_PM_NO_DEFAULTFONT_OVERRIDE
    371375    QFont windowFont = qt_sysfont2qfont( "WindowText" );
     376#else
     377    QFont windowFont = qt_sysfont2qfont( "DefaultFont" );
     378#endif
    372379    QFont menuFont = qt_sysfont2qfont( "Menus" );
    373380    QFont iconFont = qt_sysfont2qfont( "IconText" );
     
    440447    *qt_std_pal = pal;
    441448
    442     // a special palette for menus
    443     acg.setColor( QColorGroup::Highlight,
     449    // special palettes
     450    QColorGroup scg;
     451
     452    // menus
     453    scg = acg;
     454    scg.setColor( QColorGroup::Background,
     455                  QColor( qt_sysclr2qrgb( SYSCLR_MENU ) ) );
     456    scg.setColor( QColorGroup::Highlight,
    444457                  QColor( qt_sysclr2qrgb( SYSCLR_MENUHILITEBGND ) ) );
    445     acg.setColor( QColorGroup::HighlightedText,
     458    scg.setColor( QColorGroup::HighlightedText,
    446459                  QColor( qt_sysclr2qrgb( SYSCLR_MENUHILITE ) ) );
    447     QApplication::setPalette( QPalette( acg, dcg, icg ), TRUE, "QPopupMenu");
    448     QApplication::setPalette( QPalette( acg, dcg, icg ), TRUE, "QMenuBar");
     460    pal.setActive( scg );
     461    pal.setInactive( scg );
     462    QApplication::setPalette( pal, TRUE, "QPopupMenu" );
     463    QApplication::setPalette( pal, TRUE, "QMenuBar" );
     464
     465    // static widget texts
     466    scg = acg;
     467    QColor staticTextCol( qt_sysclr2qrgb( SYSCLR_WINDOWSTATICTEXT ) );
     468    scg.setColor( QColorGroup::Foreground, staticTextCol );
     469    scg.setColor( QColorGroup::Text, staticTextCol );
     470    pal.setActive( scg );
     471    pal.setInactive( scg );
     472    QApplication::setPalette( pal, TRUE, "QLabel" );
     473    QApplication::setPalette( pal, TRUE, "QGroupBox" );
    449474}
    450475
     
    457482{
    458483public:
    459     static bool &installed() { return QtOS2SysXcptMainHandler::installed; } 
     484    static bool &installed() { return QtOS2SysXcptMainHandler::installed; }
    460485    static ERR &libcHandler() { return QtOS2SysXcptMainHandler::libcHandler; }
    461486    static ERR handler() { return QtOS2SysXcptMainHandler::handler; }
     
    486511    DosGetInfoBlocks( &ptib, NULL );
    487512    Q_ASSERT( ptib && ptib->tib_ptib2 );
    488    
     513
    489514    if ( ptib && ptib->tib_ptib2 ) {
    490         // must be called only on the main (first) thread 
     515        // must be called only on the main (first) thread
    491516        Q_ASSERT( ptib->tib_ptib2->tib2_ultid == 1 );
    492517        // also make sure that QtOS2SysXcptMainHandler was not already
     
    551576    // default font
    552577    if ( !qt_app_has_font )
    553         QApplication::setFont( QFont( "Helv", 8 ) );
     578        QApplication::setFont( QFont( "System Proportional", 10 ) );
    554579
    555580    // QFont::locale_init();  ### Uncomment when it does something on OS/2
     
    590615
    591616#if !defined(QT_OS2_NO_SYSEXCEPTIONS)
    592     // remove the exception handler if it was installed in qt_init() 
     617    // remove the exception handler if it was installed in qt_init()
    593618    PTIB ptib = NULL;
    594619    DosGetInfoBlocks( &ptib, NULL );
    595620    Q_ASSERT( ptib && ptib->tib_ptib2 );
    596    
     621
    597622    if ( ptib && ptib->tib_ptib2 ) {
    598         // must be called only on the main (first) thread 
     623        // must be called only on the main (first) thread
    599624        Q_ASSERT( ptib->tib_ptib2->tib2_ultid == 1 );
    600625        // also make sure the handler was really installed by qt_init()
     
    10031028enum {
    10041029    // some undocumented messages (they have the WM_U_ prefix for clarity)
    1005    
     1030
    10061031    // sent to hwnd that has been entered to by a mouse pointer.
    10071032    // FID_CLIENT also receives enter messages of its WC_FRAME.
     
    20642089        return;
    20652090    }
    2066    
     2091
    20672092    // find the modal's group leader
    20682093    QWidget *mgl = modal->parentWidget();
     
    25482573#endif
    25492574        if ( curWin != winId() ) {              // new current window
    2550 /// @todo (dmik)           
     2575/// @todo (dmik)
    25512576//  add CS_HITTEST to our window classes and handle WM_HITTEST,
    25522577//  otherwise disabled windows will not get mouse events?
     
    27642789//  Alt+letter shortcuts in the NLS keyboard mode together with Alt+NLS_letter
    27652790//  shortcuts  (nice feature imho). Note that Alt+NLS_letter shortcuts are
    2766 //  correctly processed in any case. 
     2791//  correctly processed in any case.
    27672792
    27682793// cache table to store Qt::Key_... values for 256 hardware scancodes
Note: See TracChangeset for help on using the changeset viewer.