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/widgets/qmenubar.cpp

    r2 r174  
    295295    int h = 2*motifBarVMargin + fm.height() + motifItemVMargin + 2*frameWidth() + 2*motifItemFrame;
    296296
     297    if ( style().styleHint( QStyle::SH_GUIStyle ) == QStyle::PMStyle )
     298        h++;
     299
    297300    setGeometry( 0, 0, width(), h );
    298301
     
    483486void QMenuBar::languageChange()
    484487{
    485     menuContentsChanged(); 
     488    menuContentsChanged();
    486489}
    487490
     
    729732    bool reverse = QApplication::reverseLayout();
    730733    const int yoffset = 1; //(style().styleHint( QStyle::SH_GUIStyle ) == QStyle::WindowsStyle) ? 4 : 1; ### this breaks designer mainwindow editing
    731     QPoint pos = r.bottomLeft() + QPoint(0,yoffset);
     734    // Warp4style: popup menus are displaced by 4
     735    const int xoffset = ( style().styleHint( QStyle::SH_GUIStyle ) == QStyle::PMStyle ) ? -4 : 0;
     736    QPoint pos = r.bottomLeft() + QPoint( xoffset, yoffset );
    732737    if( reverse ) {
    733         pos = r.bottomRight() + QPoint(0,yoffset);
     738        pos = r.bottomRight() + QPoint( -xoffset, yoffset );
    734739        pos.rx() -= popup->sizeHint().width();
    735740    }
     
    913918        x += 2;
    914919        y += 2;
     920    } else if ( gs == PMStyle ) {
     921        x += 4;
    915922    }
    916923    if ( reverse )
     
    976983                    x += motifBarHMargin;
    977984                    y += motifBarVMargin;
     985                } else if ( gs == PMStyle ) {
     986                    x += 5;
    978987                }
    979988                if ( reverse )
Note: See TracChangeset for help on using the changeset viewer.