|
|
|
@ -2882,5 +2882,32 @@ QPopupMenu::updateScrollerState()
|
|
|
|
|
d->scroll.topScrollableIndex++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
Calculates the height in pixels of the menu item \a mi.
|
|
|
|
|
*/
|
|
|
|
|
int QPopupMenu::menuItemHeight( QMenuItem *mi, QFontMetrics fm )
|
|
|
|
|
{
|
|
|
|
|
if ( mi->widget() )
|
|
|
|
|
return mi->widget()->height();
|
|
|
|
|
if ( mi->custom() && mi->custom()->fullSpan() )
|
|
|
|
|
return mi->custom()->sizeHint().height();
|
|
|
|
|
|
|
|
|
|
int h = 0;
|
|
|
|
|
if ( mi->isSeparator() ) // separator height
|
|
|
|
|
h = 2;
|
|
|
|
|
else if ( mi->pixmap() ) // pixmap height
|
|
|
|
|
h = mi->pixmap()->height();
|
|
|
|
|
else // text height
|
|
|
|
|
h = fm.height();
|
|
|
|
|
|
|
|
|
|
if ( !mi->isSeparator() && mi->iconSet() != 0 )
|
|
|
|
|
h = QMAX(h, mi->iconSet()->pixmap( QIconSet::Small,
|
|
|
|
|
QIconSet::Normal ).height());
|
|
|
|
|
if ( mi->custom() )
|
|
|
|
|
h = QMAX(h, mi->custom()->sizeHint().height());
|
|
|
|
|
|
|
|
|
|
return h;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // QT_NO_POPUPMENU
|
|
|
|
|
|
|
|
|
|