Changeset 174 for trunk/src/kernel/qapplication_pm.cpp
- Timestamp:
- Nov 6, 2007, 11:27:57 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel/qapplication_pm.cpp
r171 r174 131 131 const QPixmap *, int, int, int ); 132 132 133 Q_EXPORT 133 134 QRgb qt_sysclr2qrgb( LONG sysClr ) 134 135 { … … 139 140 } 140 141 141 QFont qt_sysfont2qfont( const PSZ scope ) { 142 static 143 QFont qt_sysfont2qfont( const PSZ scope ) 144 { 142 145 static const PSZ app = "PM_SystemFonts"; 143 static const PSZ def = " 8.Helv";146 static const PSZ def = "10.System Proportional"; 144 147 ULONG keyLen = 0; 145 QFont f( " Helv", 8);148 QFont f( "System Proportional", 10 ); 146 149 147 150 if ( PrfQueryProfileSize( HINI_USERPROFILE, app, scope, &keyLen ) && keyLen ) { … … 369 372 // Do the font settings 370 373 374 #ifndef QT_PM_NO_DEFAULTFONT_OVERRIDE 371 375 QFont windowFont = qt_sysfont2qfont( "WindowText" ); 376 #else 377 QFont windowFont = qt_sysfont2qfont( "DefaultFont" ); 378 #endif 372 379 QFont menuFont = qt_sysfont2qfont( "Menus" ); 373 380 QFont iconFont = qt_sysfont2qfont( "IconText" ); … … 440 447 *qt_std_pal = pal; 441 448 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, 444 457 QColor( qt_sysclr2qrgb( SYSCLR_MENUHILITEBGND ) ) ); 445 acg.setColor( QColorGroup::HighlightedText,458 scg.setColor( QColorGroup::HighlightedText, 446 459 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" ); 449 474 } 450 475 … … 457 482 { 458 483 public: 459 static bool &installed() { return QtOS2SysXcptMainHandler::installed; } 484 static bool &installed() { return QtOS2SysXcptMainHandler::installed; } 460 485 static ERR &libcHandler() { return QtOS2SysXcptMainHandler::libcHandler; } 461 486 static ERR handler() { return QtOS2SysXcptMainHandler::handler; } … … 486 511 DosGetInfoBlocks( &ptib, NULL ); 487 512 Q_ASSERT( ptib && ptib->tib_ptib2 ); 488 513 489 514 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 491 516 Q_ASSERT( ptib->tib_ptib2->tib2_ultid == 1 ); 492 517 // also make sure that QtOS2SysXcptMainHandler was not already … … 551 576 // default font 552 577 if ( !qt_app_has_font ) 553 QApplication::setFont( QFont( "Helv", 8) );578 QApplication::setFont( QFont( "System Proportional", 10 ) ); 554 579 555 580 // QFont::locale_init(); ### Uncomment when it does something on OS/2 … … 590 615 591 616 #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() 593 618 PTIB ptib = NULL; 594 619 DosGetInfoBlocks( &ptib, NULL ); 595 620 Q_ASSERT( ptib && ptib->tib_ptib2 ); 596 621 597 622 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 599 624 Q_ASSERT( ptib->tib_ptib2->tib2_ultid == 1 ); 600 625 // also make sure the handler was really installed by qt_init() … … 1003 1028 enum { 1004 1029 // some undocumented messages (they have the WM_U_ prefix for clarity) 1005 1030 1006 1031 // sent to hwnd that has been entered to by a mouse pointer. 1007 1032 // FID_CLIENT also receives enter messages of its WC_FRAME. … … 2064 2089 return; 2065 2090 } 2066 2091 2067 2092 // find the modal's group leader 2068 2093 QWidget *mgl = modal->parentWidget(); … … 2548 2573 #endif 2549 2574 if ( curWin != winId() ) { // new current window 2550 /// @todo (dmik) 2575 /// @todo (dmik) 2551 2576 // add CS_HITTEST to our window classes and handle WM_HITTEST, 2552 2577 // otherwise disabled windows will not get mouse events? … … 2764 2789 // Alt+letter shortcuts in the NLS keyboard mode together with Alt+NLS_letter 2765 2790 // shortcuts (nice feature imho). Note that Alt+NLS_letter shortcuts are 2766 // correctly processed in any case. 2791 // correctly processed in any case. 2767 2792 2768 2793 // cache table to store Qt::Key_... values for 256 hardware scancodes
Note:
See TracChangeset
for help on using the changeset viewer.