Changeset 8 for trunk/src/styles


Ignore:
Timestamp:
Nov 16, 2005, 8:36:46 PM (20 years ago)
Author:
dmik
Message:

Transferred Qt for OS/2 version 3.3.1-rc5 sources from the CVS

Location:
trunk/src/styles
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/styles/qcommonstyle.cpp

    r7 r8  
    146146#ifndef QT_NO_LISTVIEW
    147147    case PE_CheckListController: {
    148         p->drawPixmap(r, QPixmap((const char **)check_list_controller_xpm));
     148        QRect pr( r );
     149        QPixmap px( (const char **)check_list_controller_xpm );
     150        // center pixmap if smaller, otherwise it will be scaled to fit
     151        int d = pr.width() - px.width();
     152        if ( d > 0 ) {
     153            pr.setX( pr.x() + d / 2 );
     154            pr.setWidth( px.width() );
     155        }
     156        d = pr.height() - px.height();
     157        if ( d > 0 ) {
     158            pr.setY( pr.y() + d / 2 );
     159            pr.setHeight( px.height() );
     160        }
     161        p->drawPixmap( pr, px );
    149162        break; }
    150163    case PE_CheckListExclusiveIndicator: {
  • trunk/src/styles/qcompactstyle.cpp

    r7 r8  
    152152            const QPopupMenu *popupmenu = (const QPopupMenu *) widget;
    153153            QMenuItem *mi = opt.menuItem();
     154           
     155            // QPopupMenu has WResizeNoErase and WRepaintNoErase flags, so we
     156            // must erase areas not covered by menu items (this is requested by
     157            // QPopupMenu using 0 as the menu item argument).
     158            // [Win32 version feels ok without this, because it doesn't actually
     159            // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always
     160            // erases the background before WM_PAINT and after every resize].
     161#if !defined (Q_WS_PM)
    154162            if ( !mi )
    155163                break;
     164#endif
    156165
    157166            int tab = opt.tabWidth();
  • trunk/src/styles/qmotifplusstyle.cpp

    r7 r8  
    757757            QPopupMenu *popupmenu = (QPopupMenu *) widget;
    758758            QMenuItem *mi = opt.menuItem();
     759           
     760            // QPopupMenu has WResizeNoErase and WRepaintNoErase flags, so we
     761            // must erase areas not covered by menu items (this is requested by
     762            // QPopupMenu using 0 as the menu item argument).
     763            // [Win32 version feels ok without this, because it doesn't actually
     764            // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always
     765            // erases the background before WM_PAINT and after every resize].
     766#if !defined (Q_WS_PM)
    759767            if ( !mi )
    760768                break;
     769#endif
    761770
    762771            int tab = opt.tabWidth();
  • trunk/src/styles/qmotifstyle.cpp

    r7 r8  
    10041004            const QPopupMenu *popupmenu = (const QPopupMenu *) widget;
    10051005            QMenuItem *mi = opt.menuItem();
     1006           
     1007            // QPopupMenu has WResizeNoErase and WRepaintNoErase flags, so we
     1008            // must erase areas not covered by menu items (this is requested by
     1009            // QPopupMenu using 0 as the menu item argument).
     1010            // [Win32 version feels ok without this, because it doesn't actually
     1011            // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always
     1012            // erases the background before WM_PAINT and after every resize].
     1013#if !defined (Q_WS_PM)
    10061014            if ( !mi )
    10071015                break;
     1016#endif
    10081017
    10091018            int tab = opt.tabWidth();
  • trunk/src/styles/qsgistyle.cpp

    r7 r8  
    946946                break;
    947947            QMenuItem *mi = opt.menuItem();
     948           
     949            // QPopupMenu has WResizeNoErase and WRepaintNoErase flags, so we
     950            // must erase areas not covered by menu items (this is requested by
     951            // QPopupMenu using 0 as the menu item argument).
     952            // [Win32 version feels ok without this, because it doesn't actually
     953            // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always
     954            // erases the background before WM_PAINT and after every resize].
     955#if !defined (Q_WS_PM)
    948956            if ( !mi )
    949957                break;
     958#endif
    950959            const QPopupMenu *popupmenu = (const QPopupMenu *) widget;
    951960            int tab = opt.tabWidth();
  • trunk/src/styles/qwindowsstyle.cpp

    r7 r8  
    8585enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight };
    8686
     87#ifndef QT_NO_MENUDATA
    8788// A friendly class providing access to QMenuData's protected member.
    8889class FriendlyMenuData : public QMenuData
     
    9091    friend class QWindowsStyle;
    9192};
     93#endif
    9294
    9395// Private class
     
    158160        break;
    159161    case QEvent::KeyRelease:
     162#ifndef QT_NO_MENUDATA
    160163        if (((QKeyEvent*)e)->key() == Key_Alt) {
    161164            widget = widget->topLevelWidget();
     
    172175            }
    173176        }
     177#endif
    174178        break;
    175179    case QEvent::FocusIn:
    176180    case QEvent::FocusOut:
     181#ifndef QT_NO_MENUBAR
    177182        {
    178183            // Menubars toggle based on focus
     
    181186                menuBarTimer = menuBar->startTimer(0);
    182187        }
     188#endif
    183189        break;
    184190    case QEvent::Close:
     
    188194        break;
    189195    case QEvent::Timer:
     196#ifndef QT_NO_MENUBAR
    190197        {
    191198            QMenuBar *menuBar = ::qt_cast<QMenuBar*>(o);
     
    198205            }
    199206        }
     207#endif
    200208        break;
    201209    default:
     
    841849            const QPopupMenu *popupmenu = (const QPopupMenu *) widget;
    842850            QMenuItem *mi = opt.menuItem();
     851           
     852            // QPopupMenu has WResizeNoErase and WRepaintNoErase flags, so we
     853            // must erase areas not covered by menu items (this is requested by
     854            // QPopupMenu using 0 as the menu item argument).
     855            // [Win32 version feels ok without this, because it doesn't actually
     856            // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always
     857            // erases the background before WM_PAINT and after every resize].
     858#if !defined (Q_WS_PM)
    843859            if ( !mi )
    844860                break;
    845 
     861#endif
     862           
    846863            int tab = opt.tabWidth();
    847864            int maxpmw = opt.maxIconWidth();
Note: See TracChangeset for help on using the changeset viewer.