LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File kdm-wordbreak.diff of Package kdebase4-workspace (Project openSUSE:11.4)

Index: kdm/kfrontend/kfdialog.cpp
===================================================================
--- kdm/kfrontend/kfdialog.cpp.orig	2010-08-05 18:55:46.000000000 +0200
+++ kdm/kfrontend/kfdialog.cpp	2010-11-21 20:47:03.524842955 +0100
@@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fi
 
 #include <KGuiItem>
 #include <KPushButton>
+#include <KGlobalSettings>
 
 #include <QApplication>
 #include <QDesktopWidget>
@@ -172,6 +173,9 @@ KFMsgBox::KFMsgBox(QWidget *parent, QMes
     QLabel *label1 = new QLabel(this);
     label1->setPixmap(QMessageBox::standardIcon(type));
     QLabel *label2 = new QLabel(text, this);
+    QRect d = KGlobalSettings::desktopGeometry(this);
+    if ( label2->fontMetrics().size( 0, text).width() > d.width() * 3 / 5)
+        label2->setWordWrap( true );
     KPushButton *button = new KPushButton(KStandardGuiItem::ok(), this);
     button->setDefault(true);
     button->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred));