fix size calculation for named separators (sections), when no action is present

wilder-pre-rebase
Hugo Pereira Da Costa 12 years ago
parent abcf82cb1b
commit 4042840fca
  1. 9
      kstyle/breezestyle.cpp

@ -2425,12 +2425,13 @@ namespace Breeze
// build toolbutton option
const QStyleOptionToolButton toolButtonOption( separatorMenuItemOption( menuItemOption, widget ) );
// make sure height is large enough for icon
// make sure height is large enough for icon and text
const int iconWidth( menuItemOption->maxIconWidth );
size.setHeight( qMax( size.height(), (int) iconWidth ) );
const int textHeight( menuItemOption->fontMetrics.height() );
if( !menuItemOption->icon.isNull() ) size.setHeight( qMax( size.height(), (int) iconWidth ) );
if( !menuItemOption->text.isEmpty() ) size.setHeight( qMax( size.height(), (int) textHeight ) );
// return size from CT_ToolButton
return expandSize( size, Metrics::MenuItem_MarginWidth );
return sizeFromContents( CT_ToolButton, &toolButtonOption, size, widget );
}

Loading…
Cancel
Save