Logo Search packages:      
Sourcecode: tastymenu version File versions  Download package

int TastyMenu::heightForWidth ( int  width ) const [virtual]
Returns:
A suggested height for a given width.

Every applet should reimplement this function.

Depending on the panel orientation the height (horizontal panel) or the width (vertical panel) of the applets is fixed. The exact values of the fixed size component depend on the panel size.

On a vertical panel the applet width is fixed, the panel will call heightForWidth(int width) with width equal to 'the fixed applet width' when laying out the applets.

The applet can now choose the other size component (height) based on the given width.

The height you return is granted.

Definition at line 375 of file tastymenu.cpp.

{
  int buttonHeight = height();
  if( position() == pLeft || position() == pRight )
  {
    if( prefSkel->menuButtonLabelType()
        != Prefs::EnumMenuButtonLabelType::MenuButtonNone )
    {
      button -> setTextPosition(QToolButton::BelowIcon);
      return ((button->fontMetrics()).height()) + _iconsize + 10;
    }
    else
      return width;
  }
  else
    return buttonHeight;
}

Generated by  Doxygen 1.6.0   Back to index