SVN commit 768072 by amantia: Backport the KSqueezedTextLabel width fix. M +9 -1 ksqueezedtextlabel.cpp --- branches/KDE/4.0/kdelibs/kdeui/widgets/ksqueezedtextlabel.cpp #768071:768072 @@ -18,6 +18,8 @@ #include "ksqueezedtextlabel.h" +#include + class KSqueezedTextLabelPrivate { public: @@ -61,7 +63,13 @@ QSize KSqueezedTextLabel::sizeHint() const { - return QSize(contentsRect().width(), QLabel::sizeHint().height()); + int maxWidth = KGlobalSettings::desktopGeometry( this ).width() * 3 / 4; + QFontMetrics fm(fontMetrics()); + int textWidth = fm.width(d->fullText); + if (textWidth > maxWidth) { + textWidth = maxWidth; + } + return QSize(textWidth, QLabel::sizeHint().height()); } void KSqueezedTextLabel::setText( const QString &text ) {