Commit 7f946e2109a65794d3313ac259329d8c3d36cc19

  • avatar
  • Stanislav Karchebny <stanislav.karchebny @kde…il.net>
  • Sat Feb 28 07:24:43 CET 2004
* Added more sane OSD resizing rules.

svn path=/trunk/kdeextragear-1/amarok/; revision=292124
  
5757
5858 QFontMetrics *fm = new QFontMetrics( font );
5959 /* AlignAuto = we want to align Arabic to the right, don't we? */
60 QRect fmRect = fm->boundingRect( 0, 0, d->width(), d->height(), AlignAuto | WordBreak, text );
60 /* Sane width and height limits - don't go over the screen dimensions,
61 and don't cover whole desktop neither. */
62 QRect fmRect = fm->boundingRect( 0, 0, d->width()-40, d->height()-100, AlignAuto | WordBreak, text );
6163
6264 QFont titleFont("Arial", 12, QFont::Bold);
6365 QFontMetrics *titleFm = new QFontMetrics( titleFont );
66 /* Measure how much title will take, but don't let it take too much vertically. */
67 QRect titleRect = titleFm->boundingRect( 0, 0, d->width()-40, titleFm->height(), AlignAuto, m_appName );
6468
65 fmRect.addCoords( 0, 0, 20, titleFm->height() );
69 if ( fmRect.width() < titleRect.width() )
70 fmRect.setWidth( titleRect.width() );
71 fmRect.addCoords( 0, 0, 20, titleRect.height() );
6672
6773 resize( fmRect.size() );
6874 // QPixmap *buffer = new QPixmap( fmRect.width(), fmRect.height() );